Opened 3 years ago

Closed 2 years ago

#5380 closed defect (fixed)

Concat fails on files passed through h264_mp4toannexb

Reported by: andrey.utkin Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: mov h264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
You cannot concat H.264-in-MP4 files which were previously created with "-bsf:v h264_mp4toannexb".

This issue affects v2.8.6, v3.0 and git master HEAD.

How to reproduce:

test.sh:

#!/bin/bash -e

FFMPEG=./ffmpeg

$FFMPEG -f lavfi -i testsrc -t 10 -c:v libx264 -y orig.mp4

$FFMPEG -i orig.mp4 -c copy -bsf:v h264_mp4toannexb -y bsf.mp4

echo "ffconcat version 1.0
file orig.mp4
file orig.mp4" > orig.concat;
echo "ffconcat version 1.0
file bsf.mp4
file bsf.mp4" > bsf.concat;

# Succeeds
$FFMPEG -i orig.concat -c copy -y orig_concat.mp4

# Fails with "bsf.concat: Invalid argument". Hint from debug log: "cur_dts is invalid (this is harmless if it occurs once at the start per stream)"
$FFMPEG -i bsf.concat -c copy -y bsf_concat.mp4

Output:

 $ ./test.sh 
ffmpeg version N-79136-g585cfab Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --disable-everything --prefix=/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-libs='/home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libx264.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfreetype.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfribidi.a' --extra-ldflags=-L/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-cflags='-I/home/j/work/employers/pitneybowes/interval_transcoder/build/include -O3' --disable-debug --enable-static --enable-libfribidi --enable-libfreetype --enable-libx264 --enable-gpl --disable-doc --disable-libxcb --disable-xlib --disable-sdl --disable-lzma --disable-bzlib --enable-protocol=file --enable-protocol=pipe --enable-indev=lavfi --enable-muxer=mp4 --enable-muxer=hls --enable-muxer=segment --enable-muxer=mpegts --enable-muxer=mjpeg --enable-muxer=image2 --enable-muxer=matroska --enable-muxer=rawvideo --enable-demuxer=mov --enable-demuxer=hls --enable-demuxer=mpegts --enable-demuxer=mjpeg --enable-demuxer=mp3 --enable-demuxer=concat --enable-demuxer=image2 --enable-demuxer=matroska --enable-demuxer=rawvideo --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=aac --enable-decoder=mp2 --enable-decoder=mp3 --enable-decoder=mjpeg --enable-decoder=rawvideo --enable-decoder=pcm_f32le --enable-decoder=pcm_f64le --enable-decoder=pcm_s16le --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-parser=aac --enable-encoder=libx264 --enable-encoder=aac --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-filter=scale --enable-filter=fps --enable-filter=drawtext --enable-filter=overlay --enable-filter=copy --enable-filter=crop --enable-filter=fade --enable-filter=testsrc --enable-filter=movie --enable-filter=amovie --enable-filter=setpts --enable-filter=asetpts --enable-filter=settb --enable-filter=asettb --enable-filter=concat --enable-filter=format --enable-filter=aformat --enable-filter=amix --enable-filter=aresample --enable-filter=null --enable-filter=nullsrc --enable-filter=nullsink --enable-filter=anull --enable-filter=anullsrc --enable-filter=anullsink --enable-filter=aevalsrc --enable-filter=loop --enable-filter=aloop --enable-filter=sendcmd --enable-filter=asendcmd --enable-filter=showinfo --enable-filter=volume --enable-filter=volumedetect --enable-filter=dynaudnorm --enable-bsf=h264_mp4toannexb --enable-bsf=aac_adtstoasc --enable-bsf=dump_extradata --enable-bsf=remove_extradata
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 30.100 / 57. 30.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, lavfi, from 'testsrc':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (RGB[24] / 0x18424752), rgb24, 320x240 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
No pixel format specified, yuv444p for H.264 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[libx264 @ 0x132a4e0] using SAR=1/1
[libx264 @ 0x132a4e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x132a4e0] profile High 4:4:4 Predictive, level 1.3, 4:4:4 8-bit
[libx264 @ 0x132a4e0] 264 - core 148 r2665 a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=4 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'orig.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv444p, 320x240 [SAR 1:1 DAR 4:3], q=-1--1, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc57.30.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
Press [q] to stop, [?] for help
frame=  250 fps=0.0 q=-1.0 Lsize=      48kB time=00:00:09.92 bitrate=  39.8kbits/s speed=33.4x    
video:45kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.133427%
[libx264 @ 0x132a4e0] frame I:1     Avg QP:19.19  size:  2970
[libx264 @ 0x132a4e0] frame P:77    Avg QP:14.27  size:   439
[libx264 @ 0x132a4e0] frame B:172   Avg QP:14.07  size:    48
[libx264 @ 0x132a4e0] consecutive B-frames:  8.0%  0.8%  0.0% 91.2%
[libx264 @ 0x132a4e0] mb I  I16..4: 30.7% 42.3% 27.0%
[libx264 @ 0x132a4e0] mb P  I16..4:  1.9%  1.4%  0.8%  P16..4:  7.3%  3.6%  2.5%  0.0%  0.0%    skip:82.5%
[libx264 @ 0x132a4e0] mb B  I16..4:  0.2%  0.1%  0.0%  B16..8:  3.8%  0.1%  0.0%  direct: 0.1%  skip:95.8%  L0:50.1% L1:46.2% BI: 3.7%
[libx264 @ 0x132a4e0] 8x8 transform intra:35.8% inter:36.8%
[libx264 @ 0x132a4e0] coded y,u,v intra: 10.0% 10.7% 9.2% inter: 0.8% 0.8% 0.7%
[libx264 @ 0x132a4e0] i16 v,h,dc,p: 52% 29%  1% 18%
[libx264 @ 0x132a4e0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 73%  5% 21%  0%  0%  0%  0%  0%  0%
[libx264 @ 0x132a4e0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 57% 12%  1%  1%  1%  0%  1%  0%
[libx264 @ 0x132a4e0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x132a4e0] ref P L0: 67.2%  7.2% 21.1%  4.6%
[libx264 @ 0x132a4e0] ref B L0: 56.4% 39.7%  3.9%
[libx264 @ 0x132a4e0] ref B L1: 96.7%  3.3%
[libx264 @ 0x132a4e0] kb/s:36.00
ffmpeg version N-79136-g585cfab Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --disable-everything --prefix=/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-libs='/home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libx264.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfreetype.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfribidi.a' --extra-ldflags=-L/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-cflags='-I/home/j/work/employers/pitneybowes/interval_transcoder/build/include -O3' --disable-debug --enable-static --enable-libfribidi --enable-libfreetype --enable-libx264 --enable-gpl --disable-doc --disable-libxcb --disable-xlib --disable-sdl --disable-lzma --disable-bzlib --enable-protocol=file --enable-protocol=pipe --enable-indev=lavfi --enable-muxer=mp4 --enable-muxer=hls --enable-muxer=segment --enable-muxer=mpegts --enable-muxer=mjpeg --enable-muxer=image2 --enable-muxer=matroska --enable-muxer=rawvideo --enable-demuxer=mov --enable-demuxer=hls --enable-demuxer=mpegts --enable-demuxer=mjpeg --enable-demuxer=mp3 --enable-demuxer=concat --enable-demuxer=image2 --enable-demuxer=matroska --enable-demuxer=rawvideo --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=aac --enable-decoder=mp2 --enable-decoder=mp3 --enable-decoder=mjpeg --enable-decoder=rawvideo --enable-decoder=pcm_f32le --enable-decoder=pcm_f64le --enable-decoder=pcm_s16le --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-parser=aac --enable-encoder=libx264 --enable-encoder=aac --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-filter=scale --enable-filter=fps --enable-filter=drawtext --enable-filter=overlay --enable-filter=copy --enable-filter=crop --enable-filter=fade --enable-filter=testsrc --enable-filter=movie --enable-filter=amovie --enable-filter=setpts --enable-filter=asetpts --enable-filter=settb --enable-filter=asettb --enable-filter=concat --enable-filter=format --enable-filter=aformat --enable-filter=amix --enable-filter=aresample --enable-filter=null --enable-filter=nullsrc --enable-filter=nullsink --enable-filter=anull --enable-filter=anullsrc --enable-filter=anullsink --enable-filter=aevalsrc --enable-filter=loop --enable-filter=aloop --enable-filter=sendcmd --enable-filter=asendcmd --enable-filter=showinfo --enable-filter=volume --enable-filter=volumedetect --enable-filter=dynaudnorm --enable-bsf=h264_mp4toannexb --enable-bsf=aac_adtstoasc --enable-bsf=dump_extradata --enable-bsf=remove_extradata
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 30.100 / 57. 30.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'orig.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:10.00, start: 0.000000, bitrate: 39 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Output #0, mp4, to 'bsf.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  250 fps=0.0 q=-1.0 Lsize=      48kB time=00:00:09.88 bitrate=  40.0kbits/s speed=3.69e+03x    
video:45kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.124303%
ffmpeg version N-79136-g585cfab Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --disable-everything --prefix=/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-libs='/home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libx264.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfreetype.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfribidi.a' --extra-ldflags=-L/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-cflags='-I/home/j/work/employers/pitneybowes/interval_transcoder/build/include -O3' --disable-debug --enable-static --enable-libfribidi --enable-libfreetype --enable-libx264 --enable-gpl --disable-doc --disable-libxcb --disable-xlib --disable-sdl --disable-lzma --disable-bzlib --enable-protocol=file --enable-protocol=pipe --enable-indev=lavfi --enable-muxer=mp4 --enable-muxer=hls --enable-muxer=segment --enable-muxer=mpegts --enable-muxer=mjpeg --enable-muxer=image2 --enable-muxer=matroska --enable-muxer=rawvideo --enable-demuxer=mov --enable-demuxer=hls --enable-demuxer=mpegts --enable-demuxer=mjpeg --enable-demuxer=mp3 --enable-demuxer=concat --enable-demuxer=image2 --enable-demuxer=matroska --enable-demuxer=rawvideo --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=aac --enable-decoder=mp2 --enable-decoder=mp3 --enable-decoder=mjpeg --enable-decoder=rawvideo --enable-decoder=pcm_f32le --enable-decoder=pcm_f64le --enable-decoder=pcm_s16le --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-parser=aac --enable-encoder=libx264 --enable-encoder=aac --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-filter=scale --enable-filter=fps --enable-filter=drawtext --enable-filter=overlay --enable-filter=copy --enable-filter=crop --enable-filter=fade --enable-filter=testsrc --enable-filter=movie --enable-filter=amovie --enable-filter=setpts --enable-filter=asetpts --enable-filter=settb --enable-filter=asettb --enable-filter=concat --enable-filter=format --enable-filter=aformat --enable-filter=amix --enable-filter=aresample --enable-filter=null --enable-filter=nullsrc --enable-filter=nullsink --enable-filter=anull --enable-filter=anullsrc --enable-filter=anullsink --enable-filter=aevalsrc --enable-filter=loop --enable-filter=aloop --enable-filter=sendcmd --enable-filter=asendcmd --enable-filter=showinfo --enable-filter=volume --enable-filter=volumedetect --enable-filter=dynaudnorm --enable-bsf=h264_mp4toannexb --enable-bsf=aac_adtstoasc --enable-bsf=dump_extradata --enable-bsf=remove_extradata
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 30.100 / 57. 30.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1483c20] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'orig.concat':
  Duration: N/A, start: 0.000000, bitrate: 36 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
Output #0, mp4, to 'orig_concat.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1483c20] Auto-inserting h264_mp4toannexb bitstream filter
frame=  500 fps=0.0 q=-1.0 Lsize=      96kB time=00:00:19.88 bitrate=  39.5kbits/s speed=2e+03x    
video:89kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 7.209089%
ffmpeg version N-79136-g585cfab Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --disable-everything --prefix=/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-libs='/home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libx264.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfreetype.a /home/j/work/employers/pitneybowes/interval_transcoder/build/lib/libfribidi.a' --extra-ldflags=-L/home/j/work/employers/pitneybowes/interval_transcoder/build --extra-cflags='-I/home/j/work/employers/pitneybowes/interval_transcoder/build/include -O3' --disable-debug --enable-static --enable-libfribidi --enable-libfreetype --enable-libx264 --enable-gpl --disable-doc --disable-libxcb --disable-xlib --disable-sdl --disable-lzma --disable-bzlib --enable-protocol=file --enable-protocol=pipe --enable-indev=lavfi --enable-muxer=mp4 --enable-muxer=hls --enable-muxer=segment --enable-muxer=mpegts --enable-muxer=mjpeg --enable-muxer=image2 --enable-muxer=matroska --enable-muxer=rawvideo --enable-demuxer=mov --enable-demuxer=hls --enable-demuxer=mpegts --enable-demuxer=mjpeg --enable-demuxer=mp3 --enable-demuxer=concat --enable-demuxer=image2 --enable-demuxer=matroska --enable-demuxer=rawvideo --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mpeg2video --enable-decoder=aac --enable-decoder=mp2 --enable-decoder=mp3 --enable-decoder=mjpeg --enable-decoder=rawvideo --enable-decoder=pcm_f32le --enable-decoder=pcm_f64le --enable-decoder=pcm_s16le --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-parser=aac --enable-encoder=libx264 --enable-encoder=aac --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-filter=scale --enable-filter=fps --enable-filter=drawtext --enable-filter=overlay --enable-filter=copy --enable-filter=crop --enable-filter=fade --enable-filter=testsrc --enable-filter=movie --enable-filter=amovie --enable-filter=setpts --enable-filter=asetpts --enable-filter=settb --enable-filter=asettb --enable-filter=concat --enable-filter=format --enable-filter=aformat --enable-filter=amix --enable-filter=aresample --enable-filter=null --enable-filter=nullsrc --enable-filter=nullsink --enable-filter=anull --enable-filter=anullsrc --enable-filter=anullsink --enable-filter=aevalsrc --enable-filter=loop --enable-filter=aloop --enable-filter=sendcmd --enable-filter=asendcmd --enable-filter=showinfo --enable-filter=volume --enable-filter=volumedetect --enable-filter=dynaudnorm --enable-bsf=h264_mp4toannexb --enable-bsf=aac_adtstoasc --enable-bsf=dump_extradata --enable-bsf=remove_extradata
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 30.100 / 57. 30.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x194ec20] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'bsf.concat':
  Duration: N/A, bitrate: 36 kb/s
    Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 320x240 [SAR 1:1 DAR 4:3], 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
