So you got a fandub or an AMV planned and you got all your resources together. You have the videos you want to use, sound effects, lines and whatnot.
However, your video is in an MKV format. A lot of video editors, even the really expensive ones, cannot open an MKV file. Also, your video contains those pesky subtitles and you don't want to crop out precious video.
In this tutorial, I will show how to change an MKV file to an MP4 file without converting under the right conditions.
The conditions are:
- The video must be encoded in the H.264 standard. (Also called MPEG-4 Part 10 or AVC)
- The audio must be an MPEG standard. (MP2, MP3, AAC, etc.)
- The video needs to be softsubbed, meaning you're able to turn it on and off in the player settings.
The main goal is to go through as little transcoding processes as we can. The less transcodes, the less degradation on the video/audio quality.
However, if your MKV file does not have a video encoded in the H.264 standard or audio tracks encoded in an MPEG standard, then don't worry. We'll just have to go through a couple more steps. But if your video is hardsubbed, then you're out of luck.
In order to check, open up VLC player, play your video and check the codec information.
We see that this file has an H.264 video stream, two AAC audio streams, and two subtitle streams. Perfect, this video will not go through a conversion process.
First, you must download this program: MkvToMp4
You do not have to install it. Just extract the folder to wherever you like. NOTE: It is recommended that you have QuickTime installed, but for my purposes I won't need it. It is used for converting the audio streams. If you have Windows XP, you will need the Microsoft Visual C++ 2008 Redistributable Package, or else the program won't run.
Next, add the video you want to change by clicking "Add", or dragging and dropping.
It should list what's in the file. Now check/uncheck the streams you want/don't need.
Now go to "Setup" and choose an output destination. Click "Save" and you're ready to go.
However, if your video needs to be re-encoded, then this program will do it for you. Instead of clicking save, go to the "Audio" tab. Pick whatever settings you like. (NOTE: This is where that QuickTime thing kicks in.)
Same thing for the video. Click on the "Video" tab and choose a preset.
If you're picky about video quality, you can customize the presets and input your own parameters using the textbox.
Once you are ready, save and click "Start". It'll prompt you to "Start the process?" Just click yes. Depending on the video you have, the program will either start demuxing and muxing your video or converting it.
When that's done, you will get another prompt.
If you're converting, this process will take a lot longer. Go ahead and close the program (which will prompt you AGAIN).
If everything goes well, you will have a nice MP4 file waiting to be edited.
Your video is now editable and subtitle-less.
And if we look at the codec information...
We only have one audio stream and no subtitles.
If you still have questions, post 'em and I'll try to answer them as best as I can.
It is still possible to do all this without a Windows machine, but the process is a bit more difficult. You will need two programs: mkvtoolnix and MP4Box. I'll be using the gpac package which comes with MP4Box. However, gpac needs to be complied so if you don't know how compile, then you have a couple options depending on your operating system. Linux users can just type in "apt-get install gpac". Mac users can use an already compiled standalone MP4Box program. Once you've got those programs, get ready because this process is Terminal-heavy.
I am using Ubuntu, so your commands may be different from mine.
The first tool (or toolset in this case) we're going to use is mkvtoolnix. Open up Terminal and change the directory to wherever your video is. It's best if you rename your video to something less complicated. I renamed mine EoE.mkv
Next, type in this command:
Of course, replace 'video.mkv' with the file name of your file.
mkvmerge -i video.mkv
This will identify the IDs of the individual tracks. We can see here that #1 is the video, #2 is an audio track, and so on.
Now, pick which tracks you want to extract.
Use this command as a guideline:
The reason I'm not using .mp4 for the video and .m4a for the audio is because MP4Box will think your streams are corrupted. So you're going to have to use the codec extension. (e.g., DivX=.divx, XviD=.xvid...)
mkvextract tracks "input.mkv" 1:"video.h264" 2:"audio.aac"
The good thing about this method is if you have a video that's MPEG-4 Part 2 (DivX, XviD), MPEG-2, or MPEG-1 encoded, then you're in luck. Since they are an MPEG standard, they will fit in an MP4 file container. You are not forced to convert your video into H.264 exclusively.
Once it is done extracting, you should have two new files (or however many you extracted) inside the directory.
Now we are going to use MP4Box, so clear all that previous junk from the terminal.
Use this as a guide line:
You need to specify the framerate of your video or MP4Box will choose for you. More often than not, MP4Box is usually wrong. If you don't specify the right framerate, then your audio and video streams will be out of sync.
MP4Box -add "video.h264":fps=x -add "audio.aac" "output.mp4"
So no rounding.
If everything goes right, you should have a nice MP4 file.
For Mac and Linux users, sorry there isn't an easier way to do this. If you find an easier way, please post them.