Extracting Subtitles from a MKV

You have a .MKV (Matroska Video) video file with embedded subtitles and you need to extract them to separate .SRT (Subtitles) file. Here is how to do this with the help of freeware software.
You will need the following:
  1. a .MKV File with a built-in Subtitles track (how to check will follow shortly)
  2. Your favourite media player. For this post I use VLC Media Player 
  3. MKVToolnix – a set of cross platform tools for .MKV files (get them from here)
And here is how you get going.

Step #1 – Verify that your MKV file actually does have built-in subtitles
Screenshot #1
(Click to zoom)

The easiest way is to check is to open the file using VLC Player. Select Tools >> Media Info (or press Ctrl+J). Switch to the “Codec Details” tab. Expand all the items underneath until you find one with the type “Subtitle”.  An example can be seen in the screenshot on the right.

Another way of doing this is to use the mkvinfo tool from the MKVToolnix collection mentioned above. If you are, start up mkvinfo in graphical mode with the following command line:

mkvinfo –g {Press Enter}

Then open up your .MKV file (Select File -- Open). You should see the same information as we saw before here too (see screenshot).

Screenshot #2
(Click to zoom)
Important: Make a note of the “Track Number” for our subtitle track. In our case, the value is 3. This will come in handy with the extraction process. The "Codec" field of the same track tells you if the subtitles you are going to extract are Text. This is important because .SRT files are supposed to be text. If your codec is any different, the following steps can be used to extract such subtitles into it's own file. But additional post-extractions steps will be necessary to convert the specific format into the text-based .SRT format.

Step #2 – Extract the Subtitles into a .SRT file
We will now use the mkvextract tool from the MKVToolnix kit. The exact command line format to use is:

mkvextract.exe tracks {path of the MKV file}  {track number we noted in the previous step}:{Filename to save the subtitles to}

In the case of my example, this will look like the following:

mkvextract.exe tracks "c:\My_MKV_Video_File.mkv" 3:My_MKV_Video_File.srt

Note the number used to prefix the .SRT filename. This is “Track Number” we noted in the previous step.

Going beyond
The mkvextract tool is just as capable of extracting other tracks - audio, video or non-text subtitles. All you need to do is use the right track number as prefix. So for instance, if the first track is audio, you can extract it with very little modification to the command we used before

mkvextract.exe tracks "c:\My_MKV_Video_File.mkv" 1:Audio_track.mp3

Again, note that we prefixed the MP3 filename with the right track number. We can also combine all of what we did above to extract both audio and subtitles in one single line:

mkvextract.exe tracks "c:\My_MKV_Video_File.mkv" 1:Audio_track.MP3 3:My_MKV_Video_File.srt

For more possibilities, look through the documentation of the mkvextract tool. And if this does work for you or you did something cooler with this - I would love to hear from you. Please leave me a comment below.

See also: Extracting an MP3 from a Youtube video

Originally published: 15th Jan 2011. 
Last updated: 17/11/2015