Chapter 8 : MKV

The Matroska format is a nice compact container to put subtitles and multiple crap into a file. But as usual, lack of a standard by anybody makes even good ideas next to useless. There are probably many programs for converting ogg and mkv formats out there but I will choose MKVtoolnix. I will use the command line version and explain the steps.

You start up the command prompt as you normally would.

I would note, it might be easier on you if you move all the source video .mkv to the directory that has the mkvextract.exe program.

The command we will use is:

mkvextract tracks tenchi.mkv 1:video.ogg

This command will extract the number 1 track out of the Tenchi, which usually is video, to a filenamed "video.ogg". Now the video could be encoded in some other format other than .ogg but most of the time it will be in Matroska.

mkvextract tracks tenchi.mkv 2:audio.ogg

This command will extract the second track out of Tenchi, which usually is the audio content, to a filenamed "audio.ogg". Again, the format of the audio could be something else like AC3 or MP3 or SUX or FUK, but lets let it be .ogg for this example. You can use a converter to change it to .wav later.

mkvextract tracks tenchi.mkv 3:subtitles.sub

This command will extract the third track out of Tenchi, which usually is the subtitled text content, to a filenamed "subtitles.sub". Again, the format of the text could be something else like .txt or .sub or .srt for this example we will leave it in .sub format. You can use converters to change it later.

So a sample session will look like this, where I have taken my Tenchi movie, (which I renamed to just "T2" to keep it short) and extracted the three tracks out of it. You will note, it tells you what codec the file is encoded with. Anyway this screen comes up as follows:

So you can see that the video is track 1, and it is saved in v.ogg and it is encoded using "v_ms/vfw/fourcc". Standard Mpegencoder or Virtualdub will be able to take care of this file now. The audio track is track 2, and it is saved in a.ogg, and it is encoded using "a_mpeg/L3" which is your standard MPEG layer 3, ie... MP3. The last track 3, is the subtitled track and it has been identified by "s_text/SSA" which is in SubStationAlpha format already.

Now you got the various pieces of the movie, you can use the technique you learned in Chapter 6 with Virtualdub to put the movie back together again with the subtitles.