I'd like to grab the last frame in a video (.mpg
, .avi
, whatever) and dump it into an image file (.jpg
, .png
, whatever). Toolchain is a modern Linux command-line, so things like mencoder
, transcode
, ffmpeg
&c.
Cheers, Bob.
This isn't a complete solution, but it'll point you along the right path.
Use ffprobe -show_streams IN.AVI
to get the number of frames in the video input. Then
ffmpeg -i IN.AVI -vf "select='eq(n,LAST_FRAME_INDEX)'" -vframes 1 LAST_FRAME.PNG
where LAST_FRAME_INDEX is the number of frames less one (frames are zero-indexed), will output the last frame.