Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
First off, MKV is a fecking pain in my ass and whoever came up with it should be hung by his balls.

Ok, now that I got that outta my way, my actual point is this:

A lot of MKV files are H.264 encoded so I was hoping to quickly change them into Apple TV/iTunes compatible files. I've been able to demux an MKV into 2 separate files; ****.h264 (video) and ****.ac3 (audio). Both play fine separately.

Now I need to figure how to mux them into an MP4 container. Does anyone have a clue on how to do this? I've tried the following programs:

ffmpegx (absolutely useless program, very unreliable)
mokgvm2dvd (another useless program... out of my 3 Macs, it ran only on 1 and didn't do anything useful)

So, before anyone tells me to convert, I have. VisualHub makes excellent conversions but I'd like to not convert because re-encoding loses quality and a simple demux->mux or passthrough conversion would be much faster.
 

Jasonbot

macrumors 68020
Aug 15, 2006
2,467
0
The Rainbow Nation RSA
If you have separate video+audio files you shouldnt have a problem using iMovie to put them both in and have them work, shouldnt be too hard. And after that you can make it all pretty and mp4ish by coverting using your converter of choice.
 

killmoms

macrumors 68040
Jun 23, 2003
3,752
55
Durham, NC
First off, MKV is a fecking pain in my ass and whoever came up with it should be hung by his balls.

Ok, now that I got that outta my way, my actual point is this:

A lot of MKV files are H.264 encoded so I was hoping to quickly change them into Apple TV/iTunes compatible files. I've been able to demux an MKV into 2 separate files; ****.h264 (video) and ****.ac3 (audio). Both play fine separately.

Now I need to figure how to mux them into an MP4 container. Does anyone have a clue on how to do this? I've tried the following programs:

ffmpegx (absolutely useless program, very unreliable)
mokgvm2dvd (another useless program... out of my 3 Macs, it ran only on 1 and didn't do anything useful)

So, before anyone tells me to convert, I have. VisualHub makes excellent conversions but I'd like to not convert because re-encoding loses quality and a simple demux->mux or passthrough conversion would be much faster.

Not that I've done it before, but most of the time when I encounter H.264-encoded MKVs they use High Profile H.264, which QuickTime (and thus AppleTV/iPod) won't decode anyway. It's more than likely that to get a file that will play on both your iPod and AppleTV you'll need to convert anyway, since Main is the highest profile that'll work on the AppleTV and Baseline is the highest that'll work on the iPod.

EDIT: Don't have any MKVs to test with, but will QuickTime's "Extract" function work with Perian installed when you open an MKV and look at its properties (Cmd+J)?
 

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
If you have separate video+audio files you shouldnt have a problem using iMovie to put them both in and have them work, shouldnt be too hard. And after that you can make it all pretty and mp4ish by coverting using your converter of choice.

Ok, if you read my post carefully you'd get it.

I already know how to convert. VisualHub does a great job at it. I'm trying *not* to convert.
 

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
Not that I've done it before, but most of the time when I encounter H.264-encoded MKVs they use High Profile H.264, which QuickTime (and thus AppleTV/iPod) won't decode anyway. It's more than likely that to get a file that will play on both your iPod and AppleTV you'll need to convert anyway, since Main is the highest profile that'll work on the AppleTV and Baseline is the highest that'll work on the iPod.

EDIT: Don't have any MKVs to test with, but will QuickTime's "Extract" function work with Perian installed when you open an MKV and look at its properties (Cmd+J)?

Excellent points. I forgot about the profile bits. However, I'll even settle for Leopard's Front Row playback if Quicktime supports High Profile natively or through a codec like x264.

The Extract function does not work in QT with perian...
 

TuckBodi

macrumors 6502
Jan 10, 2007
388
0
Exactly what I said in my post... Please read it more carefully...

Why don't you go to the awkwardtv.org forums and do a little research before you bash on people trying to help you?!? They have a bunch of stuff on the issues with Matroska files and I know nito has been playing with it for his nitoTV plug-in. Never hurts to do a little searching on the web first...
 

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
Why don't you go to the awkwardtv.org forums and do a little research before you bash on people trying to help you?!? They have a bunch of stuff on the issues with Matroska files and I know nito has been playing with it for his nitoTV plug-in. Never hurts to do a little searching on the web first...

Dude, I'm not bashing anyone and I have done my research. There is no information that I find helpful. Everything is about conversions which I do already know about. What makes you think I'm bashing people??

EDIT: And I need my file to be compatible with iTunes so no plugin will do
 

devman

macrumors 65816
Apr 19, 2004
1,242
8
AU
Why don't you go to the awkwardtv.org forums and do a little research before you bash on people trying to help you?!? They have a bunch of stuff on the issues with Matroska files and I know nito has been playing with it for his nitoTV plug-in. Never hurts to do a little searching on the web first...


Wow, I didn't think he was bashing. His post was very clear but a couple of people in this thread do have serious comprehension problems.
 

Westacular

macrumors regular
Oct 9, 2007
120
4
MKV isn't a bad container format; it's just that support for it on the Mac (outside of VLC) isn't that good. The big reason why you see H.264+AC3 rips in MKV containers is MKV does the best job at supporting that combination of codecs.

The MP4 container format does not support AC3 audio. Even if it did, QuickTime/AppleTV/etc won't decode AC3 without plug-ins.

You might be able to get away with converting the AC3 to AAC but keeping the original H.264, and muxing that into an MP4 file, if (as was pointed out) the H.264 stream fits within Apple's particular level of H.264 profile support. Otherwise you're stuck.

An often-recommended program used to create/manipulate mp4 files from raw streams is mp4box, a command line tool. A binary of it is included in ffmpegX but it's probably out of date and, sadly, a quick search doesn't reveal anyone who is making current OS X binaries of that available.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,632
3,987
New Zealand
Try this: Open both files in QuickTime, Copy the video (you may need to select all first), then Add (Edit > Add to Movie) it to the audio. Then do a Save and create a self-contained movie. If this works then it'll generate a .mov, but it may still do what you want.
 

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
MKV isn't a bad container format; it's just that support for it on the Mac (outside of VLC) isn't that good. The big reason why you see H.264+AC3 rips in MKV containers is MKV does the best job at supporting that combination of codecs.

The MP4 container format does not support AC3 audio. Even if it did, QuickTime/AppleTV/etc won't decode AC3 without plug-ins.

You might be able to get away with converting the AC3 to AAC but keeping the original H.264, and muxing that into an MP4 file, if (as was pointed out) the H.264 stream fits within Apple's particular level of H.264 profile support. Otherwise you're stuck.

An often-recommended program used to create/manipulate mp4 files from raw streams is mp4box, a command line tool. A binary of it is included in ffmpegX but it's probably out of date and, sadly, a quick search doesn't reveal anyone who is making current OS X binaries of that available.

Very good points. I found a Mac binary of MP4Box and played around with it but couldn't get any proper results. You're absolutely right about AC3. I'd need to convert it to AAC first. Seems like it's too much of a hassle. Until MKV gets better support on our platform, I think I'll stick to simple and easy conversions.
 

MacinJosh

macrumors 6502a
Original poster
Jan 29, 2006
676
55
Finland
Try this: Open both files in QuickTime, Copy the video (you may need to select all first), then Add (Edit > Add to Movie) it to the audio. Then do a Save and create a self-contained movie. If this works then it'll generate a .mov, but it may still do what you want.

QT doesn't want to open the video for some reason even though I've got a bunch of different h.264 codecs installed. I need to figure out how. Thanks for the tip though. I might give up on the issue though. Too big of a hassle for the gains.
 

devman

macrumors 65816
Apr 19, 2004
1,242
8
AU
QT doesn't want to open the video for some reason even though I've got a bunch of different h.264 codecs installed. I need to figure out how. Thanks for the tip though. I might give up on the issue though. Too big of a hassle for the gains.

Yep, you've got little hope with streamclip and qt not recognising the video. As for AC3, there is the a52codec plugin http://trac.cod3r.com/a52codec

Or you convert to AAC5.1.
 

traderx1

macrumors member
Mar 22, 2007
52
0
MKV isn't a bad container format; it's just that support for it on the Mac (outside of VLC) isn't that good. QUOTE]

You are 100% correct. Apple support of other codecs is rather limited through quicktime/itunes. In fact this was issue back with divx/xvid. Now with .mkv growing significantly with the all these new HDDVD/Bluray, it is even more troublesome for us Mac users. VLC and Perian work great, but on your mac. If you are like me, you like to watch TV on your plasma/lcd and/or your computer may be in another room.

So I went and bought AppleTV on day 1. I do love it, but it has its problems, in the video department, meaning lack of codec supportand AC3 support. I have searched and searched for ways to play my .mkv files but with no luck. So I started using Visual Hub and converted my movies. This was somewhat time comsuming, although I just set it at night and go to bed. A single pass .mkv file around 4.5 gigs would take 1hr on a MacPro, and 2 pass was over 2 hrs. So it can take some time. And yes, by doing this you are not really doing a 1:1 conversion, there is compression using the format. The quality was still very good on my 50inch Plasma. But it was missing something the audio. The AppleTV converted files played is Dolby Prologic II. This is not good enough for me and probably not others. Half the fun in a movie are the sound effects.

So what did I do. I dumped my AppleTV for video purposes, and use for music only. And it is absolutely fantastic at that. I bought a TViX 4100sh (google it) which has native .mkv support with Dolby Digital and DTS. And it is working great. No more conversions, full audio support, and a big hard drive. No the user interface does not come close to AppleTV. But for purely watching video it does a great job and saves me some hassle also.

No this will not help you solve your problem with AppleTV but for those who are looking for ways to wathc .mkv, xvid, divx files...here is another alternative.

hopes this helps some people, although not the original poster.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,632
3,987
New Zealand
QT doesn't want to open the video for some reason even though I've got a bunch of different h.264 codecs installed. I need to figure out how. Thanks for the tip though. I might give up on the issue though. Too big of a hassle for the gains.

If QT won't recognise it now then it most likely still won't once you've put the video into a different container :(
 

infolc

macrumors newbie
Oct 10, 2007
4
0
France
You can use imkvextract to demux (=extract audio and video from) the mkv file. You'll end up with a h.264 file (video) and an audio file (ac3, mp3...). This process is painless and fast. It doesnt reencode or transcode anything. After that you'll have to mux these two files into one container (through mp4box) that's compatible with your software/hardware (mp4, avi...). reencoding the audio to another format like aac before muxing it isnt a problem. check the command line for mp4box, it's fairly simple.

i doubt it'll run with crossover for (intel only) mac but windows user say "gotsent" works great and automates the process entirely!!!

One last word, transcoding to mp4 (h.264) with visualhub for instance is a long, very long process but you wont lose much quality at the end... i just wonder whether it's necessary when you can just demux/mux.
 

Nermal

Moderator
Staff member
Dec 7, 2002
20,632
3,987
New Zealand
You can use imkvextract to demux (=extract audio and video from) the mkv file. You'll end up with a h.264 file (video) and an audio file (ac3, mp3...). This process is painless and fast. It doesnt reencode or transcode anything.

In his first post he says that he's already done that.
 

billabong

macrumors 6502
Jan 7, 2004
397
0
I've tried what you want to do before, and it's a hastle. They never seem to either play on the Apple TV or whatever, so I caved in to Visual Hub.. It's the best thing I have done, don't waste your time trying no mux remux and all that crap. Just get visual hub, it's fast, easy, and the files always work.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.