[FFmpeg-user] How to drop every Nth frame?

Andrey Aleksandrovich andrey.aleksandrovich at googlemail.com
Sat Sep 21 13:00:00 CEST 2013


I am sorry but it doesn't cut any frames at all.
ffmpeg -y -i original-5614-frames.avi -filter:v "select='mod(n,24)'" out.avi

The original video is 5614 frames and the output video is 5614 ones.
I expect that output must be 5381 frames (I need to cut/drop 233
frames - every 24th from 5614).

On 9/21/13, Sam Logan <shapableline at gmail.com> wrote:
> On 9/21/13, Andrey Aleksandrovich <andrey.aleksandrovich at googlemail.com>
> wrote:
>> oh, thanks, but I can't understand syntax of select filer:
>> Example from manual:
>> # select one frame every 100
>> select='not(mod(n,100))'
>>
>> But how to set - "select 23 frames every 24"?
>
> mod() is the modulus function. So mod(n, 100) returns positive for any
> value of n except for multiples of 100, so Boolean negation of that
> will return false for everything except multiples of 100, thereby
> selecting one frame per hundred. So to select 23 frames per 24, do:
>
> select='mod(n,24)'
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list