MKV -> MP4 without conversion?

Discussion in 'Apple TV and Home Theater' started by MacinJosh, Oct 9, 2007.

  1. macrumors 6502a

    #1
    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.
     
  2. macrumors 65816

    devman

    #2
    I *think* mpegstreamclip will mux these for you if the filenames are the same - but I've never tried this myself. http://www.squared5.com/
     
  3. macrumors 68020

    Jasonbot

    #3
    You could always use snapzXpro to take a video snapshot of the clip. its really rural but it should work.
     
  4. macrumors 68000

    speakerwizard

    #4
    dunno about extracting the video but visual hub will convert
     
  5. macrumors 6502a

    #5
    Exactly what I said in my post... Please read it more carefully...
     
  6. macrumors 68020

    Jasonbot

    #6
    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.
     
  7. macrumors 68040

    killmoms

    #7
    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)?
     
  8. macrumors 6502a

    #8
    I don't understand... What's the point of that?
     
  9. macrumors 6502a

    #9
    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.
     
  10. macrumors 6502a

    #10
    Good idea but I can't get Streamclip to recognize the video part...
     
  11. macrumors 6502a

    #11
    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...
     
  12. macrumors 6502

    #12
    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...
     
  13. macrumors 6502a

    #13
    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
     
  14. macrumors 65816

    devman

    #14

    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.
     
  15. macrumors regular

    #15
    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.
     
  16. Moderator

    Nermal

    Staff Member

    #16
    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.
     
  17. macrumors 6502a

    #17
    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.
     
  18. macrumors 6502a

    #18
    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.
     
  19. macrumors 65816

    devman

    #19
    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.
     
  20. macrumors member

    #20
     
  21. Moderator

    Nermal

    Staff Member

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

    #22
    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.
     
  23. Moderator

    Nermal

    Staff Member

    #23
    In his first post he says that he's already done that.
     
  24. macrumors newbie

    #24
    the missing part... :)

    i should add that to reencode audio, "max" works great!
     
  25. macrumors 6502

    #25
    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.
     

Share This Page