Output #0, mp4, to 'bsf_concat.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv444p, 320x240 [SAR 1:1 DAR 4:3], q=2-31, 36 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
bsf.concat: Invalid argument
frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)

Change History (7)

comment:1 Changed 3 years ago by cehoyos

  • Keywords mov h264 added

I have no idea what you are trying to achieve but I sent a patch.

comment:2 Changed 3 years ago by heleppkes

AnnexB in MP4 is invalid, so you get what you sow.

comment:3 Changed 3 years ago by gjdfgh

I strongly vote for WONTFIX.

comment:4 Changed 2 years ago by andrey.utkin

Surprisingly, applying h264_mp4toannexb to MP4 files is the only stable way to concat MP4 videos.

Converting to MPEG TS for concatenation is broken.

Please look at this test case:

#!/bin/bash

git clone git://source.ffmpeg.org/ffmpeg.git || true
pushd ffmpeg

# Reset to know commit of fresh upstream, for future reference
#commit e259dc86a80398d56d1aabcf6203f80616a4d04d
#Author: Kieran Kunhya <kieran@kunhya.com>
#Date:   Fri Mar 25 21:32:26 2016 +0000
git reset --hard
git checkout e259dc86a80398d56d1aabcf6203f80616a4d04d

# Patch http://thread.gmane.org/gmane.comp.video.ffmpeg.devel/212278
# C. E. Hoyos "lavc/h264_mp4toannexb: Do not fail if frame already starts with startcode"
# http://trac.ffmpeg.org/ticket/5380
echo "
diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c
index 2d447f7..170db31 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -167,7 +167,8 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
     int ret = 0;

     /* nothing to filter */
