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,808
    Likes Received:
    0
    Yes, I am... AnyDVD to break it, Handbrake to.... what? Encode it? And, yes, I'm in Win7.

    I don't want to spend just a whole bunch of effort on BD's... I only have about 10 of them. I wasn't all that wow'ed with BD playback on the stand-alone LG player we have, and the disks themselves are quite fragile. We ruined our original copy of Star Trek already.... :mad: (I think the darned player scuffed it up,) so we aren't even buying BD any longer.

    The other downside is the file size based on what I've seen (and Zxian confirms... 35GB for one movie!?!?) I don't have that kind of storage.

    I have or had MPC-HC already, but never really used it for anything... never needed to.
     
  2. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,632
    Likes Received:
    0
    Already ripped? Good.. good..

    Personally, I use MeGUI to do everything. However, there is a bit of a learning curve.

    Recently, I've had very good luck with XMedia Recode, however. This might suite you better.
    http://www.videohelp.com/tools/XMedia-Recode
     
  3. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,808
    Likes Received:
    0
    Hmmm... maybe I am missing something, re: ripping to BD. What I've done so far, with success, is use AnyDVD to break the disk, and then use Handbrake to encode (if that's the correct word) the disk to MKV. I can play the MKV file with VLC but not WMC/MB.

    I would like to be able to play my BR file with WMC/MB... what you are saying (I think) is I can use XMedia or MeGUI (or Handbrake?) to remux it into a MP4 format (container) so I can play it with WMC and the file size won't be astronomical?
     
  4. Zxian

    Zxian Senior member

    Joined:
    May 26, 2011
    Messages:
    579
    Likes Received:
    0
    You're partially right. AnyDVD has been breaking the copy protection. Handbrake has been encoding the video using an h.264 codec. Handbrake has then muxed the video (h.264) and audio (dts/aac/whatever) streams into an mkv file.

    If you want to use MKV files in WMC, all you need to do is apply the registry entries that are found in the following link. This will make MKV files discoverable in WMC.

    http://www.hack7mc.com/2009/02/mkvs-for-minimalists-on-windows-7.html

    Don't bother with installing FFDShow or Gabest - just use the LAV Filters I mentioned eariler. They're simpler to setup.

    I personally wouldn't bother with mp4 files for anything other than iDevices. The format is far more restrictive regarding what you can put into it. MKV files can contain anything. As long as you have the right filters installed to decode whatever streams come out of that file, it'll just work.


    Ripping from a DVD is, conceptually, no different than BluRay. The source video and audio are usually re-encoded, and then muxed into a container. The only real difference is the number of pixels in each video frame. :)
     
    #29 Zxian, Jan 22, 2013
    Last edited: Jan 22, 2013
  5. AkumaX

    AkumaX Lifer

    Joined:
    Apr 20, 2000
    Messages:
    12,632
    Likes Received:
    0
    Yah, you're right. To put it simply:

    AnyDVD to break the disc, and copy to hard drive - I refer to this as "ripping".
    Now you have a giant 30GB-45GB BluRay structure on your hard drive. You want to compress it to a smaller file size, just the main movie portion, and possibly remove any extras (such as extra audio)
    So you could use HandBrake, XMedia, or MeGUI to do that.
    Also, HandBrake, XMedia, and MeGUI will stick that final video/audio file, and mux the video/audio into an .mkv or .mp4 container.

    I downloaded HandBrake, and couldn't figure out how to "change containers". I did see however, that you can choose either .mp4 or .mkv as a final container.

    I check XMedia. I could open my .mkv, and chose, say, some Apple preset. I was able to choose "Video Copy" instead of "Convert", so that it'll just take the underlying video stream and copy it directly into the final container (.mp4). However, I couldn't figure out how to "Audio Copy", it would want to re-encode the audio as well.

    I was able to use MeGUI to: extract the raw video and raw audio from the .mkv, and then remux them back into an .mp4 (straight source copies, no encoding/converting involved), no increase in file sizes, etc...

    ------

    It's funny that you think mp4 files are 'restrictive'. They are there to (somewhat) preserve compatibility between all types of media players. I think the fact that .mkv's can contain anything is why it's so problematic between players. Until .mkv's take off, .mp4's going to be here for a while.
     
  6. lifestorie11

    lifestorie11 Senior member

    Joined:
    Jan 20, 2009
    Messages:
    290
    Likes Received:
    0
    They are very similar just a little different looking. But both do the same thing obviously. ^_^
     
  7. ctbrowncoat

    ctbrowncoat Junior Member

    Joined:
    Dec 24, 2013
    Messages:
    1
    Likes Received:
    0
    Hey Zxian, not sure if you're still following this thread... can you share your thoughts on that last point? RE-encoding an MKV video to save space? I'm using Plex Media Server and a Blu-ray rip from MakeMKV is usually in the 20-30GB file. Huge! Using Handbrake to re-encode it to 720 or 1080 tends to save space, but one movie takes like 12 hours to re-encode! (Unless I'm doing something horribly wrong.) Any other suggestions for making those huge, raw MKV rips smaller while maintaining high quality for use by Plex?

    THANKS in advance!
     
  8. smitbret

    smitbret Diamond Member

    Joined:
    Jul 27, 2006
    Messages:
    3,289
    Likes Received:
    0
    I know I'm not the guy that you specifically asked for but I can answer your question.... kind of.

    "Quality" is a subjective thing and is also influenced by things like screen size and distance you sit from the screen. Any time you re encode, you are going to lose some quality, there's no way around it. The smaller you make the file, the lower the quality.

    Re-encoding a movie can take anywhere from 1 hour to 20 hours depending on the settings you use. The faster the encode, the lower the quality. Keep in mind that nothing replaces file size and bitrate. No matter how good your settings or how long the encode took, a 5GB will not have anywhere near the quality of a 20GB rip. But you can make perceivable difference with the settings where one 5GB file looks much better than another 5GB file.

    Only you can decide the quality you require. I can offer suggestions and settings that I use, but basically, it's an art.
     
  9. mindbomb

    mindbomb Senior member

    Joined:
    May 30, 2013
    Messages:
    364
    Likes Received:
    0
    mp4 is better for compatibility, but limited in terms of audio, only stereo AAC.
    mkv can do 7.1 flac if you wanted.
     
  10. SlitheryDee

    SlitheryDee Lifer

    Joined:
    Feb 2, 2005
    Messages:
    17,160
    Likes Received:
    6
    I would think there would be zero difference as far as quality. The streams that go into both containers are the same. You can always extract the streams and recombine them if you want to change containers. I primarily use mkv files, but I guess mp4 would have better compatibility. At least I've noticed more devices that support it out of the box.
     
  11. mindbomb

    mindbomb Senior member

    Joined:
    May 30, 2013
    Messages:
    364
    Likes Received:
    0
    i forgot subtitles. if you use mp4, you have to use text subtitles. Which means you have to ocr subs. with mkv, you can just put in the bluray subs and call it a day.
     
  12. Anteaus

    Anteaus Platinum Member

    Joined:
    Oct 28, 2010
    Messages:
    2,388
    Likes Received:
    1
    A more abrupt way to view it is to say that using .MKV is lossless (relative to the source, it isn't true lossless when compared to the masters) and .MP4 (H.264, specifically) is Lossy. If you want to maintain the original quality of the source media, then .MKV is preferable. If you don't mind a drop in fidelity, whether it be noticeable or not, then H.264 is preferable. I should preface this by saying that most recent releases on Blu-ray are already h.264 and technically lossy and you are simply using handbrake to re-encode it to reduce file size.

    Ultimately, the deciding factor is space. In an ideal world, we would all use .MKV.

    OP, you didn't make a bad decision using Handbrake if you are happy with the results. That said, if you are looking to create "reference" level copies of your media, then you might need to rethink it. Just remember that you will need to prepare for an extraordinary increase in storage needs. For comparison, the average Blu-ray release is 25-35 GB just for the film, excluding extras. Handbrake can get that down to 4-8GB in many cases with little loss in relative fidelity. So, in short, a "handbraked" collection will have 1/4 to 1/3 of the storage requirements of .MKV. Trust me when I say, it will add up very quickly.
     
    #37 Anteaus, Dec 25, 2013
    Last edited: Dec 25, 2013
  13. smitbret

    smitbret Diamond Member

    Joined:
    Jul 27, 2006
    Messages:
    3,289
    Likes Received:
    0
    Um, no offense, but this is quite possibly the most incorrect information posted on the internet.

    .mkv or .mp4 have 0% influence on quality. The only difference is the type of streams you can put into them and the type of devices that will play them back.

    Also, comparing .h264 to .mkv is like comparing an engine to a completed car. Not only that, but the vast majority of .mkv files contain an .h264 video stream.
     
  14. LoveMachine

    LoveMachine Senior member

    Joined:
    May 8, 2012
    Messages:
    474
    Likes Received:
    0
    Yep. MP4 and MKV are just containers. Both can hold the same types of information, neither has a significant effect on final file size, nor quality of video/audio. I have tons of 1080p mutichannel DTS-HD MA pgs subtitled MP4s that play on XBMC just as well as MKVs at the same size. If I remember correctly, MP4s don't hold chapter information, but otherwise, they hold the same info that MKVs can. It's just that certain gadgets (Apple, first and foremost) don't support MKVs, my guess being their reputation as files created from not-quite-legal means.
     
  15. mindbomb

    mindbomb Senior member

    Joined:
    May 30, 2013
    Messages:
    364
    Likes Received:
    0
    An mp4 file should always be h264 video, stereo aac audio, with the option for text subtitles. I'm not sure if there exists software to mux dts and pgs into an mp4, or why there would be, nor would I expect a player to actually play it. And in a broader sense, why would you put incompatible audio/subs in a container whose sole advantage is compatibility. There would be no point to having the file be an mp4 at that point.
     
  16. LoveMachine

    LoveMachine Senior member

    Joined:
    May 8, 2012
    Messages:
    474
    Likes Received:
    0
    Because my AppleTV2 doesn't play MKVs. I rip my movies (DVD/BR), convert them using Handbrake to MP4 so that the ATV can see them upstairs for the kids. Down in the ManCave, I can watch the same file, using XBMC, with DTS-HD MA, pgs subtitles, the full shebangabang. I don't get why I'm being told MP4s don't carry anything better than stereo AAC, when in fact my AVR is lighting up with the appropriate codec indicator and I'm hearing lovely 7.1 audio.
     
  17. LoveMachine

    LoveMachine Senior member

    Joined:
    May 8, 2012
    Messages:
    474
    Likes Received:
    0
    And to clarify, Handbrake allows you to add multiple tracks. The ATV2 preset puts in the first track as stereo aac for compatibility with everything, then adds a second track that, in my case, can be up to 7.1 FLAC that can be played on more advanced devices or HTPC software. So, a question for your question, Mindbomb. Why should I have 2 files for the same movie (MP4 for the ATV2, MKV for the others) when a single properly muxed MP4 can do it all?

    And finally, ZOMBIE THREAD...I'd be happy to let this 'un die.
     
  18. mindbomb

    mindbomb Senior member

    Joined:
    May 30, 2013
    Messages:
    364
    Likes Received:
    0
    Well, that is a clever solution, but that is a unique problem. In general, you use mkv because it is incredibly flexible. You use mp4 because of it's compatibility. The compatibility benefit is only obtained if you use the prototypical mp4 video,audio, and subs.
     
  19. smitbret

    smitbret Diamond Member

    Joined:
    Jul 27, 2006
    Messages:
    3,289
    Likes Received:
    0
    This.

    Back when I was ripping for my PS3, I converted my DVD rips to .mp4. It would have a Level 4.1 .h264 with a 2-channel DPLII .aac track for the first audio track and Pass thru the DTS stream as audio track 2. That way it was compatible with just about any device and if I really wanted the DTS track I could take 3 minutes to remux with MKVToolnix or just use a device that would play back the 2nd audio track in .mp4.
     
  20. powerhouse65

    powerhouse65 Junior Member

    Joined:
    Dec 29, 2013
    Messages:
    24
    Likes Received:
    0
    I'm using Handbrake (on a Linux rig) to rip/encode DVDs, and occasionally BR. I noticed different settings as to the kind of material I'm encoding - like cartoons, movies, etc. What are your recommendations, also with regard to quality settings?

    I'm viewing on a 45" TV, distance ~7-10 feet / 2-3m, using XBMC. So far I've been impressed with BR rips ~4-5GB @1080p.

    So, what are your suggestions re 1080p, 720p, and regular DVD rips with HB?

    P.S.: Computing power/encoding time is not (yet) an obstacle.
     
  21. smitbret

    smitbret Diamond Member

    Joined:
    Jul 27, 2006
    Messages:
    3,289
    Likes Received:
    0
    At that seating distance, I wouldn't use 720p unless I had plans to use the same video file with a larger TV in the near future, in which case you may want the added file size for 1080p. 720p will save a lot of space and for most movies it won't affect how much you enjoy it, the perceived difference is not much if it is a good encode.

    With Blu-Ray rips, I always set the frame rate as constant with "Same as Source" since I will occasionally run into a device that struggles with Variable Frame Rates

    I will either set the RF for 18 or I will do a 2-Pass with Turbo selected and a bitrate of 2200-3000 depending on how busy the images are or how much action is in the film. If I chose 1080p instead of 720p, I will run 5500-6500 depending on source material. That usually gets me a 720p file that is 3.5-5GB and a 1080p that is 6-8GB. I use the Advanced Tabs instead of the simple settings on this screen.

    My audio selections will depend on my container, although, lately I have been just doing an Audio #1 of 2-channel .aac with DPLII @ 160kbps and also passing through the highest quality track for Audio #2.

    Subtitles and chapters are completely up to you and your personal taste. If I feel like I need to burn forced subtitles into the movie, I actually use RipBot264 instead of Handbrake because it just seems to handle different subtitle formatting better.

    Advanced Tab
    Ref Frames 4 - There are some devices like the Sony PS3 that won't support more than that
    B-Frames 3 - I hate b-frames because if you don't give enough bitrate to the movie they seem to cause blocks and splotched in the dark areas/shadows. I would use less if I could, but I never use more.

    Adaptive B-Frames - Automatic
    Adaptive Direct Mode - Optimal
    Motion Est Method - UMH
    Subpixel Motion Est - 10
    Trellis - Always

    And I pretty much leave everything else alone.

    With a mid range CPU like an FX6100 or Phenom II 955 x 4, a 2-pass 1080p will take about 14-20 hours. One pass RF at 18 will take about 8-12.

    With simple animation, you could be able to drop the bitrate and save file size if you set it to more reference frames. Some people will encode 8-10 reference frames but that just slows your encode to a crawl for an increase of less than 1% in quality. It really is diminishing returns and after about the 3rd it really narrows quickly.
     
  22. powerhouse65

    powerhouse65 Junior Member

    Joined:
    Dec 29, 2013
    Messages:
    24
    Likes Received:
    0
    @smitbret: 1000 thanks to you - your explanations are perfect, just what I was looking for. I really appreciate it. Your post has been bookmarked.
     
  23. Mazza

    Mazza Junior Member

    Joined:
    Mar 30, 2001
    Messages:
    9
    Likes Received:
    0
    It's surprising how many people have this misconception. I recently encoded something and put it on HDBits. It just so happened to be in the .mp4 container with x264 and 2.0 AAC. Somebody commented that I should "encode to mkv not mp4".

    I had to state the same thing as you to dispel the ignorance.
     
  24. Charlie98

    Charlie98 Diamond Member

    Joined:
    Nov 6, 2011
    Messages:
    5,808
    Likes Received:
    0
    Does 2-pass really make a difference? I've never tried it...
     
  25. smitbret

    smitbret Diamond Member

    Joined:
    Jul 27, 2006
    Messages:
    3,289
    Likes Received:
    0
    2-pass is useful if you have a specific size in mind but don't want to get stuck with a constant bitrate. Otherwise, just set the RF and go.