Hacking Windows 7 Media Center

Setting Default Audio and Subtitle Tracks in MKV Files

by @ 9:00 am on June 24th, 2009 in mkv matroska with 48 Comments

TV Tracking Have an MKV with a default audio track in Russian or subtitles in Chinese? Maybe from ripping an anime you found at a yard sale (who are we to judge)? In any case you could use Media Control to switch the tracks each time you load it up or we could just change the default tracks and not worry about it again. For that matter we don’t even speak Russian and never plan to, why not just remove it completely?

To get started you’ll need your video file, which doesn’t have to be an MKV but will be when we are done, and a copy of MKVMerge. Download and install the MKVToolnix package for Windows (v.2.9.5) then open MKVMerge from the programs menu.

input file

Add the file you want to change the defaults for by pressing the add button on the right of the Input Files box or drag and drop the file into the Input Files box. It may take a few moments but the Tracks available for the file should appear under the Tracks box.

Above you can see that this file contains multiple subtitle files. The principal will be the same with multiple audio tracks. They will be listed as A_ followed by the encoding type.

Now to completely remove any given track from the file simply uncheck the box next to that track under the track listing. Those tracks will now be excluded when we remux (rebuild) our MKV file.

tracks

Once you’ve decided which tracks to keep with your new MKV file it’s time to determine which tracks will play by default. To determine this select each track and examine the General track options below the tracks box.

language default and forced options

Here you’ll find the Language, Default track flag and Forced track flag. These settings are read by the decoder, such as FFDShow, when the file is loaded. Then depending on the settings set in the decoder the track that is played will be selected. For example, if you have set FFDShow (VobSub) to choose English by default English should be loaded by default.

Barring any such setting, the Default track flag will determine the default track to be played. The Forced track flag comes into play if you need to force a particular audio or subtitle file to play always. For instance in a movie with foreign dialog there would be a subtitle stream specifically for this portion of the movie.  This subtitle stream should be set to forced, otherwise there would be no subtitles during this portion of the movie, leaving the audience scratching their heads.

Now you should have one stream of each type marked as the default stream. Set an output filename at the bottom of MKVMerge (which must be different than the input file) and press the Start Muxing button. The process should normally only take a few minutes then you’ll have your output MKV file with the proper default tracks.

48 Comments


Eddie
Comment #1835 from Eddie [Reply]

Once again, amazingly useful information! I’ve been using my HTPC for nearly two years now and in the span of a few months of reading your blog you’ve answered questions/problems I’ve had that entire time. Your articles are always concise, to the point and easy to understand. Thanks for all your efforts, the results are truly appreciated!

Comment left June 24, 2009 at 10:48 am Permanent Link
@Reply #1836 from DamianP [Reply]

I second this. Anyone looking to get the most out of 7MC, this site is a must read. Keep up the good work Micahel.

Comment left June 24, 2009 at 12:17 pm Permanent Link
@Reply #1841 from Michael Healy [Reply]

Glad people are finding these guides useful, when I first started I was sure no one would be interested in this stuff but me

Comment left June 24, 2009 at 6:43 pm Permanent Link

Richard
Comment #1837 from Richard [Reply]

Check out MakeMKV. From the looks of this post, it works pretty much like this program but it seems to be easier to use.

I used it last night for the first time and it was fast and easy to use. It gave me check boxes for all the things I could ever want to exclude. It says what language the subtitles are in, what audio format the track is in, etc. Makes it easy to figure out what to exclude and what to keep.

http://www.makemkv.com/

Comment left June 24, 2009 at 1:26 pm Permanent Link

Xman
Comment #1843 from Xman [Reply]

I agree with all the posters comments above..
Always great tips..thanks alot :)

Comment left June 25, 2009 at 2:15 am Permanent Link
Comment #2640 from Chewbacc [Reply]

I hate this program. I followed the instructions exactly and no matter what every time I finish, the file comes out with the subtitle track set to Disable instead of automatically selecting the english subtitles from the start. This program blows.

Comment left August 11, 2009 at 5:53 pm Permanent Link

mike
@Reply #13619 from mike [Reply]

Was having this same problem. Use the command line tool mkvpropedit that comes with MKVtoolnix. This program changes the flag without remuxing and it works.