-    if (!avctx->extradata || avctx->extradata_size < 6) {
+    if (   !avctx->extradata || avctx->extradata_size < 6
+        || !buf[0] && !buf[1] && (buf[2] == 1 || !buf[2] && buf[3] == 1)) {
         *poutbuf      = (uint8_t *)buf;
         *poutbuf_size = buf_size;
         return 0;

" | patch -p1

git clean -dxf
./configure --enable-libx264 --enable-gpl --enable-encoder=libx264
make

FFMPEG=./ffmpeg

# Consider these are videos of same properties, but of different origins
$FFMPEG -f lavfi -i 'testsrc=size=640x360:rate=29.97,format=pix_fmts=yuv420p'        -f lavfi -i aevalsrc='sin(440*2*PI*t)':sample_rate=48000 -t 2 -b:v 100k -c:v libx264 -y 1.mp4
$FFMPEG -f lavfi -i 'testsrc=size=640x360:rate=29.97,format=pix_fmts=yuv420p, vflip' -f lavfi -i aevalsrc='sin(880*2*PI*t)':sample_rate=48000 -t 2 -b:v 100k -c:v libx264 -y 2.mp4


# Broken, for unknown reason (MPEG TS should be streamable finely this way)
# Video has artifacts at beginnings of parts
for x in {1,2}.mp4
do
	$FFMPEG -i $x -c copy -y ${x}.ts
done
echo "ffconcat version 1.0
file 1.mp4.ts
file 2.mp4.ts
" > ts.concat;
$FFMPEG -i ts.concat -c copy -bsf:a aac_adtstoasc -y ts_concat.mp4

ffplay -autoexit ts_concat.mp4


# Broken, for unknown reason (concat applies h264_mp4toannexb in case of H.264 so this should work)
# Video has artifacts at beginnings of parts
# With some inputs, video won't play after first point of joining
echo "ffconcat version 1.0
file 1.mp4
file 2.mp4
" > orig.concat;
$FFMPEG -i orig.concat -c copy -y orig_concat.mp4

ffplay -autoexit orig_concat.mp4


# Works stable with C. E. Hoyos' patch "lavc/h264_mp4toannexb: Do not fail if frame already starts with startcode"
for x in {1,2}.mp4
do
	$FFMPEG -i $x -c copy -bsf:v h264_mp4toannexb -y ${x}.bsf.mp4
done

echo "ffconcat version 1.0
file 1.mp4.bsf.mp4
file 2.mp4.bsf.mp4
" > bsf.concat;
$FFMPEG -i bsf.concat -c copy -y bsf_concat.mp4

ffplay -autoexit bsf_concat.mp4

 $ ../../test.sh 
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, lavfi, from 'testsrc=size=640x360:rate=29.97,format=pix_fmts=yuv420p':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
Input #1, lavfi, from 'aevalsrc=sin(440*2*PI*t):sample_rate=48000':
  Duration: N/A, start: 0.000000, bitrate: 3072 kb/s
    Stream #1:0: Audio: pcm_f64le, 48000 Hz, mono, dbl, 3072 kb/s
[libx264 @ 0x3d1fa00] using SAR=1/1
[libx264 @ 0x3d1fa00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x3d1fa00] profile High, level 3.0
[libx264 @ 0x3d1fa00] 264 - core 148 r2665M a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=100 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '1.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 100 kb/s, 29.97 fps, 11988 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.31.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/100000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, 69 kb/s
    Metadata:
      encoder         : Lavc57.31.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_f64le (native) -> aac (native))
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      36kB time=00:00:02.00 bitrate= 146.0kbits/s speed=7.92x    
video:15kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.042411%
[libx264 @ 0x3d1fa00] frame I:1     Avg QP:36.55  size:  1777
[libx264 @ 0x3d1fa00] frame P:59    Avg QP:31.29  size:   225
[libx264 @ 0x3d1fa00] mb I  I16..4: 42.3% 55.8%  2.0%
[libx264 @ 0x3d1fa00] mb P  I16..4:  2.9%  0.6%  0.0%  P16..4:  7.9%  0.4%  0.1%  0.0%  0.0%    skip:88.0%
[libx264 @ 0x3d1fa00] final ratefactor: 35.65
[libx264 @ 0x3d1fa00] 8x8 transform intra:29.4% inter:81.2%
[libx264 @ 0x3d1fa00] coded y,uvDC,uvAC intra: 1.1% 23.3% 9.1% inter: 0.1% 3.1% 0.2%
[libx264 @ 0x3d1fa00] i16 v,h,dc,p: 67% 27%  3%  3%
[libx264 @ 0x3d1fa00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9% 13% 75%  1%  0%  0%  0%  0%  1%
[libx264 @ 0x3d1fa00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 13% 41%  2%  0%  4%  0%  4%  1%
[libx264 @ 0x3d1fa00] i8c dc,h,v,p: 45% 27% 25%  2%
[libx264 @ 0x3d1fa00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x3d1fa00] ref P L0: 73.2%  8.3% 15.6%  2.9%
[libx264 @ 0x3d1fa00] kb/s:60.23
[aac @ 0x3d20900] Qavg: 124.279
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, lavfi, from 'testsrc=size=640x360:rate=29.97,format=pix_fmts=yuv420p, vflip':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 29.97 tbr, 29.97 tbn, 29.97 tbc
Input #1, lavfi, from 'aevalsrc=sin(880*2*PI*t):sample_rate=48000':
  Duration: N/A, start: 0.000000, bitrate: 3072 kb/s
    Stream #1:0: Audio: pcm_f64le, 48000 Hz, mono, dbl, 3072 kb/s
[libx264 @ 0x2d4bee0] using SAR=1/1
[libx264 @ 0x2d4bee0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x2d4bee0] profile High, level 3.0
[libx264 @ 0x2d4bee0] 264 - core 148 r2665M a01e339 - H.264/MPEG-4 AVC codec - Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=100 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '2.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 100 kb/s, 29.97 fps, 11988 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc57.31.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/100000 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, fltp, 69 kb/s
    Metadata:
      encoder         : Lavc57.31.100 aac
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_f64le (native) -> aac (native))
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      33kB time=00:00:02.00 bitrate= 133.8kbits/s speed=  10x    
video:12kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.672660%
[libx264 @ 0x2d4bee0] frame I:1     Avg QP:35.13  size:  1777
[libx264 @ 0x2d4bee0] frame P:15    Avg QP:27.55  size:   484
[libx264 @ 0x2d4bee0] frame B:44    Avg QP:30.16  size:    59
[libx264 @ 0x2d4bee0] consecutive B-frames:  1.7%  0.0%  5.0% 93.3%
[libx264 @ 0x2d4bee0] mb I  I16..4: 87.7% 10.8%  1.5%
[libx264 @ 0x2d4bee0] mb P  I16..4: 11.2%  4.6%  0.1%  P16..4: 11.8%  0.9%  0.2%  0.0%  0.0%    skip:71.2%
[libx264 @ 0x2d4bee0] mb B  I16..4:  0.1%  0.0%  0.0%  B16..8:  5.2%  0.0%  0.0%  direct: 0.0%  skip:94.7%  L0:40.2% L1:59.8% BI: 0.0%
[libx264 @ 0x2d4bee0] final ratefactor: 32.70
[libx264 @ 0x2d4bee0] 8x8 transform intra:23.5% inter:57.0%
[libx264 @ 0x2d4bee0] coded y,uvDC,uvAC intra: 1.0% 18.7% 8.8% inter: 0.1% 0.8% 0.1%
[libx264 @ 0x2d4bee0] i16 v,h,dc,p: 77% 18%  3%  1%
[libx264 @ 0x2d4bee0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 12% 79%  1%  0%  0%  0%  0%  0%
[libx264 @ 0x2d4bee0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 12% 53%  2%  1%  3%  0%  2%  1%
[libx264 @ 0x2d4bee0] i8c dc,h,v,p: 63% 18% 18%  1%
[libx264 @ 0x2d4bee0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x2d4bee0] ref P L0: 72.9%  3.6% 20.8%  2.7%
[libx264 @ 0x2d4bee0] ref B L0: 73.7% 19.8%  6.5%
[libx264 @ 0x2d4bee0] ref B L1: 90.2%  9.8%
[libx264 @ 0x2d4bee0] kb/s:46.44
[aac @ 0x2d4cde0] Qavg: 134.842
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:02.02, start: 0.000000, bitrate: 144 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, mpegts, to '1.mp4.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 63 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 11988 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      45kB time=00:00:02.00 bitrate= 183.0kbits/s speed=1.45e+03x    
video:15kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 36.617329%
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:02.02, start: 0.000000, bitrate: 132 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 49 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, mpegts, to '2.mp4.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 49 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 11988 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      41kB time=00:00:02.00 bitrate= 168.0kbits/s speed=1.49e+03x    
video:12kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 40.093147%
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, concat, from 'ts.concat':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1(und): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, mono, fltp, 55 kb/s
Output #0, mp4, to 'ts_concat.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
    Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, 55 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[NULL @ 0x21eb980] SEI type 150 size 864 truncated at 376
[h264 @ 0x21fbb20] sps_id 24 out of range
[NULL @ 0x21fbb20] sps_id 24 out of range
frame=  101 fps=0.0 q=-1.0 Lsize=      68kB time=00:00:04.05 bitrate= 137.1kbits/s speed= 638x    
video:30kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 5.539926%
ffplay version N-79065-g7d9e064 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-debug=3 --disable-optimizations --extra-cflags='-O0 -g3 -ggdb3' --enable-pic --disable-stripping --enable-openssl --enable-protocol=file --enable-protocol=pipe --enable-protocol=http --enable-protocol=https --enable-muxer=matroska --enable-muxer=mjpeg --enable-muxer=rtp --enable-muxer=mp4 --enable-muxer=rtsp --enable-muxer=rawvideo --enable-muxer=data --enable-demuxer=rtsp --enable-demuxer=matroska --enable-demuxer=mjpeg --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mjpeg --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-encoder=libx264 --enable-libx264 --enable-gpl --enable-nonfree --enable-libfreetype --enable-libopenh264 --enable-libvpx --enable-libpulse
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 28.102 / 57. 28.102
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'ts_concat.mp4': 0B f=0/0   
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:04.05, start: 0.000000, bitrate: 137 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 57 kb/s, 25.09 fps, 29.97 tbr, 90k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[h264 @ 0x7f72100967c0] slice type 24 too large at 1=    0B f=0/0   
[h264 @ 0x7f72100967c0] decode_slice_header error
[h264 @ 0x7f72100967c0] no frame!
[h264 @ 0x7f7210090980] slice type 24 too large at 1=    0B f=0/0   
[h264 @ 0x7f7210090980] decode_slice_header error
[h264 @ 0x7f7210090980] no frame!
[h264 @ 0x7f72100967c0] SEI type 150 size 864 truncated at 367
[h264 @ 0x7f721009c600] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7f721009c600] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7f7210175800] co located POCs unavailable
[h264 @ 0x7f721021fac0] sps_id 24 out of range
[h264 @ 0x7f721021fac0] co located POCs unavailable
[h264 @ 0x7f72100967c0] co located POCs unavailableq=    0B f=0/0   
[h264 @ 0x7f721009c600] Missing reference picture, default is 65548 
[h264 @ 0x7f721009c600] co located POCs unavailable
[h264 @ 0x7f7210175800] Missing reference picture, default is 65556 
[h264 @ 0x7f721021fac0] Missing reference picture, default is 65556 
[h264 @ 0x7f7210090980] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7f7210090980] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7f7210090980] Missing reference picture, default is 65556
    Last message repeated 1 times
