I have a folder of frames (saved as jpg) extracted from a 240 FPS video. What I’d like to do is create a new video at 30 FPS (i.e. sampling only every 8th frame - since 240/30=8).

I have tried the following command:

ffmpeg -i %05d.jpg "select='mod(n,8)’” -r 30 output.mp4

However, the video does not look correct (in fact when I ffprobe, the resulting video does not have the correct number of frames).

I can’t work out what I’m doing wrong. Does anyone have any suggestions?


ffmpeg assumes that image sequences have a framerate of 25 unless you tell otherwise.

There are two ways to do this:

ffmpeg -framerate 240 -i %05d.jpg -r 30 output.mp4


ffmpeg -i %05d.jpg "select='not(mod(n,8))',setpts=N/30/TB” -r 30 output.mp4

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.