Comment left July 8, 2010 at 7:32 pm Permanent Link

Anonymous
@Reply #16784 from Anonymous [Reply]

Thanks for the tip, this worked great!

For those not sure how to do it, here’s the command line for changing default audio track from track 1 to track 2:

“mkvpropedit movie.mkv –edit track:a1 –set flag-default=0 –edit track:a2 –set flag-default=1″

For a subtitle track change simply add ‘s’ to the two instances of ‘track’ (i.e. tracks, where ‘s’ is for subtitle I guess)

Obviously, it’s just as easy to set all tracks to 0, but just keep in mind that setting a track to 1 doesn’t set the other to 0, you have to set them individually like it’s done above to whatever you want…

Comment left September 6, 2010 at 7:30 pm Permanent Link

Dan
Comment #3316 from Dan [Reply]

If you’re using Haali Matroska splitter you can assign audio/sub language pairs in the options. You can also set your audio and subtitle preferences separately. I think that would do the same thing with much less work.

Comment left September 17, 2009 at 2:37 pm Permanent Link

Alex
Comment #3633 from Alex [Reply]

I get subtitles in WMP but I am unable to get subtitles to show up when I play the file in WMC?

Comment left September 29, 2009 at 11:17 pm Permanent Link

Lukela
Comment #10497 from Lukela [Reply]

Extremely easy to use, fast and works like a charm!
Thanks for the tip!

Comment left May 2, 2010 at 2:45 am Permanent Link

s427
Comment #12858 from s427 [Reply]

Thanks for the nice tutorial!
I was wondering if it was possible to link a subtitle stream to a specific audio stream? For instance if I have an “audio commentary” stream (in a foreign language), I would like the corresponding subtitles to be switched on automatically when (and only when) selecting this audio stream. Do you think it’s possible?

Comment left June 13, 2010 at 8:58 am Permanent Link

Sasee
Comment #16898 from Sasee [Reply]

I have a Gateway Desktop PC with Win7 64 bit version. The audio setup has a realtek driver with 7.1 anlog output to my surround receiver.

I tried to install the shark codec and received filter registration error.

I tried installing ffdshow directly but I have no success in playing flac, mkv, ac3 files thru my media player.

any suggestions?

Comment left September 8, 2010 at 12:56 pm Permanent Link

Hugh
Comment #17404 from Hugh [Reply]

This site simply rocks. You made it a one stop destination for my W7 hacking/tweaking needs ;o)

Comment left September 16, 2010 at 9:27 am Permanent Link

John
Comment #17766 from John [Reply]

This site really helped with all the tweaks. I have a file though that whereby english subtitles play at default and the forced track flag is already at no. Any ideas?

Comment left September 20, 2010 at 8:24 am Permanent Link
Comment #19446 from Infiniti [Reply]

It seems no matter how many times I try this It don’t work….
1 – h264 Video)
3 – AAC (Audio)
1 – ASS (Subs)

I set FPS to 24000/1001, tick the AAC is SBR button for my 3 audio files, name the file and press start…

I’ve had some luck, the audio streams play seperate, or the subs display, but NEVER as I want them to…AT THE SAME TIME…

What am I doing wrong???

Comment left October 5, 2010 at 8:49 am Permanent Link

af22
Comment #24816 from af22 [Reply]

you can do this much easier without re-muxing the file.

If you use Haali Media Splitter, go into the options and under “audio and subtitle languages” you can set the priority of what you want displayed. ex: eng,none ; jpn,eng.

Comment left December 1, 2010 at 1:43 pm Permanent Link

Anonymous
Comment #34708 from Anonymous [Reply]

amazing dude..ive been wondering how to do this for ages… xD

Comment left March 4, 2011 at 12:15 am Permanent Link

jeff
Comment #36152 from jeff [Reply]

this is great! now i wont have to use vlc media player and switch audio tracks every time! and vlc has crap playback.

Comment left March 19, 2011 at 11:52 am Permanent Link

Anonymous
Comment #37450 from Anonymous [Reply]

works great thanks

Comment left March 31, 2011 at 12:48 am Permanent Link

Anonymous
Comment #37451 from Anonymous [Reply]

