After much trial and error I’ve finally figured out how to extract a specfic frame from a video file using FFmpeg. The command to accomplish this looks like:
ffmpeg -i swing.avi -ss 6.0 -t 0.001 -y -f singlejpeg swing.jpg
While I’m not sure how to specify an exact frame number, you can specify a start time offset (-ss). You also need to specify the duration (-t), which in most cases will be 0.001.
I’ve received a few emails from FFmpeg users that can’t seem to get this to work. Give this a try and please let me know if you run into any problems.
[...] I recently posted about extracting jpeg frames from video files. I received an email from a reader who was having problems with the singlejpeg argument. It turns out that the latest version of FFmpeg doesn’t support this argument which has now been replaced by mjpeg. I haven’t had the opportunity to upgrade, but if you run into problems be sure to give this a try. [...]