[FFmpeg-user] Mapping of audio streams after -filter_complex concat

John Bartlett john.bartlett at bci.eu.com
Sat Mar 29 00:29:14 CET 2014


All,

I am attempting to join several files and ranscode.  however the output audio streams are swapped at the output of the concat filter and the parameters associated with the streams appear to have been merged.

Any help/advice is appreciated..

The command I am using is:

ffmpeg -i D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence1.ts -i D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence2.ts -i D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence3.ts  -filter_complex "[0:0] [0:1] [0:2] [1:0] [1:1] [1:2] [2:0] [2:1] [2:2]  concat=n=3:v=1:a=2 [v0] [a0] [a1]" -map "[v0]” -map "[a0]" -map "[a1]” -c:v:[v0] h264 -b:v 5000k -bufsize 600k -maxrate 5000k -minrate 5000k -deinterlace -coder 1 -trellis 1 -r 25 -keyint_min 12 -g 12 -bf 1 -b_strategy 1 -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -me_method epzs -aspect 16:9 -s 720x576 -me_range 16 -sc_threshold 40 -i_qfactor 0.71 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -pix_fmt yuv420p  -c:a:[a0] mp2 -ab 192k -ar 48000 -ac 2 -sample_fmt s16  -c:a:[a1] ac3 -ab 384k -ar 48000 -ac 2 -sample_fmt fltp -f mpegts -y "d:\tank\Hp_2.ts" 


The output I get is:

Input #0, mpegts, from 'D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence1.ts':
  Duration: 00:00:05.48, start: 1.400000, bitrate: 94618 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High 4:2:2 Intra) ([27][0][0][0] / 0x001B), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0:2[0x102](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
Input #1, mpegts, from 'D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence2.ts':
  Duration: 00:00:00.99, start: 1.400000, bitrate: 75595 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #1:0[0x100]: Video: h264 (High 4:2:2 Intra) ([27][0][0][0] / 0x001B), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #1:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #1:2[0x102](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
Input #2, mpegts, from 'D:\Transcode\itv\assets\inprogress\2459c45e-c9a0-439a-a933-1e3d49198038_sequence3.ts':
  Duration: 00:00:03.23, start: 1.400000, bitrate: 92505 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #2:0[0x100]: Video: h264 (High 4:2:2 Intra) ([27][0][0][0] / 0x001B), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #2:1[0x101](eng): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 192 kb/s
    Stream #2:2[0x102](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 384 kb/s
[libx264 @ 03f90020] using SAR=64/45
[libx264 @ 03f90020] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 03f90020] profile High, level 3.0
[mp2 @ 0316ac00] Specified sample format fltp is invalid or not supported
Output #0, mpegts, to 'd:\tank\Hp_2.ts':
    Stream #0:0: Video: h264 (libx264), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=10-51, 5000 kb/s, 90k tbn, 25 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s
    Stream #0:2: Audio: mp2, 48000 Hz, stereo, fltp, 384 kb/s
Stream mapping:
  Stream #0:0 (h264) -> concat:in0:v0
  Stream #0:1 (mp2) -> concat:in0:a0
  Stream #0:2 (ac3) -> concat:in0:a1
  Stream #1:0 (h264) -> concat:in1:v0
  Stream #1:1 (mp2) -> concat:in1:a0
  Stream #1:2 (ac3) -> concat:in1:a1
  Stream #2:0 (h264) -> concat:in2:v0
  Stream #2:1 (mp2) -> concat:in2:a0
  Stream #2:2 (ac3) -> concat:in2:a1
  concat:out:v0 -> Stream #0:0 (libx264)
  concat:out:a0 -> Stream #0:1 (ac3)
  concat:out:a1 -> Stream #0:2 (mp2)
Error while opening encoder for output stream #0:2 - maybe incorrect parameters such as bit_rate, rate, width or height

John



More information about the ffmpeg-user mailing list