worked great for me had a mkv movie that had a spanish default audio so i use this program to removed it now english is the default audio saved me some download time

Comment left March 31, 2011 at 12:50 am Permanent Link

Jack Luminous
Comment #37569 from Jack Luminous [Reply]

Changing the default flag doesn’t do anything when Haali loads. It’s as if Haali is just playing the first track….Anyone got this to work right?

Comment left April 1, 2011 at 7:20 pm Permanent Link

Jack Luminous
Comment #37570 from Jack Luminous [Reply]

Correction: using mkvpropedit doesn’t do squat with regards the default audio that is played. Setting the flag doesn’t do anything in Haali…am I doing something wrong?

Comment left April 1, 2011 at 7:21 pm Permanent Link

nigel
Comment #39122 from nigel [Reply]

i did all the steps but when i open the new file it says, “This video is an unsupported format and cannot be played without installig additional directshow filters. ”
pls email me soon , thans

Comment left April 19, 2011 at 10:12 am Permanent Link

fto123
Comment #41022 from fto123 [Reply]

how comes there’s no simply tools that just to edit some flag(s) rather than rewrite/reproduce the whole file !!!

Comment left May 8, 2011 at 12:06 am Permanent Link
Comment #41822 from Nil [Reply]

thank you very very much!!!! i can’t thank you enough!!!!!!!!!!! really thank you very much for the help.

Comment left May 16, 2011 at 7:40 am Permanent Link

Maik Lohse
Comment #46579 from Maik Lohse [Reply]

I have some files that have german and english audio tracks included. I put these files on a USB stick to watch them on my big screen TV – but my TV will only play the standard track, which is english in this case. After using the program and switching the german track to standard now my TV doen’s play ANY audio anymore. The video play but no audio. Am I doing something “wrong” or will this only work for software players?

Comment left August 12, 2011 at 7:07 am Permanent Link

lightswin
Comment #46678 from lightswin [Reply]

hi! i downloaded a movie with mkv as an extention. however when playing with my led TV, languages are simultaneously playing, english and vietnamese. tried to disable the vietname by choosing the english audio as default via mkv merge but still not working. help!!! thanks a lot!

Comment left August 16, 2011 at 8:14 pm Permanent Link

superball
Comment #46692 from superball [Reply]

Did not work for me. Started by following the directions exactly, then experimented with various options, same result: a file which would not play, took forever even to load in Windows Explorer (progress bar for the folder takes 90 seconds), took forever to delete…basically almost crashed the system. Would really like a fix. Can play file in DivX Player (in English!) but would be nice to play in WMC also.

Comment left August 17, 2011 at 1:33 am Permanent Link

Azhar
Comment #52733 from Azhar [Reply]

thankssss alottttt

Comment left November 30, 2011 at 12:19 am Permanent Link

Anonymous
Comment #54421 from Anonymous [Reply]

