[FFmpeg-user] mp4 concat demuxer problem

Konrad Karl kk_konrad at gmx.at
Mon Apr 28 15:48:08 CEST 2014


Hi,

I tried to concatenate a few movies (h264/aac mp4, all produced by kdenlive/melt using
the same rendering settings) using the concat demuxer like this on
Fedora 20 x86_64:


ffmpeg -f concat -i concat-test -c copy out.mp4

The output file fails to play after the first input file (mplayer, ffplay, vlc)

Trimmed down samples have already been uploaded to upload.ffmpeg.org/incoming

Contents of the uploaded info file  and uncut console output of one concat command  below.

Konrad


======================= concat-test.info ==========================

Problem description: 

mp4: concat demuxer produces corrupt output after the first input file:

reproduce like this using samples from two different files (1 second duration each):

ffmpeg -f concat -i concat-test -c copy out.mp4

Result: out.mp4 fails to play the contents of the second and all further input files.
(tested with mplayer, ffplay, vlc)
The output container does not matter.(ts with -bsf h264_mp4toannexb, mkv)

then errors similar to this:
[h264 @ 0x7fa9040cb5a0] left block unavailable for requested intra mode at 0 0
[h264 @ 0x7fa9040cb5a0] error while decoding MB 0 0, bytestream 299                                                                                                                                     
[h264 @ 0x7fa9040cb5a0] concealing 8160 DC, 8160 AC, 8160 MV errors in I frame
ad nauseam

There must be some incompatibility between the files because if the same
file is concatenated multiple times if plays fine.

All files have been produced by kdenlive using the same rendering settings.
The samples have been cut from the start of the original files.
(ffmpeg -i infile.mp4 -t 1 -c copy outfile.mp4)

Fedora 20 x86_64, ffmpeg from rpmfusion  repository and also from todays git.

ffmpeg
ffmpeg version 2.1.4 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb 25 2014 08:24:47 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
------------------
ffmpeg version N-62699-gc7b0890 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 28 2014 11:55:48 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
  configuration: --prefix=/home/ki/melt/20140428 --enable-gpl --enable-version3 --enable-shared --enable-debug --enable-pthreads --enable-runtime-cpudetect --disable-doc --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-libx264 --enable-libvpx
  libavutil      52. 78.100 / 52. 78.100
  libavcodec     55. 59.100 / 55. 59.100
  libavformat    55. 37.101 / 55. 37.101
  libavdevice    55. 13.100 / 55. 13.100
  libavfilter     4.  4.100 /  4.  4.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

==================  attempt to concat two mp4 files =========================================

ffmpeg -f concat  -i concat-test -c copy -y out.mp4
ffmpeg version 2.1.4 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb 25 2014 08:24:47 with gcc 4.8.2 (GCC) 20131212 (Red Hat
4.8.2-7)
  configuration: --prefix=/usr --bindir=/usr/bin
--datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg
--libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64
--optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r
--enable-gnutls --enable-libass --enable-libcdio --enable-libcelt
--enable-libdc1394 --disable-indev=jack --enable-libfreetype
--enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv
--enable-libopenjpeg --enable-libopus --enable-libpulse
--enable-libschroedinger --enable-libsoxr --enable-libspeex
--enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx
--enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter
--enable-avresample --enable-postproc --enable-pthreads --disable-static
--enable-shared --enable-gpl --disable-debug --disable-stripping
--shlibdir=/usr/lib64 --enable-runtime-cpudetect
  libavutil      52. 48.101 / 52. 48.101
  libavcodec     55. 39.101 / 55. 39.101
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[concat @ 0x1305720] Estimating duration from bitrate, this may be
inaccurate
Input #0, concat, from 'concat-test':
  Duration: 00:00:00.00, start: 0.000000, bitrate: 38095 kb/s
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], 35326 kb/s, 50 fps, 50 tbr, 12800 tbn, 100
tbc
    Stream #0:1: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp,
384 kb/s
Output #0, mp4, to 'out.mp4':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 35326 kb/s, 50 fps, 12800 tbn,
12800 tbc
    Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo,
384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  104 fps=0.0 q=-1.0 Lsize=    5567kB time=00:00:02.04
bitrate=22325.9kbits/s    
video:5469kB audio:94kB subtitle:0 global headers:0kB muxing overhead
0.064527%







More information about the ffmpeg-user mailing list