[h264 @ 0x7f72100967c0] mmco: unref short failure sq=    0B f=0/1   
[h264 @ 0x7f72100967c0] Missing reference picture, default is 65564
[h264 @ 0x7f721009c600] Missing reference picture, default is 65564 
[h264 @ 0x7f7210175800] reference picture missing during reorder2   
    Last message repeated 2 times
[h264 @ 0x7f7210175800] Missing reference picture, default is 65564
    Last message repeated 2 times
[h264 @ 0x7f721021fac0] Missing reference picture, default is 65564 
[h264 @ 0x7f7210090980] mmco: unref short failure sq=    0B f=0/2   
[h264 @ 0x7f721009c600] reference picture missing during reorder3   
[h264 @ 0x7f721009c600] Missing reference picture, default is 65572
[h264 @ 0x7f721021fac0] mmco: unref short failure sq=    0B f=0/4   
[h264 @ 0x7f72100967c0] Missing reference picture, default is 65612 
[h264 @ 0x7f721009c600] Missing reference picture, default is 65620
[h264 @ 0x7f7210175800] Missing reference picture, default is 65620 
[h264 @ 0x7f721021fac0] Missing reference picture, default is 65620 
    Last message repeated 1 times
[h264 @ 0x7f7210090980] mmco: unref short failure sq=    0B f=0/4   
[h264 @ 0x7f7210090980] Missing reference picture, default is 65628
[h264 @ 0x7f72100967c0] Missing reference picture, default is 65628 
[h264 @ 0x7f721009c600] Missing reference picture, default is 65628 
    Last message repeated 1 times
