# h.264 MKV to MP4 without transcoding?



## fryke (Jul 22, 2007)

ffmpegx? I haven't really used that program widely and am perplexed.  Is there any way to convert a 720p (HDTV) MKV file to an MP4 (for AppleTV) without the video being transcoded? I mean: Basically, the MKV _should_ contain an industry-standard H.264 stream for the video, no?


----------



## fryke (Jul 22, 2007)

Found a (non-free) solution. Quicktime Pro and Perian FTW.  With QT & Perian 1.x, I can open the .mkv file in Quicktime. Then I export as MPEG-4 (H.264) using "passthrough" (i.e. it doesn't reencode). Should work beautifully. My demo file crashes the AppleTV, though.  ... I think there was something wrong with the MKV-file, though, since it also gives an error message on VLC. I'll try with another to verify.


----------



## Captain Code (Jul 22, 2007)

I've found mkv files are terrible, often audio is out of sync etc.  It's an open source version of H.264 which they claim is better than Apple's implementation and Apple's has some problems.
Playing them on my G5 didn't work so well but on my MBP it worked ok.  Nothing to do with CPU power it just seems VLC on PPC isn't as good.

FFmpegX didn't work for me at all, but I didn't try QT Pro.


----------



## Mikuro (Jul 22, 2007)

Part of the problem is that Apple does not support the full H.264 or MPEG4 standards. Don't ask me why. They've been very slow on implementing advanced features like B-frames. I'm not entirely up to date on this myself, so I don't know exactly what all is currently missing from QuickTime's H.264 implementation, but I'm fairly sure _something_ is. So you can encode video with standards-compliant encoders like x264 and wind up with a non-QT-compatible stream. If you don't use the advanced options, though, QT should play it fine. (Fat lot of good that is to you when you have an already-encoded file, I know...)

It's true that a lot of encoders (mostly Windows-based, I think) really do piss on ths standards, though. I imagine the developers/users just see that it plays in WMP and assume that means it's valid. Also, QuickTime is notoriously non-fault-tolerant.

I think Perian takes control of MPEG4 and H.264 decoding, supporting the full standards, but you probably don't have that installed on your AppleTV (it is supposedly possible, though!). Actually, if you did have Perian installed on your AppleTV, you wouldn't need to convert it to mp4 in the first place. 

Dumping streams from one container to another is rarely as simple as it ought to be. ffmpegX allows you to pass video through from any format to AVI, and VLC allows you to pass video from any format TO any format, but neither of these have great success rates in my experience. *sigh*


----------



## fryke (Jul 23, 2007)

I know that I could install Perian on the AppleTV, but I somehow just don't want to open it up just yet. Also, you can't use iTunes to synch MKVs after installing Perian on the AppleTV, you'd have to use a separate folder... I like the all-in-one-approach of Apple here. (I wish, though, iTunes would simply accept everything QuickTime can play - and AppleTV would accept QT plugins through some interface...)


----------



## Mikuro (Jul 23, 2007)

fryke said:


> (I wish, though, iTunes would simply accept everything QuickTime can play - and AppleTV would accept QT plugins through some interface...)



That would be nice. However, I don't think all QuickTime codecs would work on an AppleTV. The Perian folks had to go out of their way to make it compatible with the AppleTV. My impression is that it's not TOO hard, but most codecs would probably need to be updated. At least the ones dealing with sound.


----------



## pistooli (Jan 16, 2008)

fryke said:


> Found a (non-free) solution. Quicktime Pro and Perian FTW.  With QT & Perian 1.x, I can open the .mkv file in Quicktime. Then I export as MPEG-4 (H.264) using "passthrough" (i.e. it doesn't reencode). Should work beautifully. My demo file crashes the AppleTV, though.  ... I think there was something wrong with the MKV-file, though, since it also gives an error message on VLC. I'll try with another to verify.



"passthrough" export in QuickTime Pro works like a charm... a 720p HD mkv file is converted to Apple TV format in less than 15 mins on a MBP...


----------



## triggs (Dec 11, 2010)

I just found a good solution to this.  The shareware program Playback, which is an excellent Mac media server for (in my case) the PS3.  If you select a directory for streaming that has some MKV files in it, it offers you the option to have them repackaged as MP4 files, without losing any of the resolution.  It worked great on my ripped Blu-Ray discs of Hellboy and Old School, but seems to be crapping out on the Planet Earth series.  Hopefully I'll get that figured out, because this is working great otherwise.


----------



## triggs (Dec 16, 2010)

Video Monkey is another good (free) solution that I recently came across.  It's a beta program, but has been quite stable on my iMac running 10.6.  It only has a handful of Apple devices as presets though.  It's a single developer doing it in his free time, so it's slow to update but works great for me.


----------



## fryke (Dec 17, 2010)

I haven't seen it doing it without re-encoding, though..? Using it all the time. Great VisualHub replacement.


----------



## bmscmoreira (Jan 16, 2011)

Use Subler (http://code.google.com/p/subler/).
Open mkv file, then save as mp4. Should take seconds, no need to re-encode, and it's free and a great application.


----------



## fryke (Jan 18, 2011)

Exactly what I needed, sadly the resulting files don't work with Apple TV most of the time. :/


----------



## bmscmoreira (Jan 18, 2011)

Yes... I sometimes get audio out of sync too. Not a perfect solution, unfortunately...


----------



## ruckerz (Jan 28, 2011)

h264 has a lot of variety in it. Apple TV 2g will only play main profile lvl 3.1 . Many of the mkv's I've found are encoded with High Lvl 4.1 and AppleTV throws it back at you saying it's not playable. (Even though it imports into iTunes, maybe plays on your iMac, but when you airplay it, you get an error). 

Check your files with http://mediainfo.sourceforge.net/en for the video specs.


----------

