FFmpeg : How to get last frame from a video

Use

ffmpeg -sseof -3 -i input -update 1 -q:v 1 last.jpg

This will seek to the last three seconds of the input and output all frames. But since -update 1 is set, each frame will be overwritten to the same file, leaving only the last frame remaining.