ATTENTION:
THIS QUESTION IS ABOUT DISABLING--NOT REMOVING SUBTITLE TRACKS FROM MKV FILES FROM THE COMMAND LINE. PERIOD.
It IS NOT about REMOVING subtitles by REMUXING with
mkvmerge
or any other tool. There are literally thousands of threads about removal by remuxing. That's precisely why I started this thread about DISABLING NOT REMOVING subtiles. I could not find a single thread about that.It is NOT about GLOBALLY DISABLING subtitles in any PLAYER. That is obviously trivial and doesn't need any explanation. I don't need/want to do that and, if I did, I obviously wouldn't have taken the time to research the topic at hand and publish my findings in this thread.
I shouldn't have to add this disclaimer but there have been a number of, in most cases demeaning, 'answers' that reveal a distinct misunderstanding of the OP, suggesting irrelevant 'solutions', and/or criticizing this hack as being 'O-h-h-h-so-difficult' if you want to re-enable the subtitle track at a later date. As I pointed out numerous times, anyone who can understand my answer and who knows how to use the command line will find this task trivial. Those who don't SHOULD NOT ATTEMPT this hack.
The answer has already been given as this is the entire point of this thread. So any new answers are either superfluous or, in SOME cases, irrelevant. I will no longer respond to irrelevant 'answers' or comments or demeaning remarks by users who, judging by their reputations, should know better. Any such abuse will be flagged accordingly.
I welcome any CONSTRUCTIVE suggestions that ADHERE TO THE TOPIC, in a COMMENT, but any 'answers' or negative comments will be unanswered and flagged as inappropriate.
Now that THAT is out of the way, let us begin…
I couldn't find out how to do this anywhere so I thought I'd share this hack with others who, like me, want to DISABLE, NOT REMOVE, subtitles in MKV files.
There are times when you don't want the subtitles that are embedded in a file and you don't want to have to disable subtitles every time you play such a file or globally disable subtitles in every player you happen to have. Or you may want to automatically use a subtitle (srt
) file that is preferable.
Sure, you can completely REMOVE subtitles with mkvmerge
:
mkvmerge --no-subtitles "inputfile.mkv" -o "outputfile.mkv"
But this is heavy-handed and a real pain if you have a bunch of multi-GB files. It takes lots of time and disk space to de- and re-mux every file. So I turned to mkvpropedit
which edits the properties of the subtitle track header in milliseconds. Note that this tool is installed when you install MKVToolNix. Unfortunately, it is not at all obvious how to use this wonderful tool for the task at hand. Here's an example of the properties of a subtitle track as given by mkvinfo
:
| + A track
| + Track number: 4 (track ID for mkvmerge & mkvextract: 3)
| + Track UID: 11363869179551629452
| + Track type: subtitles
| + Default flag: 0
| + Lacing flag: 0
| + Codec ID: S_TEXT/UTF8
| + Name: CC
Despite the default flag
setting 0
(false), the subtitle track is still active by default in players. I later read in the mkvmerge
documentation "If no track is set to be the default track then mkvmerge will promote the first track of each type that it finds to be the default track. This is consistent with the behavior of various media players." I'm not sure if this means that it sets the default flag
to 1
or somehow otherwise arranges for the track to be the default, but it seems maybe the latter.
I tried adding the track enabled
property set to false but it didn't work.
mkvpropedit --edit track:4 --set flag-enabled=0 "inputfile.mkv"
| + A track
| + Track number: 4 (track ID for mkvmerge & mkvextract: 3)
| + Track UID: 11363869179551629452
| + Track type: subtitles
| + Default flag: 0
| + Lacing flag: 0
| + Codec ID: S_TEXT/UTF8
| + Name: CC
| + Enabled: 0