0
How can I use ffmpeg -map
switch to select the audio track by its codec?
Say there is a video.mkv with one video stream (0) and three audio tracks (1, 2, 3).
The audio tracks have different codecs, say DTS, AAC and AC-3 (in any order).
I want to produce an output file with the video stream -map 0:0
and only the AAC track, something like:
ffmpeg -i video.mkv -map 0:0 -map 0:aac -codec copy output_with_aac_audio.mkv
In the real scenario I don't know which one is the AAC track (1, 2 or 3).
1I am not sure whether there is a way to map by codec, but at least you can check the index with
ffprobe
. – Tom Yan – 2016-02-11T18:18:53.830