ffmpeg: disable one of a several audio streams
Stream selection
By default ffmpeg
stream selection will only map one stream per stream type based upon the following criteria:
- video – the stream with the highest resolution
- audio – the stream with the most channels
- subtitles – the first subtitle stream
In the case where several streams of the same type rate equally the stream with the lowest index is chosen.
Using the -map
option will override this behavior as shown below.
Example 1: Explicit mapping
Tell ffmpeg
exactly what streams you want by referring to the input stream indexes:
ffmpeg -i input -map 0:1 -map 0:2 -c copy output
-
-c copy
will stream copy (re-mux) each mapped stream instead of re-encoding.
Or use stream specifiers:
ffmpeg -i input -map 0:v -map 0:a:0 -c copy output
Using the stream specifiers is more flexible because you don't have to know the exact stream index, and it can help prevent accidental mappings such as attempting to map video to an audio-only format
-map 0:v
will map all video streams from input 0 (ffmpeg
starts counting from 0, so 0 is the first input, and the only input in your case).-map 0:a:0
will map the first audio stream from input 0.
Example 2: Negative mapping
Tell ffmpeg
to map everything, then choose what to exclude:
ffmpeg -i input -map 0 -map -0:a:1 -c copy output
-map 0
will map all streams from input 0.-map -0:a:1
will exclude the second audio stream from input 0.
You can use the stream specifiers to select a stream type and a particular stream. More info here...
http://ffmpeg.org/ffmpeg.html#Stream-specifiers-1