Saturday, November 12, 2005

How To - Converting an MKV to DivX AVI


Have you ever encountered files with a .MKV extension? Perhaps you have been able to play them on your computer. But what if you wanted to play it on your DivX hardware?

This is a really tough process right now. There are programs out there such as RiverPast Video Cleaner which claims to be able to do this easily, but in my experience all you get is choppy video, or usually nothing more than just corrupted files.

In most cases VirtualDubMod may work for you. But it is not 100% fool-proof and you won't discover the flaws until you have watched it yourself.

So here's my process, tested 100% to work with Anime fan subs and whatever you might be able to throw at it.

Software you will need:
1. MKVextractGUI - a GUI wrapper for Moritz Bunku's MKVextract.
2. MKVToolNix - needed by MKVExtract
3. QuickTime Pro - used for decoding AAC files
4. Advanced WMA Workshop* - you can use any other audio converter you prefer, i use this for converting from OGG and other audio files.
5. VirtuaDub - the main man
6. Subtitler - VirtualDub plugin for using subtitles
7. SRT to SSA converter - SSA is the subtitle format used by VirtualDub
8. LAME - for MP3 encoding

Step 1: Demux the MKV.
- If you haven't, copy the files of MKVToolnix to the directory of MKVExtract. If you get DLL errors, you were not able to copy everything. Try downloading the RAR archives instead and copying all of it.

1. Load the MKV file in MKVExtract by clicking Browse and select the appropriate file.
2. Check the boxes next to the tracks you want under Tracks/attachments/chapters/tags
- select the video, an audio, and a subtitle track
- the 1st audio and subtitle tracks are usually english
3. Choose the output directory
4. Click Extract.
5. You should now have 3 files ready for processing.

Step 2: Convert Audio files to WAV
1. Do your own thing here. We just need the WAV files. Be sure to preserve the length of the audio track. Be careful not to introduce or remove any silence at the beginning (some programs automatically do this, so disable that setting).
2. Additionally, if you are converting from AAC, I recommend QuickTime for this. Use the Export command and select WAV.

Step 3: Convert SRT to SSA
1. Load your SRT file in SRT to SSA converter (The program's title is actually Conversor SRT a SSA).
2. Choose the output directory and filename.
3. Adjust the settings as you would like. I just changed the font color from yellow to white though.
4. Click Convert

If you get the error Input file error, subtitle # 1, open the SRT file in notepad and change the encoding from unicode to ANSI.

Step 4: Convert to DivX AVI
- If you haven't, install LAME by right-clicking on the .inf file and clicking Install.
- If you haven't, install Subtitler by copying the .vdf file to the Plugins folder of virtual dub.

1. Open the video file in VirtualDub
2. Go to Video->Filters, load Subtitler and load your SSA file where it says Sub Station Alpha v2.x/4.x filename. Yes, that means the SSA filename.
3. Also in the Video menu, click Full Processing.
4. Still in the Video menu, click Compression and choose DivX. Adjust the settings as you would like. But I otherwise keep it on default.
5. Go to Audio->Wav source... and load your WAV file.
6. Also in the Audio menu, click Full Processing.
7. Still in the Audio menu, click Compression and choose LAME. Adjust the settings as you would like. I use 128kbps at 44.1Khz.
8. Click File->Save as AVI.
9. Choose the output directory and filename. Click Save.

It should now start processing. You may want to unselect Show input video and Show output video to increase performance.

If you get the Audio Compression not possible error:
Virtualdub cannot encode something at 44.1kHz Stereo if the source is 48kHz or mono etc. The reason you are getting the error is because you are encoding the stream without converting the input to match the selected compression type. So, make sure that you select the right options for your input audio - if you have a 48kHz stream then choose that as the encoding option.

0 Comments:

Post a Comment

<< Home