[FFmpeg-user] More on audio stream mapping

Tim Nicholson tim.nicholson at bbc.co.uk
Fri Dec 16 13:11:50 CET 2011

I have a file containing 1 video and 4 mono audio streams, and wish to 
create a file with 1 video and 2 stereo audio streams.

Under the old API the extra audio stream was added after the output 
filename, but now it is supposed to be done via the -map and 
-map_channel commands.

It therefore seems that the correct way to now achieve this is:-

ffmpeg -i archive.gxf -c:v copy \
-c:a libfaac -b:a 96k -ar 48k \
-map 0:0 -map 0:1 -map 0:2 \
-ac 2 -map_channel 0.1.0:0.1 -map_channel 0.2.0:0.1 \
-ac 2 -map_channel 0.3.0:0.2 -map_channel 0.4.0:0.2 \

 From my reading of the documentation the:-

-map 0:0 -map 0:1 -map 0:2

maps the video and first two audio streams to the output file, which is 
not the mapping I actually want but is the only way I can see to add the 
extra output audio stream. Then the:-

-map_channel 0.1.0:0.1

commands overwrite this mapping to put the audio channels where I want them.

Adding streams by performing a mapping that is not wanted seems to me to 
be counter intuitive. Or have I misunderstood things?

It also appears that you cannot use -c:a copy if using -map_channel as 
the copy copies the stream as is, and not the channel.


This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated.
If you have received it in error, please delete it from your system.
Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately.
Please note that the BBC monitors e-mails sent or received.
Further communication will signify your consent to this.

More information about the ffmpeg-user mailing list