[FFmpeg-user] Confused with an example of stream mapping in ffmpeg man page

scrutinizer iljashebalin2 at gmail.com
Thu Aug 27 14:56:21 EEST 2020


The example reads as follows:

ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:0 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4

       In the above example, a multichannel audio stream is mapped twice for output.  The
       first instance is encoded with codec ac3 and bitrate 640k.  The second instance is
       downmixed to 2 channels and encoded with codec aac. A bitrate of 128k is specified
       for it using absolute index of the output stream.


We see the second audio stream appearing as in “-ac:a:1" and “-c:a:1” and the set of options is capped with the absolute index for the stream number 2 written as “-b:2”. However the second manual mapping option is “-map 0:a:0” in the example. Shouldn’t it have been “-map 0:a:1”? Prior to the example we don’t know anything about how many streams are in the output and input files. If there’re more than 1 then it’s logical to assume that audio-stream number 1 is encoded with ac3, while the other one is set to be made as a 2-channel encoded with aac. 
Does all above mean that the correct command line should’ve been 
“ffmpeg -i multichannel.mxf -map 0:v:0 -map 0:a:0 -map 0:a:1 -c:a:0 ac3 -b:a:0 640k -ac:a:1 2 -c:a:1 aac -b:2 128k out.mp4”?


Kindest regards, 
Elijah


More information about the ffmpeg-user mailing list