2

The command I usually use in case of single audio stream mkv files to convert them to mp4 is:

ffmpeg -i location of mkv file\movie.mkv -c copy location of my usb stick\blablabla.mp4`

But when I did this command with an mkv file that had two audio sources, I ended up with no sound at all on TV and only English audio on PC, when I needed the Hungarian version. What is the command that converts mkv to mp4 while keeping only the audio source specified by me? If it's any help VLC says that audio track #2 is the Hungarian version.

1 Answers1

3

Use the -map option to select specific streams.

First video stream, second audio stream:

ffmpeg -i input -map 0:v:0 -map 0:a:1 -c copy output

Or select all streams with Hungarian language metadata:

ffmpeg -i input -map 0:v:0 -map 0:a:m:language:hun -c copy output

I'm guessing your stream indexes in these examples, so you may have to adjust the actual values. Just probe the file first to see the details: ffmpeg -i input

llogan
  • 59,497
  • Thank you, I will try this one first before screwing up again with bad GUIs. – lapartman May 13 '19 at 17:33
  • Thanks dude, I converted the first few minutes and then stopped it to check and it was in Hungarian. I used your first command. – lapartman May 13 '19 at 17:44
  • @llogan cus added recursive matching, so -map 0:a:m:language:hun now works. – Gyan May 13 '19 at 18:09
  • @Gyan Thanks. Didn't notice that commit. Haven't been paying as much attention (and no longer subscribed to the MLs). – llogan May 13 '19 at 18:22