[h264 @ 0x7f7210175800] mmco: unref short failure
[h264 @ 0x7f7210175800] Missing reference picture, default is 65636
[h264 @ 0x7f721021fac0] Missing reference picture, default is 65636 
[h264 @ 0x7f7210090980] Missing reference picture, default is 65636 
    Last message repeated 1 times
[h264 @ 0x7f72100967c0] mmco: unref short failure sq=    0B f=0/5   
[h264 @ 0x7f72100967c0] Missing reference picture, default is 65644
[h264 @ 0x7f721009c600] Missing reference picture, default is 65644 
[h264 @ 0x7f7210175800] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7f7210175800] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7f7210175800] Missing reference picture, default is 65644
    Last message repeated 1 times
   4.01 A-V: -0.006 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/7   
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x27e84a0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'orig.concat':
  Duration: N/A, start: 0.021333, bitrate: 133 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s
    Metadata:
      handler_name    : SoundHandler
Output #0, mp4, to 'orig_concat.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, 70 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x27ea080] Auto-inserting h264_mp4toannexb bitstream filter
frame=  120 fps=0.0 q=-1.0 Lsize=      67kB time=00:00:04.04 bitrate= 136.2kbits/s speed= 526x    
video:28kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.227778%
ffplay version N-79065-g7d9e064 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-debug=3 --disable-optimizations --extra-cflags='-O0 -g3 -ggdb3' --enable-pic --disable-stripping --enable-openssl --enable-protocol=file --enable-protocol=pipe --enable-protocol=http --enable-protocol=https --enable-muxer=matroska --enable-muxer=mjpeg --enable-muxer=rtp --enable-muxer=mp4 --enable-muxer=rtsp --enable-muxer=rawvideo --enable-muxer=data --enable-demuxer=rtsp --enable-demuxer=matroska --enable-demuxer=mjpeg --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mjpeg --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-encoder=libx264 --enable-libx264 --enable-gpl --enable-nonfree --enable-libfreetype --enable-libopenh264 --enable-libvpx --enable-libpulse
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 28.102 / 57. 28.102
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'orig_concat.mp4':B f=0/0   
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:04.07, start: 0.000000, bitrate: 135 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 56 kb/s, 29.82 fps, 149.85 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
[h264 @ 0x7fbcc4172160] no frame! 11KB vq=    9KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] no frame! 11KB vq=    8KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] no frame! 11KB vq=    9KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] slice type 24 too large at 1=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] decode_slice_header error
[h264 @ 0x7fbcc4222aa0] no frame!
[h264 @ 0x7fbcc40e41c0] no frame! 12KB vq=   11KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4172160] no frame! 12KB vq=   10KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4178020] no frame! 12KB vq=   10KB sq=    0B f=0/0   
[h264 @ 0x7fbcc412b000] slice type 24 too large at 1
[h264 @ 0x7fbcc412b000] decode_slice_header error
[h264 @ 0x7fbcc412b000] no frame!
[h264 @ 0x7fbcc4172160] SEI type 150 size 864 truncated at 367
[h264 @ 0x7fbcc4172160] no frame!
[h264 @ 0x7fbcc4222aa0] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7fbcc4222aa0] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7fbcc4222aa0] no frame!
[h264 @ 0x7fbcc412b000] no frame!
[h264 @ 0x7fbcc40e41c0] no frame!
[h264 @ 0x7fbcc4178020] co located POCs unavailable
[h264 @ 0x7fbcc4222aa0] sps_id 24 out of range7KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] no frame!
[h264 @ 0x7fbcc40e41c0] co located POCs unavailable
[h264 @ 0x7fbcc4172160] co located POCs unavailableq=    0B f=0/0   
[h264 @ 0x7fbcc4178020] no frame! 23KB vq=    7KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] Missing reference picture, default is 65548
[h264 @ 0x7fbcc4222aa0] co located POCs unavailable
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65556 
[h264 @ 0x7fbcc412b000] Missing reference picture, default is 65556 
[h264 @ 0x7fbcc4172160] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7fbcc4172160] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7fbcc4172160] no frame!
[h264 @ 0x7fbcc4178020] Missing reference picture, default is 65556
    Last message repeated 1 times
