Extracting all frames from a video file is easily achieved with
FFmpeg.
Here's a simple command line that will create 25 PNG images from every second of footage in the input DV file. The images will be saved in the current directory.
ffmpeg -i input.dv -r 25 -f image2 images%05d.png
The newly created files will all start with the word "images" and be numbered consecutively, including five pre-appended zeros. e.g. images000001.png.
From a video that was 104 seconds long, for a random example, this command would create 2600 PNG files! Quite messy in the current directory, so instead use this command to save the files in a sub-directory called extracted_images:
ffmpeg -i input.dv -r 25 -f image2 extracted_images/images%05d.png
Moving on, let's say you just wanted 25 frames from the first 1 second, then this line will work:
ffmpeg -i input.dv -r 25 -t 00:00:01 -f image2 images%05d.png
The -t flag in FFmpeg specifies the length of time to transcode. This can either be in whole seconds or hh:mm:ss format.
Making things a little more complex we can create images from all frames, beginning at the tenth second, and continuing for 5 seconds, with this line:
ffmpeg -i input.dv -r 25 -ss 00:00:10 -t 00:00:05 -f image2 images%05d.png
The -ss flag is used to denote start position, again in whole seconds or hh:mm:ss format.
Maybe extracting an image from every single frame in a video, resulting in a large number of output files, is not what you need. Here's how to create a single indicative poster frame, of the video clip, from the first second of footage:
ffmpeg -i input.dv -r 1 -t 00:00:01 -f image2 images%05d.png
Notice that the -r flag is now set to 1.
If you want the poster frame from a different part of the clip, then specify which second to take it from using the -ss tag, in conjunction with the line above.
Lastly, if you wanted to create a thumbnail story board, showing action throughout the entire length of the video clip, you'll need to specify the output image dimensions. Use the following line:
ffmpeg -i input.dv -r 1 -f image2 -s 120x96 images%05d.png
My original file was 720x576, so the image dimensions are a whole division of this.
After a couple of tips on the FFmpeg user mailing list, I re-ran this test with some command optimisations. Specifically:
New FFMPEG command example for x264, second pass is:
ffmpeg -i 2573-9.mpg -vcodec libx264 -flags +loop -coder ac -f mov -b 2000k -acodec libfaac -ab 128k -s 736x442 -croptop 34 -cropbottom 4 -cropleft 8 -cropright 8 -deinterlace -pass 2 2537-9_x2642passnew.mov
New screen grab is here, again click for a larger version:
x264 still on the left, xVid on the right. Old 2 pass files bottom. New 2 pass files, with - coder ac and - flags +loop added to the FFmpeg command, on top.
The new x264 file is slightly larger than the old one (50 bytes increase). The xVid file is the same size.
From the new screen grab, it can be seen that the x264 output is now clearly superior. In this case it can be really proved that optimising the FFmpeg command can truly make a difference.