MKV vs MP4 (M4v)

Discussion in 'Home Theater PCs' started by Charlie98, Jan 15, 2013.

  1. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,818
    Likes Received:
    0
    I'm hoping I didn't just screw the pooch for the past 6 months... D:

    I've been ripping all my DVD's (using AnyDVD to break them, Handbrake to encode them) the past 6 months or so in preparation for my HTPC build. I've been ripping them to .MP4 format. What are the main differences in MP4 vs MKV? Am I giving anything up in quality? Am I missing any sort of audio or subtitle features?

    By and large, I've been using Handbrake at default... I bump the video quality up a little (CQ: 17.5) and importing subtitles if I know they are in the movie.

    I'm fixing to start ripping my BR disks, I think I have to go to MKV for those, correct?
     
  2. thestrangebrew1

    thestrangebrew1 Platinum Member

    Joined:
    Dec 7, 2011
    Messages:
    2,104
    Likes Received:
    1
    I don't know if there's a substantial difference in quality between the two. I've always ripped my files to mp4 prior to getting my htpc up and running. For whatever reason, my ps3 wouldn't stream mkvs and pretty much any file over 5Gb. Mp4 seemed to fix this issue so I just used that format. Now that I have an htpc to watch media, I just continue to use mp4 as the preferred format. For BR, I use Make MKV, it's an awesome software that I've been able to throw any movie at to encode to mkv. Then, I use Ripbot to encode them to mp4. I was using Handbrake, but lately been using Ripbot.
     
  3. LoveMachine

    LoveMachine Senior member

    Joined:
    May 8, 2012
    Messages:
    477
    Likes Received:
    1
    Using Handbrake exclusively (+AnyDVD) for a few years, and comparing mkv to mp4 I really don't see any quality difference. There may be theoretical differences, but to my eyes and ears, I can't tell. I stream movies to an AppleTV, which requires mp4, so that's my default format. WMC requires a plugin or two to play mkv's, but XBMC (used for all my real theater watching) could care less. I do find that mp4s generally take a bit less space vs. an equivalent quality mkv. Handbrake will let you transcode one to another if you ever needed to and will do so very quickly, but there obviously won't be any increase in quality from a transcode.

    Also, regarding Handbrake for bluray codes, there was no appreciable difference visually with a quality setting of 20 vs. 17 that I could see, and it results in a much smaller file. But I do usually set DVDs for 17.
     
  4. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    let's take a step back here.

    when you encode a video, you use a video compression codec, and an audio compression codec.

    then after its done, you stick both parts (or more, such as subtitles), into a container.

    in this case, .mp4, .m4v, and .mkv are ALL containers.

    typically, you will encode videos using the h.264 codec. the raw file created (container-less) is typically in a .h264 "file".

    most players can't play "raw" files. so you have to stick them in a container.

    you can always extract raw video from containers.

    knowing all this, you can easily go back and forth between .mp4 container and .mkv container, because you would just extract the underlying video (demuxing) into .h264 raw video and change containers (remuxing)

    (note: renaming a file from .mp4 to .mkv is not the same thing as "changing" containers - you have to use a program to do that)
     
  5. thestrangebrew1

    thestrangebrew1 Platinum Member

    Joined:
    Dec 7, 2011
    Messages:
    2,104
    Likes Received:
    1
    This makes sense. I was going to mention that they were containers, but couldn't word it properly, and you did a fine job. I guess the OPs question should be, since the raw file is h264, is there a difference in quality between the containers? Any advantages/disadvantages between them?
     
  6. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    .mp4
    - more widely used/universal
    - can't use dts 5.1 sound (i think, or something like that)

    .mkv
    - can "mux" (combine) multiple video files (multiple aspect ratios) / audio files (multiple languanges) / subtitles (multiple languages) / chapters file
    - not widely accepted

    if i have a simple file (say, a "simple" 1080p movie), i'd tend to just use .mp4 because that one file can (most likely) be played with native support in an iphone/ipod/ipad/ps3/itunes/windows 7/etc...

    if i had a more complicated file (say, a 1080p movie w/ chapter support, 2ch stereo audio, 5.1 audio, 5.1 audio w/ commentary), then you'd have no choice but to use .mkv (and only be limited to a set amount of players that know how to access each audio file)
     
  7. LoveMachine

    LoveMachine Senior member

    Joined:
    May 8, 2012
    Messages:
    477
    Likes Received:
    1
    mp4 CAN do 5.1 audio etc., it's just that many players like roku, and software like WMC, only uses the first 2 channel audio track. All of my mp4 files encoded with a Handbrake use a preset that has a second 5.1 Dolby Digital track, and blurays add a third with DTS HD-MA (assuming it's a modern movie with such audio available). HB let's you select which audio tracks/language/subtitles you want. It's all in how you mux it. The tricky part is what the player will choose to recognize, hence why I use XMBC.
     
  8. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,818
    Likes Received:
    0
    Akumax, that makes sense (along with what you others are saying.) My brain still has a problem wrapping around all this computer file stuff... the way he put it, makes sense now... and I never thought about using HB to convert it to .MKV if I needed to.

    I have a few movies that I like to listen to the commentary on, things like that, and I'll probably just throw the disk in for that. I've pretty much narrowed it down to WMC/MB and XBMC... I'm in the process of renaming all my files so the artwork will show up properly, too. I wish I would have gotten Assassin's guide earlier rather than later... :(

    This is all going through a very old Denon 2-channel amp and into my very old 2-way speakers, so I'm not worried about 5.1, etc right now... but that is something to think about now while I'm encoding all this stuff...
     
    #8 Charlie98, Jan 16, 2013
    Last edited: Jan 16, 2013
  9. thestrangebrew1

    thestrangebrew1 Platinum Member

    Joined:
    Dec 7, 2011
    Messages:
    2,104
    Likes Received:
    1
    I'm loving how xbmc handles my files right now. I haven't tried WMC since I'm not doing any PVR or anything like that. But I'm interested in trying out JRiver.
     
  10. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,818
    Likes Received:
    0
    Originally I had hoped to go with XBMC, but my W7 media remote (Rosewill) isn't fully functional with XBMC.

    Once I get WMC up and running at the least, I'll work with XBMC to see if I like it better.
     
  11. thestrangebrew1

    thestrangebrew1 Platinum Member

    Joined:
    Dec 7, 2011
    Messages:
    2,104
    Likes Received:
    1
    There's guides on how to get the WMC remote to work with XBMC. For the most part, I was able to get it to work except for being able to launch XBMC with the green windows button instead of it launching WMC. I wasn't successful with it but maybe you'll have better luck. Just google WMC remote with XBMC or something similar and you should get a bunch of hits and guides.
     
  12. AnitaPeterson

    AnitaPeterson Diamond Member

    Joined:
    Apr 24, 2001
    Messages:
    5,511
    Likes Received:
    1
    To each his own.
    For the very reasons you mentioned above, I'd take mkv any time.
    I'm one of those who appreciates commentaries and extras.
    And I couldn't care less about standalone players. Any HTPC will run circles around any dedicated media player (no matter who makes it), from both the quality and codec support points of view.
     
    #12 AnitaPeterson, Jan 17, 2013
    Last edited: Jan 18, 2013
  13. Dirigible

    Dirigible Diamond Member

    Joined:
    Apr 26, 2006
    Messages:
    5,935
    Likes Received:
    3
    About three years ago or so I used eventghost to make my remote do what I want.

    Nowadays there are xbmc remote apps for at least some smartphones.
     
  14. Mark R

    Mark R Diamond Member

    Joined:
    Oct 9, 1999
    Messages:
    8,496
    Likes Received:
    0
    As has been said, both MP4 and MKV are container formats.

    MKV is more flexible - it is designed to accept virtually any video and audio compression CODECs, supports embedded subtitles in numerous formats, allows attached metadata such as chapter information, etc.

    MP4 is limited only to MPEG4 audio and video. In practice, this mean that you can use H264 video, and AAC audio only. DTS and AC3 audio CODECs are not officially supported, neither are MP3, etc. Some programs may allow you to create MP4 files with DTS/AC3 audio, and some programs/devices may even play them, but these files are not standards compliant and not guaranteed to be playable. MP4 also doesn't support metadata like chapters, etc.
     
  15. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    HTPC here too :p Although I am toying with the idea of an Android on a Stick.. as soon as they make streaming .iso's more robust...

    Most of my stuff is mkv, and I'm trying to come up with a streamline way of demuxing/remuxing from mkv to mp4 to give those files away easier.

    For example, I have the entire Pixar collection, both on .mkv (for all the extras), and .mp4 (for straight movie/single audio). easier to transport and give to family members to stick on their ipads and such for their kids on road trips :)

    ----

    Thanks for your input. I thought that .mp4 could support chapters, but guess not. Also reminded me that .mp4 can't "officially" mux .ac3 and .mp3, so you'd have to convert those to .aac for sure :)
     
  16. Zxian

    Zxian Senior member

    Joined:
    May 26, 2011
    Messages:
    579
    Likes Received:
    0
    Figured I'd stop you here before you trip yourself over this.

    Handbrake does two tasks for you.
    1) It encodes the video using the x264 codec (and audio too? I don't use it so I don't know)
    2) It puts all the media streams (video, audio, subtitles) into an mp4 or mkv container

    If you have a video file that is currently in an mp4 container, you can very easily remux (not reencode) that video into an MKV container using MKVMerge GUI. This process takes all of ~2 minutes - basically as fast as your hard drives can read and write the data.


    Think of all of your media in terms of the codec and container separately. An MKV file can contain just about anything - video, audio, pictures, documents, etc etc etc. What codec (or format) those parts are stored in is a separate question.

    Personally, I use MKV for everything these days. MP4 is too restrictive of a format IMO. The more support there is for MKV, the better the all-in-one devices will be. The format is completely open-source as well, so there's very little concern with licensing to boot.
     
  17. thestrangebrew1

    thestrangebrew1 Platinum Member

    Joined:
    Dec 7, 2011
    Messages:
    2,104
    Likes Received:
    1
    This makes sense. I'd much rather have my files in mkv vs mp4, but when I first got started with streaming, I was having problems streaming mkvs with Plex. Been using mp4 for the last year. Maybe it's time to revisit this issue.
     
  18. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    most likely it's not the mkv or mp4 file, but the video encoding behind it (the h264 video) that was the problem

    typically when 'those release groups ;)' release stuff, if its a small file size but still 1080p, they chose a really aggressive algorithm for compression while maintaining quality (example: h264 - high profile @ 5.1).
    this may or may not cause issues for streaming though.. also they happen to choose mkv more often than not (due to chapter support, etc..)

    since mp4's are typically 'simpler', theyre also typically encoded more 'simply' due to compatibility with more devices (example: h264 - main profile @ 4.0, which is practically universal with iOS devices past 2010, like iphone 4, ipod 4, ipad, etc..)

    you could stick that high@5.1 video in an mp4, and possibly get streaming problems, or stick that main@4.0 in an mkv, and have it stream fine. we'd have to figure out what you did though :)
     
  19. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,818
    Likes Received:
    0
    ...oh, boy...
     
  20. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    any questions? :p
     
  21. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,818
    Likes Received:
    0
    Well... I tried ripping a test BD to MP4... not only was the file size something like 16GB, it was unplayable, locked my computer up and finally BSOD'ed.

    I ripped it to MKV... much smaller file and it plays on VLC, so that's some progress.
     
  22. Zxian

    Zxian Senior member

    Joined:
    May 26, 2011
    Messages:
    579
    Likes Received:
    0
    An unencoded BluRay movie will be large. 16GB is pretty small by my standards. :p

    Watching videos shouldn't cause your system to crash - I'm wondering if something else is going on.

    As a baseline - let's make sure we're on the same page for playback. You can either use VLC, or install the LAV Filters and MPC-HC. Either of those options will play just about any file you throw at them. Make sure that you've uninstalled any other "codec packs" that you have installed - you don't need them.

    What are you using to rip the videos? I'd suggest installing MakeMKV for now to get the content off your discs. MakeMKV is a very simple program that will take the raw data from your DVDs or BluRays, strip any content protection, and store the streams in an MKV file. Note: you'll have to disable AnyDVD while using it - the two don't play nicely together. The output file will be large. For reference, my Gladiator extended edition comes in at ~35GB for just the video and a single English audio track.

    Once you've got that file on your system, you should be able to play it using VLC or MPC-HC. If you've managed to cross this milestone, then we can worry about re-encoding the video to save some disk space and make it possible to play back on multiple devices. :)
     
  23. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2

    Is this on Windows?

    What encoders are you using?

    How long does it take to encode each video to each format?

    --

    With those answers, it still seems that you don't understand what the difference between .mkv and .mp4 is. The whole point is:

    1) Using a program, I could take the video portion of the resulting .mkv, and stick it inside a .mp4. File size will be the same as the original (small), and playback will be the same (playable). The entire process of doing this would only take a few seconds.

    2) Using a program, I could take the video portion of the resulting .mp4, and stick it inside a .mkv. File size will be the same as the original (large), and playback will be the same (unplayable). The process should take a few seconds. The entire process of doing this would only take a few seconds.

    With either 1) or 2), I am NOT encoding the video. I am just changing the file type to each respective one.
     
  24. Zxian

    Zxian Senior member

    Joined:
    May 26, 2011
    Messages:
    579
    Likes Received:
    0
    My guess is that he's using Handbrake to "rip" the videos, and it's doing several things at once making the whole process more confusing in the end. That's why I suggested he simply rip the raw video to MKV format.
     
  25. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,639
    Likes Received:
    2
    Anyone know if there's a big difference between Handbrake for Win and OSX?