6

I have a video file with extension .mkv. It contains 2 Audio Tracks.

  1. English
  2. Hindi

English Audio track is the default Audio track. I am trying to set the default Audio track to Hindi because when I try to play it on my LED, it plays English Audio track as it is the default track.

I used below command to set Hindi as default Audio track.

ffmpeg -i input.mkv -map 0:1 output.mkv

But, it still keeps English as default track.

Am I missing anything?

3

2 Answers 2

12
ffmpeg -i "input.mkv" \
-map 0:0 \
-map 0:2 \
-map 0:1 \
-disposition:a:0 default \
-disposition:a:1 none \
-c copy "output.mkv"
  1. input
  2. use video stream (0:0)
  3. make 2nd audio stream (Hindi) the 1st
  4. make 1st audio stream (English) the 2nd
  5. use the new 1st audio stream (Hindi) as default
  6. remove the default from the new 2nd audio stream (English)
  7. create output without transcoding
2
  • I lost several hours until I realized some players (e.g. on the web) don't support some audio formats (and the second audio track was a different format). The solution in my case was to also add -c:a <audio_format> to convert the audio format. Commented Aug 29, 2021 at 1:06
  • 1
    It is really important to use also -disposition:a:1 none, otherwise you end up having two default streams!
    – Paul
    Commented Oct 23, 2022 at 14:18
1
ffmpeg -i input -map 0:v -map 0:m:language:hin -c copy output

Above code helped me. It worked perfectly for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.