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).
ffprobe
. – Tom Yan Feb 11 '16 at 18:18