[h264 @ 0x7fbcc4222aa0] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] Missing reference picture, default is 65564
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65564 
[h264 @ 0x7fbcc412b000] reference picture missing during reorder0   
    Last message repeated 2 times
[h264 @ 0x7fbcc412b000] Missing reference picture, default is 65564
    Last message repeated 2 times
[h264 @ 0x7fbcc4172160] Missing reference picture, default is 65564
[h264 @ 0x7fbcc4178020] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc40e41c0] reference picture missing during reorder0   
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65572
[h264 @ 0x7fbcc4172160] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc412b000] no frame! 11KB vq=    5KB sq=    0B f=0/0   
[h264 @ 0x7fbcc40e41c0] no frame!  9KB vq=    4KB sq=    0B f=0/0   
[h264 @ 0x7fbcc412b000] Missing reference picture, default is 65612
[h264 @ 0x7fbcc4172160] Missing reference picture, default is 65620 
[h264 @ 0x7fbcc4178020] Missing reference picture, default is 65620 
[h264 @ 0x7fbcc4222aa0] no frame!  8KB vq=    3KB sq=    0B f=0/0   
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65620
    Last message repeated 1 times
[h264 @ 0x7fbcc412b000] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc412b000] Missing reference picture, default is 65628
[h264 @ 0x7fbcc4172160] Missing reference picture, default is 65628 
[h264 @ 0x7fbcc4178020] no frame!  6KB vq=    2KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] Missing reference picture, default is 65628
    Last message repeated 1 times
