[FFmpeg-trac] #2319(avformat:new): Using concat demuxer with truncated mp4 (mpeg2video, pcm_s16be) leads to infinite loop

FFmpeg trac at avcodec.org
Sun Mar 3 14:44:51 CET 2013

#2319: Using concat demuxer with truncated mp4 (mpeg2video,pcm_s16be) leads to
infinite loop
             Reporter:  ls          |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:  concat      |               Blocked By:
             Blocking:              |  Reproduced by developer:  1
Analyzed by developer:  1           |
Changes (by Cigaes):

 * analyzed:  0 => 1
 * keywords:   => concat
 * version:  1.1.3 => git-master
 * component:  FFmpeg => avformat
 * reproduced:  0 => 1


 This is the expected behaviour (but changing it can be considered). The
 problem is that the headers of your file declare a duration different from
 the actual duration of the data present in the file. The concat demuxer
 relies on the duration declared by the file.

 More precisely, your file declares a duration of ~820 seconds, but
 contains only ~23 seconds.

 At the end of the first file, ffmpeg is not stuck, it is just encoding
 820-23 = 797 seconds of still image. This happens because you chose to
 output to MP4, and libavformat does not support variable frame rate in
 this format. Wait long enough and it will start encoding the next file.
 Output to Matroska (lavf supports VFR in Matroska) and it will not happen;
 instead, you will get a big gap in the timestamps.

 If you do not want the gap / long still image, you need to document the
 correct duration. Either use a proper tool for cutting the file, so that
 the duration is correctly set in the headers, or use the {{{duration}}}
 directive in the concat script to override the value in the file.

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

More information about the FFmpeg-trac mailing list