Ffmpeg

From XPUB & Lens-Based wiki

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

Setting a start time

Extract 2 fps (-r) starting at 1:45:02 (-ss) and process 10 seconds of the input (-t 10).

ffmpeg -i inputfile.avi  -r 2 -ss 01:45:02 -t 10 image-%d.jpeg

Alternately -vframes lets you specify how many output frames you want (rather than input time)?

ffmpeg -i inputfile.avi  -r 2 -ss 01:45:02 -vframes 10 image-%d.jpeg