[FFmpeg-user] Selecting MPEG TS child streams for filter_complex

Michael Fladischer michael at fladi.at
Mon Mar 16 10:05:17 EET 2020


Hi,

I'm trying to merge two audio streams from a MPEG TS file using the amix 
filter.

Here's the file metadata:
$ ffmpeg -probesize 50M -analyzeduration 50M -i file.ts
Input #0, mpegts, from 'file.ts':
   Duration: 00:09:32.10, start: 0.000000, bitrate: 12944 kb/s
   Program 1
     Metadata:
       service_name    : HDMI-A,HDMI-B
       service_provider: Epiphan Streamer
     Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 
90k tbn, 60 tbc
     Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 
Hz, stereo, fltp, 322 kb/s
     Stream #0:2[0x102]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuvj420p(pc, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 
90k tbn, 60 tbc
     Stream #0:3[0x103]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 
Hz, stereo, fltp, 322 kb/s

Now I tried to use the child stream IDs of both audio streams in 
combination with amix:

$ ffmpeg -f -i file.ts -filter_complex '[i:0x101][i:0x103]amix=inputs=2' 
-vn -c:a flac /tmp/out.flac

But this throws an error:
Invalid file index 0 in filtergraph description 
[i:0x101][i:0x103]amix=inputs=2.

Do I have to use the stream ID in a different way? I got the [i:<id>] 
syntax from here:

https://trac.ffmpeg.org/wiki/Map

Thanks for your help!

Kind regards,
Michael


More information about the ffmpeg-user mailing list