How to Convert H.264 MKV Files to MP4 Without Re-encoding (Windows)

Posted April 8, 2012 at 7:45pm by iClarified | Please help us and submit a translation by clicking here | 31564 views

These are instructions on how to convert H.264 MKV files to MP4 without re-encoding using Windows.

Following this procedure will save you lots of time and prevent video quality degradation if you need video in mp4 format for playback through iTunes, the Apple TV, or your iOS device.


EXTRACT VIDEO AND AUDIO FROM MKV
Demux (ie extract) the video and audio tracks from the MKV container format.

Step One
Download and install mkvtoolnix from here to your applications folder.


Step Two
Launch a new command prompt window by pressing the Windows + R keys. Then type cmd and click OK.


Step Three
Navigate to the folder that contains your .mkv file and execute mkvinfo video.mkv replacing video.mkv with your filename.


Step Four
Take note of the video codec, video framerate (fps), and audio codec.


Step Five
Execute the following command to extract the mkv file.
mkvextract tracks video.mkv 1:video1.h264 2:audio2.ac3


*Replace 'video' with the name your video file. Also be sure to replace .ac3 with the audio format identified in the previous step. ie. .aac, .dts, etc.


CONVERT AUDIO TO AAC
If the audio track you extracted is not in AAC format than you will need to convert it.

Step One
You can use your favorite application to convert the audio or try Pazera Free Audio Extractor which can be downloaded from here. Once the download finishes, extract the archive.

Step Two
Launch AudioExtractor.exe from the folder you just extracted.


Step Three
Drop the audio file that was extracted from the mkv into Pazera. Note: the audio files will likely be named audio2.ac3 or audio2.dts.


Step Four
Set the Output format: dropdown to AAC and click the Convert button on the toolbar to begin.





COMBINE VIDEO AND AUDIO INTO MP4 FILE
Mux the .h264 video and the .aac audio file into a mp4 file using MP4Box.

Step One
Download MP4Box from here. Extract the downloaded archive.


Step Two
Drag the MP4Box.exe file into the command prompt window you have open and input the following command.


C:YourPathMP4Box.exe -fps 23.976 -add video1.h264 -add audio2.aac video.mp4

*Make sure to specify the frame rate we noted earlier or your audio will be out of sync. Also be sure to use the .aac audio file and not the original.


Step Three
MP4Box will now combine the video and audio tracks into a mp4 that can be added to iTunes!


IMPORTANT: If MP4Box fails due to a missing msvcr100.dll file, you can download that file here. Put it in the MP4Box folder.

Share
Add Comment
Shirley1990 - February 17, 2014 at 5:02am
To convert MKV to MP4, DTS MKV to MP4 with subtitles, DTS MKV to AC3 with 5.1 channels, Aunsoft Blu-ay Video Converter Ultimate is best to keep subtitiles and video quality. With the support ofTrueHD, Eac3, DTS, DTS-HD in BD movie, you can select the subtitle and audio stream with the exact language you want. http://www.aunsoft.com/blu-ray-video-converter-ultimate/
itaymis - April 11, 2013 at 8:06pm
http://www.rapidunlockers.com/ This is the Best site for mobile phones factory unlocks (SIM Free): Only 9.99$ for phone unlocks
Baxter - April 9, 2012 at 8:39pm
I've been using MKV2VOB for years to extract MPEGs out of MKVs for playing on a PS3. I assume the output file should work for iTunes/iOS also. MKV2VOB is smart enough that it only transcodes if it needs to. Most MKVs work & take 30sec-2min to complete. http://www.mkv2vob.com
Baxter - April 9, 2012 at 8:45pm
Here's a step-by-step guide. It's a piece of cake. Just select "MP4" tpe for iOS. http://www.manolution.com/2011/06/the-complete-guide-to-playing-video-on-your-ps3/
Jay - April 9, 2012 at 3:55pm
good tutorial, bit scary for some... However, to do the same I've been using for some time mkvextract(GUI), Audiocoder and YAMB.
Graham - April 9, 2012 at 11:29am
Awesome tutorial. Sure handbrake is easier, but it's Re-encoding the video. This will be way faster overall and no video quality loss.
graham - April 9, 2012 at 11:46am
Just to see, converted a 2 hour mkv file using this process from start to finish, including downloading the tools since i posted my last comment - so, 15 min? a Handbrake encode will lose quality and take much longer.
8 More Comments
Follow iClarified
Girls Need to Make the First Move in Ex-Tinder VP’s Bumble App
Whitney Wolfe, a former Tinder employee who s...
Apple Airs New 'Voice Text' iPhone 6 Ad [Video]
Apple has aired a new 'Voice Text' ad that fe...
Apple Announces That iOS 8 Adoption Has Reached 60% [Chart]
Apple has announced that iOS 8 adoption has r...
uBar is a Replacement for the Mac OS X Dock
uBar from Brawer Software is a Dock replaceme...
Skype 7.2 Released for Mac OS X
Microsoft has announced the release of Skype ...