5

I have a video and I want to extract every 10th frame as I am getting way too many images.

ffmpeg -i out1.avi -r 1 -f image2 image-%3d.jpeg

How to extract images from video file?

3
  • usually video has at least 25 frames per seconds - so using -r 1 you get image every 25th frame. If you want to get every 10th then you will have even more images. Commented May 2, 2021 at 3:00
  • No i should have less images because i am only getting 1/10 of the batch @furas Commented May 2, 2021 at 3:06
  • you means every 10th image from images generated by this code - not every 10th frame from video. Use -r 0.1 Commented May 2, 2021 at 3:29

1 Answer 1

9

If you want 1/10 of what you have now (when you use -r 1) then use

 -r 0.1

It will get 1 frame every 10 seconds instead of 1 frame every 1 second.

 ffmpeg -i out1.avi -r 0.1 -f image2 image-%3d.jpeg

EDIT:

If you really what every 10th frame from video then you can use select with modulo 10

ffmpeg -i out1.mp4 -vf "select=not(mod(n\,10))" -vsync vfr image_%03d.jpg

but it may gives more images than before.

If video has 25fps then -r 1 gives image every 25th frame. And if video has 60fps then gives image every 60th frame. So it gives less images then this code which get image every 10th frame.

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.