[h264 @ 0x7fbcc40e41c0] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65636
[h264 @ 0x7fbcc412b000] Missing reference picture, default is 65636 
[h264 @ 0x7fbcc4172160] no frame!  5KB vq=    1KB sq=    0B f=0/0   
[h264 @ 0x7fbcc4178020] Missing reference picture, default is 65636
    Last message repeated 1 times
[h264 @ 0x7fbcc4222aa0] mmco: unref short failure sq=    0B f=0/0   
[h264 @ 0x7fbcc4222aa0] Missing reference picture, default is 65644
[h264 @ 0x7fbcc40e41c0] Missing reference picture, default is 65644 
[h264 @ 0x7fbcc412b000] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.                                                                                                                                                                     
[h264 @ 0x7fbcc412b000] If you want to help, upload a sample of this file to ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)           
[h264 @ 0x7fbcc412b000] no frame!
[h264 @ 0x7fbcc4172160] Missing reference picture, default is 65644
    Last message repeated 1 times
   4.01 A-V: -0.001 fd=   1 aq=    0KB vq=    0KB sq=    0B f=0/0   
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:02.02, start: 0.000000, bitrate: 144 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, mp4, to '1.mp4.bsf.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      36kB time=00:00:02.00 bitrate= 146.1kbits/s speed=1.19e+03x    
video:15kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.954602%
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:02.02, start: 0.000000, bitrate: 132 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 49 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, mp4, to '2.mp4.bsf.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 49 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, 70 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=   60 fps=0.0 q=-1.0 Lsize=      33kB time=00:00:02.00 bitrate= 134.0kbits/s speed=1.4e+03x    
video:12kB audio:17kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 11.569260%
ffmpeg version N-79145-ge259dc8 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-libx264 --enable-gpl --enable-encoder=libx264
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 31.100 / 57. 31.100
  libavformat    57. 29.101 / 57. 29.101
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 40.102 /  6. 40.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x20524a0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'bsf.concat':
  Duration: N/A, start: 0.021333, bitrate: 132 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 59.94 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s
    Metadata:
      handler_name    : SoundHandler
