I have a video with 1 video stream, 2 audio streams (TrueHD 7.1 and E-AC3 5.1), a bunch of PGS subtitles and chapters.

I want to copy the video, convert the 7.1 audio into AAC, copy over the original 7.1 and 5.1 streams (so 3 audio streams), keep only French and English subtitles and all the metadata.

After a few trials, this command seems to do exactly that:

ffmpeg -i input.mkv -map 0:v:0 -map 0:a:0 -map 0:m:language:eng -map 0:m:language:fre -c copy -c:a:0 aac -b:a:0 512k output.mkv

Stream mapping:

  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (truehd (native) -> aac (native))
  Stream #0:1 -> #0:2 (copy) # truehd 7.1
  Stream #0:2 -> #0:3 (copy) # e-ac3 5.1
  Stream #0:3 -> #0:4 (copy) # (English subtitles)
  Stream #0:6 -> #0:5 (copy) # (French subtitles)

Now the question is... if I wanted to get rid of the e-ac3, how would I do that?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.