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
aviplay(1)																aviplay(1)

NAME
aviplay - QT-based movie player SYNOPSIS
aviplay [options] [ files | URLs ] DESCRIPTION
aviplay is a QT-based player for various avi, asf, mpeg4 movie files. Avifile project creates library that allows programs to read and write compressed AVI/ASF files (Indeo Video, DivX :-), etc.) under Unix OS. (De)compression is performed with various plugins (included Win32 DLLs for x86_32 OS) if native codec is not available. Win32 libraries have to be downloaded separately. Primarily the ffmpeg project is used for codecs and also for stream parsing. Over the time it's possible the project will mostly blend into ffmpeg. FEATURES
* low CPU usage (movies playable even P200MMX) * smooth video (using threads and frame precaching) * supports streamed .asf files * audio resampling suppport * modular design OPTIONS
-h --help Show help message -c --codec [help] Set codec options (use help to see options for this parameter) -s --size <width:height> Start playing movie at dimensions X * Y. -f --fullscreen Start playing movie in fullscreen. -f --maximize Start playing movie in maximized mode (i.e. preserve current resolution). --seek <position> Seek to given position in movie. -sub --subtitle <filename> Use give file as the source for subtitles. -subcp --subtitle_codepage <codepage> Select codepage for subtitles. They are internaly encoded into UTF-8. See iconv(3) for available codepages. Codepage "default" means current default encoding in system. Example of codepages: CP1250, ISO8859-2, default. -subfont --subtitle_font <fontname> Select font for subtitles. At this moment only X11 fonts are supported (either in traditional "-misc-*" or TTF notation) -ac --audio-codec <codecname> Prefered codec to be used for movie audio decoding. Use with "help" to see available audio codecs. -vc --video-codec <codecname> Prefered codec to be used for movie video decoding. Use with "help" to see available video codecs. --rc Enables remote control (stdin|stdout). SHELL variables: WIN32_PATH - can be used to override library path /usr/lib/win32 which holds MS Windows binary dll codecs. AVIPLUGIN_PATH - can be used to override library path /usr/lib/avifile which holds avifile plugins. AVIPLAY_MUTE_AUDIO - if set shows just video track AVIPLAY_MUTE_VIDEO - if set plays just audio track AVIPLAY_NOSYNC - do not synchronize audio and video track HTTP_PROXY WRITE_ASF - write asf file received over the network to file (/tmp/*.asf) NOTE
Press the About button in aviplay's GUI for more details about the usage and configuation. Aviplay automaticaly searches for subtitle file with the same name as the original ".avi" file but with .sub, .SUB, .srt, .SRT, .txt, .TXT, .smi, .SMI suffix. For Debian users: After the discussion with the autor I have came to the conclusion that GSM codec is legaly distributed under GPL terms since this piece of code was donated to the project by the original author which was using it in the non-GPL project xanim. SEE ALSO
http://avifile.sourceforge.net for the original source and main CVS archive for binary codecs. http://mplayerhq.hu for mplayer - an excelent player with more options and supported formats AUTHORS
Original author: Eugene Kuznetsov <divx@euro.ru> Current developer: Zdenek Kabelac <kabi@users.sourceforge.net> Zdenek Kabelac 12 February 2003 aviplay(1)