Tool
Sometimes you play a movie on a TV or a player and hear a language you did not want, or the subtitles turn on or off by themselves. MKV stores a ‘use this one by default’ mark and a language code for every track in its header, and players usually look at these values to pick the track to play first. Pick a file and the tool reads those marks and shows them. Choose the track you want as the default and it switches off the other tracks of the same type automatically, then saves a new file. The video is not re-encoded or remuxed, and the file never leaves this browser.
MKV (Matroska) nests its elements in a structure called EBML. The track list lives in the Tracks element, and a single track is a TrackEntry. Inside it are the FlagDefault (the default-track mark; 1 means on), FlagForced (the forced mark) and Language (the language code, usually 3 letters such as kor or eng) elements. By the spec, the default of FlagDefault is 1 and the default of Language is eng, so if the element is missing altogether, it is read as that value. The track list sits apart from the Cluster elements that hold the video and audio data, so changing these values does not alter a single byte of the compressed video and audio.
That is why this tool reads only the Tracks part, not the whole file. When it edits, it does not change the length of any element and overwrites only the value in the same place (the default flag is one byte, 0 or 1, and the language is the same 3 letters in the same spot). If an element’s length changed, the indexes that point to later positions (SeekHead and Cues) would no longer line up, so the tool deliberately stays inside this range.
und means the language is undetermined.Tracks or a TrackEntry has a CRC-32 element and the value was valid, the tool recalculates the new value after the edit. A CRC that was already wrong is left alone.eng), fix that track’s language too. If your player picks tracks by a ‘preferred language’ setting, the language code may matter more than the default mark.FlagForced) is only read by this tool, not changed.mkvpropedit from MKVToolNix is the standard command-line tool for editing these values inside the file. The command this tool builds takes a form like --edit track:a2 --set flag-default=1, which selects a track by type plus number and sets a value. mkvpropedit is known to change only the values of the track you specify, so after turning on a new default track you have to write one more command yourself to turn off the previous default. This tool does both at once. On the other hand, mkvpropedit can insert new elements when it needs to, while this tool only overwrites the value of an element that already exists, at the same length. So it can do less, and for files it cannot handle you need mkvpropedit or mkvmerge.
ffmpeg can reach the same result with options like -disposition:a:0 -default and -metadata:s:a:1 language=kor, but that approach writes a new container, rewriting the entire file, which costs more time and disk on large files. The structure of containers and tracks is covered in Lesson 10-1.
FlagDefault element at all defaults to ‘on’ by the spec and cannot be turned off, and a track with no Language element cannot have a language set either. In that case the tool writes the reason on screen and blocks saving. Creating the element would change the length of the file, which is a job for mkvpropedit or mkvmerge.Language, and when it is present it is known to take priority. This tool does not edit that element, so changing Language alone might have no effect or leave the two values disagreeing; that is why it is blocked.