[FFmpeg-user] Problem splicing files

Andrew Sinclair ajsinclair at gmail.com
Sun Jul 20 04:16:20 CEST 2014


Hi All,

I am having a strange problem splicing some files back together where when
I splice the files back together ffplay reporting:
[h264 @ 0x7fe002024000] Reinit context to 640x368, pix_fmt: yuv420p

This seems to cause a number of players to have issues that causes the
audio to go out of sync. Example here:
http://bucket01.mscreentv.com.s3.amazonaws.com/ffmpeg_tests/test_out.mp4

The only indicators I have on what might be going wrong is this + some
warnings in the concat command see below, noting that all the files that
are spliced together are 640x360 (also see below)

Encoding video that is spliced in:
ffmpeg -i
http://msntest.serving-sys.com/BurstingRes/Site-1122/Type-16/61e59778-0f4a-4d63-af0d-63cf0179a6be.mp4
-c:v libx264 -c:a libfdk_aac -s 640x360 -t 5 -r 25 -profile:v main testad.ts
ffmpeg version N-64602-g9195c26 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Jul 11 2014 15:41:21 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-libx264 --enable-libfdk_aac --enable-nonfree
--enable-gpl --enable-ffplay --enable-libfreetype
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '
http://msntest.serving-sys.com/BurstingRes/Site-1122/Type-16/61e59778-0f4a-4d63-af0d-63cf0179a6be.mp4
':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V mp42isom
    creation_time   : 2014-05-23 03:22:24
  Duration: 00:00:30.04, start: 0.000000, bitrate: 554 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661),
yuv420p(tv), 640x360 [SAR 1:1 DAR 16:9], 393 kb/s, 25 fps, 25 tbr, 25k tbn,
50 tbc (default)
    Metadata:
      creation_time   : 2014-05-23 03:22:24
      handler_name    : Mainconcept MP4 Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo,
fltp, 157 kb/s (default)
    Metadata:
      creation_time   : 2014-05-23 03:22:24
      handler_name    : Mainconcept MP4 Sound Media Handler
File 'testad.ts' already exists. Overwrite ? [y/N] y
[libx264 @ 0x7ff14b02c600] using SAR=1/1
[libx264 @ 0x7ff14b02c600] using cpu capabilities: MMX2 SSE2Fast SSSE3
FastShuffle SSE4.2 AVX
[libx264 @ 0x7ff14b02c600] profile Main, level 3.0
[mpegts @ 0x7ff14b02ba00] Using AVStream.codec.time_base as a timebase hint
to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
Output #0, mpegts, to 'testad.ts':
  Metadata:
    major_brand     : M4V
    minor_version   : 1
    compatible_brands: M4V mp42isom
    encoder         : Lavf55.45.100
    Stream #0:0(eng): Video: h264 (libx264), yuv420p, 640x360 [SAR 1:1 DAR
16:9], q=-1--1, 25 fps, 90k tbn, 25 tbc (default)
    Metadata:
      creation_time   : 2014-05-23 03:22:24
      handler_name    : Mainconcept MP4 Video Media Handler
      encoder         : Lavc55.69.100 libx264
    Stream #0:1(eng): Audio: aac (libfdk_aac), 48000 Hz, stereo, s16, 139
kb/s (default)
    Metadata:
      creation_time   : 2014-05-23 03:22:24
      handler_name    : Mainconcept MP4 Sound Media Handler
      encoder         : Lavc55.69.100 libfdk_aac
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=  125 fps= 85 q=-1.0 Lsize=     460kB time=00:00:05.01 bitrate=
751.5kbits/s
video:321kB audio:87kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 12.770018%
[libx264 @ 0x7ff14b02c600] frame I:4     Avg QP:21.77  size: 20420
[libx264 @ 0x7ff14b02c600] frame P:68    Avg QP:24.76  size:  3014
[libx264 @ 0x7ff14b02c600] frame B:53    Avg QP:30.46  size:   795
[libx264 @ 0x7ff14b02c600] consecutive B-frames: 36.8%  8.0% 36.0% 19.2%
[libx264 @ 0x7ff14b02c600] mb I  I16..4: 19.4%  0.0% 80.6%
[libx264 @ 0x7ff14b02c600] mb P  I16..4:  2.6%  0.0%  1.8%  P16..4: 41.4%
 9.4%  3.0%  0.0%  0.0%    skip:41.9%
[libx264 @ 0x7ff14b02c600] mb B  I16..4:  0.1%  0.0%  0.2%  B16..8: 39.7%
 2.6%  0.6%  direct: 0.6%  skip:56.1%  L0:48.0% L1:47.6% BI: 4.4%
