audio – How to specify `ffmpeg` streams based on the number of their channels
When encoding multiple audio streams with different channel layouts, I want to specify different bit-rate for each, for example 96kb/s as the default and 192kb/s for the second 5.1 stream (see also wiki.xiph.org/Opus_Recommended_Settings).
-c:a libopus -b:a 96k -filter:a:1 channelmap=channel_layout=5.1 -b:a:1 192k
But since a:1 is just a positional specifier, I need to inspect the file beforehand to check what audio tracks it has and what are their layouts.
Is it possible to use some more advanced specifiers to do this kind of mapping automatically? I envision something like -b:a:{channels=5.1} 192k to set the higher bitrate for all 5.1 audio streams.
(For why I need to use the channelmap= filter, see trac.ffmpeg.org/ticket/5718.)
Read more here: Source link
