[FFmpeg-user] -f segment not just muxes, it inserts missing frames

Basin Ilya basinilya at gmail.com
Thu Aug 20 20:23:03 CEST 2015


Hi list.
I use select filter to drop portions of video stream without shortening
it. Yes, the resulting video file de facto has variable frame rate, and
when playing, the picture might not change for a long time, but that's
desired. Besides, the file becomes smaller.

If I use the default muxer for output mkv file, all is fine, but if I
switch to using `-f segment`, the resulting file becomes bigger, and the
holes between the selected fragments are filled as if the fps filter was
inserted.

    interval=4
    ncams=3
    seglen=600
    switchdur=0
    mkselect2() { echo
"select='gte(st(0,mod(t*1000,${ncams:?}*${interval:?}*1000)),${1:?}*${interval:?}*1000+${switchdur:?})*lt(ld(0),(${1:?}+1)*${interval:?}*1000-1)'";
}

    ffmpeg -y -f lavfi -t 40 -i testsrc=s=720x576:r=25 -vf "`mkselect2
0`" -codec mpeg4 test1.mkv
    ffmpeg -y -f lavfi -t 40 -i testsrc=s=720x576:r=25 -vf "`mkselect2
0`" -codec mpeg4 -f segment -segment_time 300 -strftime 1 test2.mkv


How to tell segment muxer not to insert missing frames?


More information about the ffmpeg-user mailing list