Output #0, mp4, to 'bsf_concat.mp4':
  Metadata:
    encoder         : Lavf57.29.101
    Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=2-31, 63 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 11988 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz, mono, 69 kb/s
    Metadata:
      handler_name    : SoundHandler
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2054880] Auto-inserting h264_mp4toannexb bitstream filter
frame=  120 fps=0.0 q=-1.0 Lsize=      67kB time=00:00:04.06 bitrate= 135.5kbits/s speed= 567x    
video:28kB audio:35kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 8.210513%
ffplay version N-79065-g7d9e064 Copyright (c) 2003-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.0, pie-0.6.5)
  configuration: --enable-debug=3 --disable-optimizations --extra-cflags='-O0 -g3 -ggdb3' --enable-pic --disable-stripping --enable-openssl --enable-protocol=file --enable-protocol=pipe --enable-protocol=http --enable-protocol=https --enable-muxer=matroska --enable-muxer=mjpeg --enable-muxer=rtp --enable-muxer=mp4 --enable-muxer=rtsp --enable-muxer=rawvideo --enable-muxer=data --enable-demuxer=rtsp --enable-demuxer=matroska --enable-demuxer=mjpeg --enable-decoder=h264 --enable-decoder=mpeg4 --enable-decoder=mjpeg --enable-parser=h264 --enable-parser=mpeg4video --enable-parser=mjpeg --enable-encoder=mjpeg --enable-encoder=mpeg4 --enable-encoder=rawvideo --enable-encoder=libx264 --enable-libx264 --enable-gpl --enable-nonfree --enable-libfreetype --enable-libopenh264 --enable-libvpx --enable-libpulse
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.103 / 57. 28.103
  libavformat    57. 28.102 / 57. 28.102
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.102 /  6. 39.102
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bsf_concat.mp4':0B f=0/0   
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.29.101
  Duration: 00:00:04.11, start: 0.000000, bitrate: 134 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 55 kb/s, 29.67 fps, 29.83 tbr, 11988 tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 69 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
   4.04 A-V: -0.021 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
[OK]
21:52:07j@zver ~/work/employers/pitneybowes/concat_bugreport/test_dir/ffmpeg
 $

comment:5 Changed 2 years ago by andrey.utkin

Have tested also tag n3.0, behaviour is the same (MPEG TS concatenation is broken).

MPEG TS to MPEG TS concatenation, as shown below, is also broken.

$FFMPEG -i ts.concat -c copy -y ts_concat.ts
ffplay -autoexit ts_concat.ts
$FFMPEG -i ts_concat.ts -c copy -bsf:a aac_adtstoasc -y ts_concat.ts.mp4
ffplay -autoexit ts_concat.ts.mp4

comment:6 follow-up: Changed 2 years ago by cehoyos

Is this still reproducible?

comment:7 in reply to: ↑ 6 Changed 2 years ago by andrey.utkin

  • Resolution set to fixed
  • Status changed from new to closed

Replying to cehoyos:

Is this still reproducible?

No.

Have just tested it on a recent build ffmpeg version N-81976-gfe8959b (fe8959b is of Oct 12).

It passes finely.

Closing this ticket as fixed. Sorry but I couldn't identify fixing commit, I believe it was fixed many months ago.

Note: See TracTickets for help on using tickets.