I have lots of files with multiple audio and subtitle languages, however the track numbers aren't consistent (the English audio stream isn't always the first) so using a command such as:
ffmpeg -i "input.mkv" -map 0 -map -0:a:1 -c:v copy -c:a copy "output.mkv"
doesn't yield expected results. After searching around I discovered it was possible to map streams based on language with this command:
ffmpeg -i "input.mkv" -map 0 -map -0:m:language:eng -c:v copy -c:a copy "output.mkv"
However -map -0:m:language:eng
will remove all tracks with the English language flag. To keep the subtitle tracks you can use -map 0:s
this is a good solution however, I want to know if it's possible to only map audio streams based on language. I.e.,
I want to remove English audio while retaining all other streams without using stream IDs.