“FFmpeg” is a free software and is licensed under the LGPL or GPL depending on your choice of configuration options. It does various extraordinary tasks like Convert Pictures To Movie, Audio and video conversions, audio extraction and lot more.
FFmpeg supports most of the popular formats, we don’t need to worry a lot about that. Formats supported by FFmpeg include MPEG, MPEG-4 (Divx), ASF, AVI, Real Audio/Video and Quicktime. To see a list of all the codecs/formats supported by FFmpeg, run the following command:
$ ffmpeg -formats
Audio Conversion
source.wav and want to convert it in a mp3.
$ ffmpeg -i source.wav target.mp3
(-i is input file)
remove 30 seconds from the beginning of an mp3 file but keep the rest
$ ffmpeg -ss 30 -acodec copy -i source.mp3 target.mp3
(-ss position Seek to given time position in seconds)
crop to the first 30 seconds of an mp3 file
$ ffmpeg -t 30 -acodec copy -i source.mp3 target.mp3
(-t duration Restrict the transcoded/captured video sequence to the duration specified in seconds)
Video Conversion
basic usage
$ ffmpeg -i my_video.mpeg -s 800×600 my_video.flv
(-s ‘size’ set video resolution size [Width x Height])
Extract images from a video
extract some images from a movie, and ffmpeg can do this easily
$ ffmpeg -i video.mpg image%d.jpg
(This will create 25 images for every 1 second, but it may serve us to have more or less images, this can be achieved with the parameter -r
-r fps Set frame rate [default 25])
$ ffmpeg -i video.mpg -r 1 image%d.jpg
(With this command you’ll get 1 image for every second)
This command will take 25 images images every second beginning at the tenth second, and continuing for 5 seconds
$ ffmpeg -i video.mpg -r 25 -ss 00:00:10 -t 00:00:05 images%05d.png
(-ss & -t has “hh:mm:ss[.xxx]” syntax is supported)
Extract audio from a video
we can extract an mp3 track from a video
$ ffmpeg -i video.avi -f mp3 audio.mp3
(-f fmt Force the format)
it’s also possible to use the option to disable video capture
$ ffmpeg -i video.avi -vn audio.mp3
(-vn Disable video recording)
Convert images to movie
Let say you have a lot of images named `img001.jpg’, `img002.jpg’ and so on in sequence, you can convert them into a movie with this command
$ ffmpeg -f image2 -i img%d.jpg video.mpg
Disassemble a video clip to images
$ ffmpeg -i video.mpg image%d.jpg
Project site with documentation http://www.ffmpeg.org/ffmpeg-doc.html

