Message ID | 20210318030238.561057-1-jerome@percipient.ai |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel] modified frame timing, so that we can make sure that a frame is never forward in time with respect to the original one, when converting from VFR to CFR | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | fail | Make fate failed |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | warning | Make fate failed |
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 46bb014de8..8085442156 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1238,8 +1238,9 @@ static void do_video_out(OutputFile *of, nb_frames = 0; } else if (delta < -1.1) nb_frames = 0; - else if (delta > 1.1) { - nb_frames = lrintf(delta); + // let the CFR frame go backward by at most one frame duration with respect to the original VFR + else if (delta >= 2) { + nb_frames = floor(delta); if (delta0 > 1.1) nb0_frames = llrintf(delta0 - 0.6); }