Hacking Windows 7 Media Center

Setting Default Audio and Subtitle Tracks in MKV Files

by Michael Healy @ 9:00 am on June 24th, 2009 in mkv matroska with 12 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.

12 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

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

Leave A Comment

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