[FFmpeg-trac] #8665(ffmpeg:new): Infinite Loop Concatenating Two Videos

FFmpeg trac at avcodec.org
Thu May 14 03:31:39 EEST 2020

#8665: Infinite Loop Concatenating Two Videos
             Reporter:  dreedy      |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  important   |                Component:  ffmpeg
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |

Comment (by kepstin):

 When filing an issue like this, please always include the complete output
 of the failing ffmpeg command, at a reasonable log level. Why are you
 using -loglevel fatal? Don't do that! It's hiding a warning that ffmpeg is
 printing when running the command you provided!

 Here's the interesting part of the output with -v verbose:

 [graph 0 input from stream 0:0 @ 0x5613bdadd3c0] w:640 h:480
 pixfmt:yuv420p tb:1/14336 fr:14/1 sar:0/1
 [graph_0_in_0_1 @ 0x5613bdaddd40] tb:1/48000 samplefmt:fltp
 samplerate:48000 chlayout:0x4
 [graph 0 input from stream 1:0 @ 0x5613bdadee00] w:640 h:480
 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:0/1
 [graph_0_in_1_1 @ 0x5613bdadfb00] tb:1/48000 samplefmt:fltp
 samplerate:48000 chlayout:0x4
 [Parsed_concat_0 @ 0x5613bdad9700] Video inputs have different frame
 rates, output will be VFR
 [mp4 @ 0x5613bd495d40] Frame rate very high for a muxer not efficiently
 supporting it.
 Please consider specifying a lower framerate, a different muxer or -vsync

 Your two videos have different framerates and timebases. (This means they
 were not created with the commands you stated - since if the commands you
 stated were used, both videos would be 25fps.) This triggers the new logic
 in the concat filter, which sets the output framerate to VFR. The old
 ffmpeg version would have set the output framerate to 14, resulting in
 dropped frames and "Past duration 0.879982 too large" messages.

 The problem itself appears to be an issue with how the mp4 muxer (or
 ffmpeg cli? not sure.) handles an output video stream that's marked as
 VFR. It might be an existing problem that was only exposed due to the
 changes to the concat filter.

 Anyways, adding "-vsync 2" as the ffmpeg warning message recommends
 appears to work around the issue. Using a different output container (mkv
 for example) also works.

 Depending on your use case, it might be a better idea to convert the video
 to constant framerate by adding an "fps" filter after concat rather than
 generate a VFR video. Or you could make sure all your inputs have matching

Ticket URL: <https://trac.ffmpeg.org/ticket/8665#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list