ffmpeg or mplayer for avi conversion?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ffmpeg or mplayer for avi conversion?
# 1  
Old 03-28-2008
ffmpeg or mplayer for avi conversion?

I need to output a summary of a video as an animated gif. Ideally, I would have 8 equally-spaced frames from the video, and play them back one at a time, each for 0.25 seconds. So I'd have a 2 second animated gif.

This is what I have so far:

Code:
#!/bin/bash
mplayer "$@" -vo gif89a:output="$@".gif:fps=1 -vf scale=640:480 -endpos 8 -really-quiet

As you can see, I'm taking eight frames from the first eight seconds of video. What can I use to take eight frames from $timeOfVideo/7 time periods. Note that I'm dividing the time of the video by 7, not 8, so that I will have the first and last frames of the video in the gif.

My second problem is shortening the duration that each frame is shown. Currently, each frame is shown for 1 second. How can I reduce that to 0.25 seconds?

I am starting to think that ffmpeg is a better tool for the job, however, surprisingly I cannot find relevant examples in Google. Can ffmpeg do what I need? Can mplayer, for that matter? Something else?

Thanks in advance.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Debian

How to play avi files Raspberry Pi?

Raspberry Pi B 2014-01-07 Raspbian fully up to date. Installed and configured motion for surveillance. It works just fine and creates .avi files and .jpeg. Installed Mplayer trying to run it from desktop was not successful. I did try to do a command line by executing sudo mplayer... (6 Replies)
Discussion started by: oldcity
6 Replies

2. UNIX and Linux Applications

Burn avi to cd with k3b

Is there a way to burn avi to cd with k3b? When I tried the disc became unusable. I tried to open the disc on 2 different computers with no luck. (0 Replies)
Discussion started by: cokedude
0 Replies

3. UNIX and Linux Applications

Help in converting VOB file to AVI

Hello to all in forum, Somebody could help me saying me which command or application can I use to convert correctly a VOB file of more than 5 GB in size. I have the VIDEO_TS folder with the files: - VTS_01 - Stream Information.txt - VTS_01_0.IFO - VTS_01_1.VOB The Stream Information... (4 Replies)
Discussion started by: Ophiuchus
4 Replies

4. UNIX and Linux Applications

fix broken avi index

I need some recommendations on programs to fix broken avi index. Please tell me what your experiences have been with the program. Which programs work and which ones don't work. (1 Reply)
Discussion started by: cokedude
1 Replies

5. Linux

convert avi to cellphone friendly 320x176 mp4 file...ffmpeg to the rescue :)

found a few ffmpeg posts and after a few unsuccessful attempts, I have found a solution :) to encode an avi to to an nokia e71 recognized mp4 format: ffmpeg -y -i inputFILE.avi -acodec aac -ab 72k -s 320x176 -aspect 16:9 -vcodec h264 -b 300k -qcomp 0.6 -qmin 16 -qmax 51 -qdiff 4 -flags +loop... (2 Replies)
Discussion started by: mr_manny
2 Replies

6. UNIX and Linux Applications

Convert .mp4 to .avi

Hello, I need software to convert multimedia files. What is the good software? I was looking for it on the web, but I did not find any special. Thanks... (1 Reply)
Discussion started by: feliks
1 Replies

7. Solaris

Playing AVI in solaris 8

how to play avi file in solaris8 ??... it is not opening in realplayer 7 ..... i also dont have the root login ...plz help !!! (2 Replies)
Discussion started by: coolguyshail
2 Replies

8. UNIX for Advanced & Expert Users

help wanted kernel avi

Hello there! Slightly off topic maybe, but maybe someone can help us. For a videoshow which will be called reality 6.1 we need a video file from a unix kernel that is compiling. Does anyone know how to capture this, or does anyone have such a vid? cheers, iuno (www.iuno.nl) (2 Replies)
Discussion started by: iuno
2 Replies
Login or Register to Ask a Question
avisplit(1)						      General Commands Manual						       avisplit(1)

NAME
avisplit - split AVI-files into chunks of a maximum size SYNOPSIS
avisplit [ -i file -o base [ -s size ] [ -H num ] [ -t s1-s2[,s3-s4,..] -c -m -b num -f commentfile ] ] [ -v ] COPYRIGHT
avisplit is Copyright (C) by Thomas Oestreich. DESCRIPTION
avisplit splits a single AVI-file into chunks of size size. Each of the created chunks will be an independent file, i.e. it can be played without needing any other of the chunk. OPTIONS
-i file Specify the filename of the file to split into chunks. -o base Specify the base of the output filename(s) avisplit will then split to base-%04d.avi -s size Use this option to specify the maximum size (in units of MB) of the chunks avisplit should create. 0 means dechunk, create as many files as possible. -H num Create only the first num chunks then exit. -t s1-s2[,s3-s4,..] Split the input file based on time/framecode (hh:mm:ss.ms) -c Together with -t. Merge all segments into one AVI-File again instead generating seperate files. -m Together with -t. Force split at upper bondary instead of lower border. -b num Specify if avisplit should write an VBR mp3 header into the AVI file. Default is 1 because it does not hurt. num is either 1 or 0. -f commentfile Read AVI tombstone data for header comments from commentfile. See /docs/avi_comments.txt for a sample. -v Print only version information and exit. EXAMPLES
The command avisplit -s 700 -i my_file.avi will split the file my_file.avi into chunks which's maximum size will not exceed 700 MB, i.e. they will fit onto a CD, each. The created chunks will be named my_file.avi-0000, my_file.avi-0001, etc. avisplit -i my_file.avi -c -o out.avi -t 00:10:00-00:11:00,00:13:00-00:14:00 will grab Minutes 10 to 11 and 13 to 14 from my_file.avi and merge it into out.avi BAD SYNCH
When you split a file with avisplit and the A/V sync for the first file is OK but the sync on all successive files is bad then have a look at the output of tcprobe(1) (shortend). | V: 25.000 fps, codec=dvsd, frames=250, width=720, height=576 | A: 48000 Hz, format=0x01, bits=16, channels=2, bitrate=1536 kbps, | 10 chunks, 1920000 bytes You'll see the AVI file has only 10 Audio chunks but 250 video chunks. That means one audio chunk spans several video frames. avisplit can not cut a chunk in half, it only handles complete chunks. If you do, say, avisplit -s 20, it is possible that the first file will have 6 audio chunks and the second one only 4 meaning there is too much audio in the first AVI file. The solution is to remux the AVI file with transcode -i in.avi -P1 -N 0x1 -y raw -o out.avi (of course -N 0x1 is not correct for all AVI files). Now look at tcprobe again | V: 25.000 fps, codec=dvsd, frames=250, width=720, height=576 | A: 48000 Hz, format=0x01, bits=16, channels=2, bitrate=1536 kbps, | 250 chunks, 1920000 bytes The data in this file is exactly the same (its bit-identical) as it was in in.avi; the AVI file was just written in a different way, we do now have 250 audio chunks which makes splitting much easier and more accurate for avisplit. AUTHORS
avisplit was written by Thomas Oestreich <ostreich@theorie.physik.uni-goettingen.de> with contributions from many others. See AUTHORS for details. SEE ALSO
aviindex(1), avifix(1), avimerge(1), tccat(1), tcdecode(1), tcdemux(1), tcextract(1), tcprobe(1), tcscan(1), transcode(1) avisplit(1) 25th June 2003 avisplit(1)