3

I've got a bunch (several 100) of videos (all different frame-rates and different lengths).
Each has an end-title during the last second of the video, that shows some important information I need to check.
Playing each video in a player, scrolling to the end and trying to pause it in the last second is just to cumbersome/time-consuming.
Grabbing a frame at that position and saving it as an image for each video lets me quickly check the info using the image-preview in my file-manager. Which is much more efficient.

ffmpeg can capture single frames and write them to a jpg or png, but I am at a loss how to extract a frame in the middle of that title sequence. 0.5 seconds before the end of each video would be the sweet spot. (There is a animation effect during that 1 second sequence that makes the text in the video sometimes hard to read, but exactly in the middle the visibility is best.)
As far as I can tell ffmpeg can't use offsets "from the end", so I assume ffprobe is probably needed to analyze the video and on basis off that the correct ffmpeg command can be generated.

I can handle the scripting around it to batch-process all the files.
Problem is that I'm very unfamiliar with video in general, ffmpeg and ffprobe in particular. I need some help to get started.
If someone can explain to me how to get from the full video 'clip.mp4' to the single frame 0.5 seconds before the end in 'clip_frame.jpg' I would be most grateful.

Tonny
  • 671
  • 5
  • 17

1 Answers1

4

For inputs with known or estimated duration i.e. not live, piped or raw streams, ffmpeg can seek to a time stamp from the end, using input option -sseof

ffmpeg -sseof -0.5 -i input -vframes 1 end.png
Gyan
  • 85,394
  • 9
  • 169
  • 201