Converting MKV Audio Streams using MeGUI and MKVToolnix
by Michael Healy @ 11:25 am on November 9th, 2009 in converting files, encoding with 11 Comments and Permalink
Converting audio streams already contained inside an MKV can be a daunting process for the beginner. First, we’ll need to extract the audio tracks from the MKV container then we’ll begin the process of converting the track. Finally, we’ll re-mux the entire project back into a new MKV file. There are any number of reasons why one would want to convert from one audio type to another, compatibility with certain hardware such as Media Center Extenders not being the least of them. For this guide we’ll convert from an incompatible DTS stream to an AC3 stream for Media Center Extender compatibility.
Before we get started we’ll need to download and install a few programs. First, in order to read and thereby convert the DTS stream we need a decoder such as FFDShow installed. Under a default installation FFDShow should be all set to decode a wide variety of audio formats including DTS. Next, we need to download and install MKVToolnix and MKVExtract. Installing MKVToolnix is fairly straight-forward though in order to install MKVExtract the archive should be extracted to the same directory as you installed MKVToolnix.
Now that we have the tools to work with MKV files we also need to be able to convert the audio stream once we’ve extracted it. For that we need to download and install both AVISynth and MeGUI. These programs will allow us to work with the individual streams once they’ve been extracted from the MKV file.
Alright, time to get started. First let’s open up MKVExtractGUI from the location where we extracted it which should be in the same directory as MKVToolnix. Using this program is fairly simple, first select the MKV file we’ll be working with from the Input selection box. Once you’ve selected a file the Content box should be populated with the various tracks available. Check the box next to the audio track we want to convert and press the extract button.
After a few minutes (or several depending on the bitrate) you should receive a message stating that the de-muxing was successful and you should now have a .dts file in the same directory as your original MKV file.
Now that we’ve got our DTS stream extracted let’s open up MeGUI and perform the conversion. The first thing you’ll need to do with MeGUI is make sure to update the files for the conversion we’ll be doing, in most cases it can’t hurt to actually update all the available files. First time users will be prompted to update upon launching the program, others can update through the Options –> Update menu.
Next under the Audio tab , in the Audio Input box locate and select our new DTS stream file. Under the Encoder Settings dropbox you’ll need to select the correct audio format you’d like to convert to, in this case FFmpeg AC-3. FFmpeg is actually the program that is being utilized to do the conversion and you should be sure that it has been updated to the latest version through the MeGUI update process. AC-3 is the format we’ll be converting to.
Using MeGUI you can also adjust many of the available settings for the conversion of the stream such as the bitrate and channels available in the newly created stream. Simply press the Config button next to the selected Encoder settings option to bring up the options dialog for that encoder. Enabling the Force Decoding via DirectShow option will enable the use of FFDShow to decode the DTS stream, if you encounter errors during encoding you may want to enable this option as well.
Once you’ve set the options and are ready to do the actual conversion return to the main MeGUI dialog window and press the Enqueue button under the audio section. Then select the Queue tab from the top of the window and press the Start button. This process will take some time to complete and there is a preprocessing period that can take several minutes before the actual process will begin. Once the process has begun you can monitor the progress through the status window.
Once MeGUI has finished converting your DTS stream into an AC3 stream we need to reconstruct our MKV file. Open MKVMerge from the MKVToolnix programs menu and begin by adding the original MKV file to the Input files. Next locate our new AC3 stream and add it to the list of input files as well. Under tracks, chapters and tags you should now see the AC3 audio source listed as well as the original DTS source. MKV supports multiple audio tracks and if your hardware and decoding software does as well you may want to leave both tracks and remux the MKV file like this. However, if you’d like to remove the original DTS track you’ll need to uncheck the track from the list before remuxing the file.
Also, you’ll likely want to rename the new MKV file to something different than the original to be able to discern between the two versions. Once you’ve done that you can now start the muxing process by pressing the Start muxing button at the bottom of the window. A dialog will appear showing you the progress of the process and remuxing should only take a few minutes at most. That’s all there is to it, you should now have an MKV file with a converted audio track.
This process can also be used to convert other audio formats as well using the available MeGUI encoder settings. This guide was written with assistance from an AfterDawn guide published here.