[libx264 @ 0x7ff14b02c600] coded y,uvDC,uvAC intra: 65.0% 42.8% 11.8%
inter: 8.4% 3.8% 0.1%
[libx264 @ 0x7ff14b02c600] i16 v,h,dc,p: 21% 33% 13% 33%
[libx264 @ 0x7ff14b02c600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 29% 13%  5%
 6%  5%  7%  5%  6%
[libx264 @ 0x7ff14b02c600] i8c dc,h,v,p: 45% 24% 21%  9%
[libx264 @ 0x7ff14b02c600] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x7ff14b02c600] ref P L0: 75.7% 10.7% 11.7%  2.0%
[libx264 @ 0x7ff14b02c600] ref B L0: 85.9% 13.4%  0.7%
[libx264 @ 0x7ff14b02c600] ref B L1: 92.0%  8.0%
[libx264 @ 0x7ff14b02c600] kb/s:525.99

*** Concat command ****
ffmpeg -i "concat:test_1.ts|testad.ts|test_2.ts|testad.ts|test_3.ts" -c
copy -bsf:a aac_adtstoasc -y test_out.mp4
ffmpeg version N-64602-g9195c26 Copyright (c) 2000-2014 the FFmpeg
developers
  built on Jul 11 2014 15:41:21 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-libx264 --enable-libfdk_aac --enable-nonfree
--enable-gpl --enable-ffplay --enable-libfreetype
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from
'concat:test_1.ts|testad.ts|test_2.ts|testad.ts|test_3.ts':
  Duration: 00:00:10.73, start: 1.480000, bitrate: 4982 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 640x360, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 116 kb/s
[mp4 @ 0x7fb45a025600] Using AVStream.codec.time_base as a timebase hint to
the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
Output #0, mp4, to 'test_out.mp4':
  Metadata:
    encoder         : Lavf55.45.100
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 640x360,
q=2-31, 25 fps, 90k tbn, 90k tbc
    Stream #0:1(eng): Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz,
stereo, 116 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
665091, current: 660992; changing to 665092. This may result in incorrect
timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
665092, current: 662016; changing to 665093. This may result in incorrect
timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
665093, current: 663040; changing to 665094. This may result in incorrect
timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
665094, current: 664064; changing to 665095. This may result in incorrect
timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
665095, current: 665088; changing to 665096. This may result in incorrect
timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
1340703, current: 1336568; changing to 1340704. This may result in
incorrect timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
1340704, current: 1337592; changing to 1340705. This may result in
incorrect timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
1340705, current: 1338616; changing to 1340706. This may result in
incorrect timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
1340706, current: 1339640; changing to 1340707. This may result in
incorrect timestamps in the output file.
[mp4 @ 0x7fb45a025600] Non-monotonous DTS in output stream 0:1; previous:
1340707, current: 1340664; changing to 1340708. This may result in
incorrect timestamps in the output file.
frame= 1025 fps=0.0 q=-1.0 Lsize=    5938kB time=00:00:40.94
bitrate=1188.1kbits/s
video:5369kB audio:533kB subtitle:0kB other streams:0kB global headers:1kB
muxing overhead: 0.598742%

Details of other files that are concat'd together in the concat command:
ffprobe test_1.ts
ffprobe version N-64602-g9195c26 Copyright (c) 2007-2014 the FFmpeg
developers
  built on Jul 11 2014 15:41:21 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-libx264 --enable-libfdk_aac --enable-nonfree
--enable-gpl --enable-ffplay --enable-libfreetype
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from 'test_1.ts':
  Duration: 00:00:10.16, start: 1.480000, bitrate: 1382 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 640x360, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 116 kb/s
Andrews-MacBook-Pro:tmp andrew$ ffprobe test_2.ts
ffprobe version N-64602-g9195c26 Copyright (c) 2007-2014 the FFmpeg
developers
  built on Jul 11 2014 15:41:21 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-libx264 --enable-libfdk_aac --enable-nonfree
--enable-gpl --enable-ffplay --enable-libfreetype
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from 'test_2.ts':
  Duration: 00:00:10.41, start: 1.400000, bitrate: 1612 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 640x360, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 103 kb/s
Andrews-MacBook-Pro:tmp andrew$ ffprobe test_3.ts
ffprobe version N-64602-g9195c26 Copyright (c) 2007-2014 the FFmpeg
developers
  built on Jul 11 2014 15:41:21 with Apple LLVM version 5.1
(clang-503.0.40) (based on LLVM 3.4svn)
  configuration: --enable-libx264 --enable-libfdk_aac --enable-nonfree
--enable-gpl --enable-ffplay --enable-libfreetype
  libavutil      52. 92.100 / 52. 92.100
  libavcodec     55. 69.100 / 55. 69.100
  libavformat    55. 45.100 / 55. 45.100
  libavdevice    55. 13.102 / 55. 13.102
  libavfilter     4. 10.100 /  4. 10.100
  libswscale      2.  6.100 /  2.  6.100
  libswresample   0. 19.100 /  0. 19.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mpegts, from 'test_3.ts':
  Duration: 00:00:10.81, start: 1.400000, bitrate: 1397 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p, 640x360, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: aac ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp, 101 kb/s


More information about the ffmpeg-user mailing list