Thx very much. I initially had trouble with the video not playing back at all and producing an error after muxing the MKV file, but eventually found out that the software I was using to play the file (MPlayer/SMPlayer) did not support header removal compression. After explicitely disabling compression, the video played back just fine with the appropriate audio/subtitles that I’ve selected. (More info here for anyone exhibiting similar problems: http://www.bunkus.org/videotools/mkvtoolnix/faq.html#header_removal_compression).

Comment left December 15, 2011 at 5:15 pm Permanent Link

Mike S
Comment #59197 from Mike S [Reply]

Hey Michael,

Just want to thank you gratiously for all the work you put into this blog. You have helped me turn my PC setup into a a very capable media centre, and helped to encourage me to invest in an extra screen and hook up another stereo in behind it, all because of the awesome advice on your site.

Your posts from Sharks codecs, all the way through MKV thumbnails, MKVs in WMC, changing strips/adding strips in WMC, rebinding keys to my WMC remote… and now here where I want to either select/remove audio streams from MKV’s you have been amazingly helpful to me, and allowed me to maximise the utility I can get out of my hardware… You’ve even encouraged me, albeit indirectly, to invest in more wirless interfacing, like keyboards, gamepads, and other accessories all because you’ve help me to see that through WMC I can basically do anything with my remote! I can run macros to start up PC games, run emulators, and other tasks, almost 100% because of your advice and guidance, even where all you may have done is explain 3rd party software or tweaks.

I really hope you know and believe that your blog is radically helpful to thousands. I’m confident it is. It’s one of the most reliable sources of information on a generally neglected piece of software, and one of the best no-nonsense blogs I have ever come across. I would shake your hand if I had the opportunity.

Cheers,

Mike.

Comment left January 17, 2012 at 10:13 pm Permanent Link
@Reply #59257 from Michael Healy [Reply]

Thank you, Glad to have helped. I just wish I had a little more time and energy to put into it recently but I’ll be sure it stays around as an informational source for as long as possible.

Comment left January 18, 2012 at 11:43 am Permanent Link

ryan
Comment #62255 from ryan [Reply]

theres a quicker way.

when you load up the gui, goto file and header editior,

you can change the flags and then save it instantly.

Just thought you should know, also i never would have found this if you hadnt shown me.

Comment left February 12, 2012 at 12:26 pm Permanent Link
Comment #68577 from SonsofAnarchy [Reply]

Hi Michael followed the original directions and am muxing. It is a 720p tv series episode and is taking way longer than advised above. Currently at 40mins and counting.

Prior to commencing muxing which file should I have highlighted and renamed? I highlighted the V_MPEG4 line in this case. Thoughts?

Regards and thanks

Comment left April 8, 2012 at 5:11 am Permanent Link
Comment #69345 from mauricio [Reply]

thanks a lot saved me a lot of trouble :)

Comment left April 14, 2012 at 10:53 am Permanent Link
Comment #71241 from feroz [Reply]

great write up. works. thanks

Comment left April 30, 2012 at 6:56 am Permanent Link

cvrcmrc
Comment #71583 from cvrcmrc [Reply]

Thank you! Works! Just what I need! ;-)

Comment left May 2, 2012 at 8:24 am Permanent Link

ANKIT VORA
Comment #78498 from ANKIT VORA [Reply]

Dear your suggestion is fentastic….its realy work…thank you very very very much….

Comment left August 11, 2012 at 4:02 pm Permanent Link
Comment #79979 from Andrew [Reply]

big thanks dude!!!!!!!!!!!!!!!!!!!!!

Comment left August 24, 2012 at 11:44 am Permanent Link

Kay Haytha
Comment #87321 from Kay Haytha [Reply]

[1] I downloaded an mkv movie with multiple subs
[2] I adjusted the subs as above leaving only the English subs and deleting the rest
[3]I burnt the adjusted movie onto a DVD disk
[4] But when I play the disk using a DVD Player (with mkv) I get the message “Subtitles not available”
[5] What could possibly be the reason for this ?

Thanks in advance for you advice & help

Comment left November 1, 2012 at 2:07 am Permanent Link

Nathan Cleary
Comment #101075 from Nathan Cleary [Reply]

After changing the default language and ‘muxing’ i get a .mka file which doesnt display any video, only audio.
need help please! :)

Comment left January 23, 2013 at 5:44 am Permanent Link
Comment #104287 from Carson [Reply]

I recorded myself doing this for entire folders at a time. It’s much easier than doing them one at a time.

http://www.youtube.com/watch?v=bHTlQ61AaIE

That’s the video if you’re interested.

Comment left February 12, 2013 at 2:33 pm Permanent Link

Anonymous
Comment #124408 from Anonymous [Reply]

best tool to isolate a languge from other

Comment left May 20, 2013 at 6:10 pm Permanent Link

Dan
Comment #129655 from Dan [Reply]

Thanks for this guide! SOOOOOO USEFUL! I had an MKV with both and Russian and English audio track, and couldn’t figure out how to get rid of the Russian. You solved it for me.

Comment left June 10, 2013 at 9:04 am Permanent Link

friuns
Comment #168964 from friuns [Reply]

much faster just go to file->edit header

Comment left August 7, 2013 at 5:30 pm Permanent Link

Anurag Patanwar
Comment #420650 from Anurag Patanwar [Reply]

Lovely tip…worked like magic…you rock…

Comment left February 20, 2014 at 12:20 am Permanent Link

Leave A Comment

Post Anonymously, Fill in your details or Use one of the Social Networks below to login and post a comment!