3

I'm new to using ffmpeg, but I want to extract 15 consecutive frames (resized to 320x240) at specific time intervals from an existing video. What I have so far is this:

ffmpeg -ss 30 -i inVideo.mp4 -vframes 15 out%d.png -s 320x240

While this does create 15 frames at the 30 second mark, they are not resized. Also, if I have this in a loop, the output images will be overwritten. I want to create a total of 9 time intervals with 15 frames/images each. Any idea of how I can accomplish that?

Thanks for all your help!

3

Basic template is

ffmpeg -i inVideo.mp4
  -vf "select='between(t,30,30.5)+between(t,45,45.5)+between(t,73,73.5)"
  -s 320x240 -vsync 0 out%d.png

The select filter expression selects all frames in each of the three ranges. I've chosen an endpoint 0.5 seconds greater than the start point under the assumption that the video is 30 frames per second. Adjust accordingly.

Frame sizing is an output option so it has to appear before the output it is meant for.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.