Ffmpeg

From XPUB & Lens-Based wiki
Revision as of 09:37, 18 February 2013 by Michael Murtaugh (talk | contribs)

Powerful command line video tool originally written by Fabrice Bellard (under the pseudonym "Gerard Lantau")

Be sure to check you / print your own ffmpeg documentation!
http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html

Convert a video into individual frames

The -r option sets the framerate. A framerate of .01 (or 1/100) means 100 seconds per frame. In this way you can easily make an overview of a movie:

ffmpeg -i rearwindow.avi -f image2 -y -r .01 -an rearwindow%06d.jpg

The "%06d" means to "pad" (or fill) the filename to having always 6 places (so adding extra 0's before the number as necessary so that the filenames all have the right size and avoiding any problem with sorting later). This follows the convention of the C printf command).

Extract 1 frame per second (padding to 3 places):

ffmpeg -i inputfile.avi -r 1 -f image2 image-%3d.jpeg