I need to find a way to cut down on the total number of frames in a video I'm editing. Essentially, if it was shot in 60 fps, I'd like to choose to only keep every 20th or 30th frame.

The only programs I have available are Windows MovieMaker and any freeware available. I have a video that is too detailed for the analysis program I'm using which is why I need to be able to keep only every 30th frame.


You can use ffmpeg, a free command-line tool, to do this:

ffmpeg -i in.mp4 -vf "select=not(mod(n\,30)),setpts=N/FRAME_RATE/TB" -r 30 out.mp4

-vf specifies a video filterchain i.e. a sequence of filters applied to a single input.

select=not(mod(n\,30)) - this filter keeps only each 30th frame from the source.

FFmpeg works primarily within the framework of time-based containers, such as a video, which is a series of images shown in a cycle through time. The PTS is the presentation timestamp of a frame i.e. when the player should present a frame. Due to how ffmpeg works, setpts filter is needed in this case to ensure that no frames are duplicated or dropped other than what the select filter specifies.

-r 30 is the framerate of the output. To set it to the rate of the source, you can either skip this parameter or set it manually i.e. -r 60 for a 60 fps source.

| 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.