April 18, 2024

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

Posted April 8, 2012 at 5:16pm by iClarified
These are instructions on how to convert H.264 MKV files to MP4 without re-encoding.

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 on your iOS device.

***We have posted an easier version of this tutorial here, we suggest that most users follow that tutorial instead.***



IDENTIFY THE SOURCE VIDEO AND AUDIO
Before beginning lets get some details on the source video and audio.

Step One
Download and install VideoSpec to your Applications folder from here.

Step Two
Launch VideoSpec from your Applications folder.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Three
Click Select from the toolbar.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Four
Choose your .mkv file and click Open.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Five
Make sure the video format is H.264 and take note of the Frame Rate (fps) and Audio Format.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Important: Make note of the Encoding Profile. Some older Apple devices only support the Main profile so if your video is High Profile this procedure may not work. The new Apple TV supports High Profile at Level 4.0; however, we have tested level 4.1 and it worked fine in all attempts. The iPhone and iPad support High Profile level 4.1.


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

Step One
Download and install iMKVExtract from here to your applications folder.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Two
Launch iMKVExtract and click the Browse button to select your Matroska file.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Three
Select your mkv file and click the Choose button.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Four
Select the video and audio track for extraction. These are usually track one and track two.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Change the target folder if need be and click the Extract button.

Step Five
iMKVExtract will let you know when the extraction is complete.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)


CONVERT AUDIO TO AAC
If the audio track you extracted is NOT in AAC format than you will need to convert it. If it is in AAC format then you can skip this section.

Step One
You can use your favorite application to convert the audio or try Audio-Converter which can be downloaded from the Mac App Store here.

Step Two
Launch Audio-Converter from the Applications folder.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Three
Set the Convert To: dropdown to AAC then set the destination folder to the folder than contains the files we extracted earlier.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Four
Drop the audio file that was extracted from the mkv into Audio-Converter to begin conversion. Note: the audio files will likely be named audio2.ac3 or audio2.dts.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)


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 and save it to the same folder as your extracted video and audio. Double click to extract the archive if need be.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Two
Open a new Terminal window from Applications:Utilities.
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Three
Navigate to the folder your video and audio is located in.
ie. cd ~/Desktop/[mkvextract]video
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Four
Execute the command to create a MP4 video. 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.

ie. ./MP4Box -fps 23.976 -add video1.h264 -add audio2.aac video.mp4
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

Step Five
MP4Box will now combine the video and audio tracks into a mp4 that can be added to iTunes!
How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)

How to Convert H.264 MKV Files to MP4 Without Re-encoding (Mac)
Add Comment
Would you like to be notified when someone replies or adds a new comment?
Yes (All Threads)
Yes (This Thread Only)
No
iClarified Icon
Notifications
Would you like to be notified when we post a new Apple news article or tutorial?
Yes
No
Comments (18)
You must login or register to add a comment...
shriny markiar
shriny markiar - April 25, 2017 at 2:57am
Three steps set all done get best MP4 output, Pavtube MKV converter recognize all audio/subtitles tracks and video streams in a source MKV container file. Users are able to select which wanted audio track, subtitles track, as well as video stream to be kept in the output files. More than that, if your MKV file is generated from a Blu-ray backup with chapter info retained, the updated Pavtube MKV Converter is also able to read all of them, and allows you to check your wanted chapters to convert at will.
SophiaGill
SophiaGill - February 29, 2016 at 6:41pm
iFastime Video Converter Ultimate is just a right H.264 MKV video converter which can fully meet your needs. Why? It can convert all kinds of MKV files including H.264 MKV to MP4. The most advanced feature differing from many other converters is: there is no need for you to know which parameters are suitable for your mobile devices, TV or any media players. Cause our professional video Converter has set ready-made profile as an output format, which concludes all formats compatible with your devices. Even if you’re a complete newbie for technical parameters towards media formats, this software make it easy for you to play any MKV video or any other formats with ease.
freetimed
freetimed - January 16, 2016 at 3:25am
You can use Avdshare Video Converter to Convert MKV to Play MKV in iTunes, iPad, iPhone.
Adma
Adma - March 9, 2015 at 10:38pm
Just look up the app Beamer. This will solve your problems...
Aimee11
Aimee11 - April 9, 2012 at 3:04am
Nice Tips! Yeah, there are many free tools like MKVtools, Mp4 tools can do this works, as I always use Handbrake to convert before read this article. But think I still don't abandon Handbrake as it can do many more works on DVD movies for my Apple TV: http://www.ifunia.com/news/using-appletv-as-new-your-home-media-centre/
Randy
Randy - April 8, 2012 at 10:13pm
Also subler doesn't reencode either. It re-wraps .mkv as mp4s. Most tv shows take under 1 minute to change.
Randy
Randy - April 8, 2012 at 10:10pm
1 on subler. It's like 2 clicks max plus it pulls in tv and movie metadata
iClarified
iClarified - April 8, 2012 at 8:12pm
Please note that this method is not the same as re-encoding with Handbrake and is far faster. i.e. 15 minutes compared to hours. Unfortunately, at the time of writing we were not aware of MP4Tools. After trying MP4Tools we've found it much simpler of course; however, it is noticeably slower than using mp4toolnix and mp4box. Since for most people the simplicity of MP4Tools will outweigh the extra time it takes, we've posted a new 'easier' tutorial here. Thanks for the feedback.
Marcel
Marcel - April 8, 2012 at 7:58pm
With Subler it's much easier :D
Jaime
Jaime - April 8, 2012 at 6:32pm
This is not time effective!
SunLizard
SunLizard - April 8, 2012 at 6:28pm
Wow. I like most of your tutorials, but that is the most horrible time suck I think I've ever tried to accomplish.... To be clear that's 19 steps across 4 programs.... If the intent is to save time, just re-encode the darn thing with Handbrake.... you can't even utilize an Automater tool for the method proposed here...
Dan
Dan - April 8, 2012 at 6:12pm
This following procedure will save you time? By the time I got half way through I converted an Mkv into an mpeg perfectly. This is possibly the most long winded way of doing anything on a computer in 2012.
ToSifjohn
ToSifjohn - April 8, 2012 at 6:09pm
Iphone 4S pls releas 5.1 redsn0w jailbreak
Red
Red - April 8, 2012 at 6:07pm
Nice wall of text. And hell yeah its just a single click
tksbnk
tksbnk - April 8, 2012 at 6:04pm
mkvtools,mp4tools,avitools way better and easy. also free.
Luis Fernando
Luis Fernando - April 8, 2012 at 5:45pm
Ooooooor you could just use Subler. You know it does the same thing but in 2 steps right? And in less than 4 minutes, cause theres also no reencoding..
antoniong
antoniong - April 8, 2012 at 5:38pm
Why going thru all this work instead of simply playing it?
magicgator
magicgator - April 8, 2012 at 5:23pm
MP4tools, much easier option
Recent. Read the latest Apple News.
RECENT
Tutorials. Help is here.
TUTORIALS
Where to Download macOS Monterey
Where to Download macOS Ventura
AppleTV Firmware Download Locations
Where To Download iPad Firmware Files From
Where To Download iPhone Firmware Files From
Deals. Save on Apple devices and accessories.
DEALS