bs7280
bs7280

Reputation: 1094

A faster way to get screenshots of a video with ffmpeg

I am trying to use ffmpeg to get screenshots of a video at a given rate, which works exactly as I want, except for the fact that it has to process the entire video (which can take a long time) and use a ton of CPU resources just to grab a few frames.

Here is the ffmpeg command that I am using to get the screenshots:

ffmpeg -i "$videoName" -vf fps=$enterFPS img%03d.jpg

Is there any way to make that faster?

Upvotes: 1

Views: 2941

Answers (1)

Chamath
Chamath

Reputation: 2044

You can try select filter instead.

ffmpeg -i input_video -vf "select=between(t\,10\,20)" -vsync vfr output_image%04d.png

This will output all the frames in between 10-20 time interval. You can also refer here for more information.

Upvotes: 1

Related Questions