INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Compressing MKV Files  (Read 2115 times)

Quarterwave

  • Regular Member
  • Recent member
  • *
  • Posts: 21
Compressing MKV Files
« on: May 13, 2019, 08:04:12 pm »

Hi,

On the recommendation of some fellow MC25 users, I'm using "MakeMKV" to rip files from Bluray's I have purchased.

However, the file sizes are huge (20gb for some files).

What programs/options are available to reduce these file sizes to more-manageable sizes?
Logged
Basic Win 7 machine.

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Compressing MKV Files
« Reply #1 on: May 13, 2019, 11:22:55 pm »

MakeMKV is the best way to rip your BluRays if you want a full-resolution, lossless copy.  That's what you have; it's identical to watching it directly from the disc.

If you want to make the file smaller, now you're talking about re-encoding using lossy compression.  You will get a smaller file, but you'll lose information and some quality.  How much quality is up to you, based on the settings you choose when re-encoding.

I would recommend Handbrake.  It does a good job of re-encoding files, is pretty easy to use, and it's free.  It also has options for if you want to further strip down the movie, such as remixing the lossless 7.1ch DTS-HD MA audio track you might have in your MKV to 2-channel stereo mp3.  By manipulating the video quality, audio encoding, and even the resolution, you'll be able to make the resulting file as small as you want.

What you do is up to you, but the reason the file size from MakeMKV is the way it is, is because it is a perfect copy of what was on the BluRay.  Anything further you do is going to cause some loss in quality.  Storage is cheap, so I keep all my movies as MKV.  20GB is not so big.  For comparison, the Godfather II MKV is 39GB.

Experiment with Handbrake, and decide what's best for you.  Good luck!
Logged

rec head

  • Citizen of the Universe
  • *****
  • Posts: 1009
Re: Compressing MKV Files
« Reply #2 on: May 14, 2019, 07:12:00 am »

Everything @wer said is right but I agree with the keep the quality and get more storage option. Just wait til you start ripping UHD discs. 40GB easily.
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7805
  • Autumn shade...
Re: Compressing MKV Files
« Reply #3 on: May 14, 2019, 07:43:57 am »

There's tutorials for Handbrake out there with "recommended" settings depending on what you're ripping (and resolution). I've had pretty good luck with 1080p re-encodes of 20GB BD rips to around 3 or less GB.

Be warned though, depending on what settings you use, re-encoding in Handbrake can take hours to complete. In my case even with higher end hardware, it took nearly 2 hours.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Compressing MKV Files
« Reply #4 on: May 14, 2019, 10:07:56 am »

I don't really expect to change your mind with what I'm going to write here, but maybe someone will find it interesting.

I've been ripping and encoding media for almost 20 years now.  In that time I've encoded and re-encoded quite a bit of media.  I've ripped to low resolutions and high resolutions.  Video transcoding (going from one CODEC to another, or one bitrate to another) always seems to take *forever*.  Even with a fairly fast machine it's always an hours long operation.

When I first ripped my CD collection, I did so at 128 kbps as AAC.  It sounded great.  Well... at least that's what I thought at first.  As I started listening to my digital music collection, I gradually got bored.  I started hitting the "next" button constantly.  ...and eventually I stopped listening to music almost completely except for a little in my car.  Music just wasn't interesting any more.  I wasn't sure why.

Years passed and I was listening to the radio some and mostly not liking what I heard.  I was working at at stereo shop at the time and we had a new model of head unit from Pioneer that could natively decode FLAC files.  Someone brought in some downloaded FLACs and some high bit rate MP3s and we listened a bit on some expensive car speakers from JL Audio.  I was intrigued.  Around that time the Pono came out and touted FLAC based lossless audio as being a wonderful musical experience that most people had never had.  I was taken in by the dramatic reactions of people listening to Pono with bug eyes and excited body language and enthusiasm.

So I went home and ripped a couple of CDs as FLAC that I had sitting around.  Put on my headphones and listened.  Ho. Lee.  Wow.  I was really impressed and engaged by what I heard.  I ripped another 20 CDs and kept listening.  Suddenly I was listening to music for hours every day and more importantly I was *enjoying* it.  A lot.

Fast forward a year or so and I had ripped (and bought) 300 to 400 CDs and continued to enjoy it.  Today I have a slightly bigger collection and am more engaged with music than ever before.  It's been about 6 years since that FLAC day for me. 

Somehow, listening to low bit rate music, which sounded at first listen "just fine" robbed me of musical enjoyment.  My brain just wasn't into it.  Lossless audio brought the magic back for me.

There will be those who are saying right now "you just didn't use a high enough bitrate stupid.  If you had just ripped to 320kbps MP3, you would have been fine."  That might be true.  I have done some tests and had poor luck in accurately picking lossless from 320kbps MP3.  But here's the thing:  Storage is cheap, cheap, cheap, and it's getting cheaper every month.  With lossless audio, I will never, ever wonder if I have a high enough bitrate.  I'll never wonder if there's something that the algorithm threw away.  Because I have every bit that was on the disc and didn't waste any of it in search of disk space.  Disk space which costs pennies. 

Within a year or two of this experience, I started ripping my DVD collection, mostly using Handbrake.  I spent *hours* and hours trying to figure out the right CODECs and bit rates for each.  I did experiments with several different video sources at different video bit rates.  There were seemingly endless parameters to choose from.  De-interlacing.  Multi-pass encoding.  "Fast encoding".  "Slow encoding".  Medium.  Choosing actual numbers.  Jeez!

I did research to try to find "perfect video settings" for DVD encoding.  I read multiple forum threads.  I tried things.  I settled on some settings and ripped a few dozen DVDs.  I watched them on my 15" laptop screen and they looked fine.  Good even.  Then I took one of these encoded files.  I think it was "The Incredibles" (which is an animated movie of high quality) and watched it on a bigger screen.  Crap, crap, crap.  Macro blocking.  It looked ok, but the flaws were not all that hard to see.  It was not a pristine representation.

I did a little more research and found some larger encoder values to use and contemplated re-ripping everything again.  It was only a few dozen titles so far (less than 50).  Which would be something like 100 hours of ripping and encoding time.  I did nothing for a while.

Then coincidentally I saw a discussion on this forum about MakeMKV.  I think mwilliems or maybe marko educated me about it.  With MakeMKV I could get the original video and audio formats from the disc.  Without any extra transcoding.  Without any additional loss of data.  Now DVD video and audio are already lossy compressed.  But at least I would get the best lossy version available.  By the way, BluRay is also lossy compressed for video.  Just at a higher resolution, a higher bit rate, and generally with a more efficient CODEC.

So I ripped a few titles with MakeMKV and watched them on a bigger screen.  They looked good.  So I continued ripping more of my collection.  Gradually I back filled and replaced all of my original handbrake rips with MakeMKV "pure copies".  The came BluRay and I ripped a ton more.  Oh, did I mention that MakeMKV rips took a fraction of the time of Handbrake?  Instead of 2, 3, or even 4 hours for  movie, it was more like 20 minutes.  This was a big difference.  ...and it didn't peg the CPU of my computer for hours while doing encoding.  Because there was no encoding to be done.  Just ripping.

Could I have found the magic combination of video encoding parameters that produced a result that I could not find flaws with?  Maybe.  I think it would have been hard, but it's possible.  Again, I would probably wonder from time to time, especially when I saw something odd, "Is that an encoding artifact?  Or was that on the original DVD (or Bluray)? "  It would likely distract me from my viewing enjoyment.  At least at some point.

But now that will never happen.  Because I have "pure copies".  They are big.  18 to 50 GB for each movie.  But again, storage is cheap.  It's getting cheaper.  I'll buy bigger drives in a few years.  It's already something like $0.50 per BluRay at today's prices for storage.  It will be cheaper next year.  ...and the next.

In my mind there is never a reason to add additional compression to a commercially released movie/tv show/album/etc.  I am going to regret it at some point.  But I will never regret having full bandwidth copies of everything.

That's my story.  I hope it was an interesting read.

Brian.
Logged

TheShoe

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 826
Re: Compressing MKV Files
« Reply #5 on: May 14, 2019, 09:48:29 pm »

Great post above Brian.

I came to same conclusion years ago.  I'm up to a meager 80TB of redundant storage at home now and plan to expand (at least double that) as thanks to some other members here helping me get set up and features of Media Center (full menus!), I make complete backups of UHD, BD, and then store a separate MKV only 1080p version (for some specific use cases I have).   For music I backup to flac, except for DSD which I repackage as DSF.

once you start to step up to great speakers, DAC, and display, re-encoding doesn't sound as good or look as good.  thankfully transcoding on the fly works quite well for those devices that can only render at a lower quality or bandwidth concerns come into play.

cheers


Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Re: Compressing MKV Files
« Reply #6 on: May 15, 2019, 12:50:11 am »

I rip my movies to mkv as I do not care for extras ... most importantly I don’t want to browse through DVD/Blu-ray menu before start a movie (an extra step that I don’t want for user experience) ... imo Theatre View is good enough

Obviously atm mkv does not support Dolby Vision ... so was thinking muxing those to mp4 ... and separate HD audio and subtitle streams in mka ... have not got time to test it though

Music is flac for pcm ... dsf for dsd... pretty much like shoe :)

I only have 24tb usable now atm in raid10 ... another 36tb extra is on the way ... this time it will be raidz2 or raidz3

Totally agree with previous posters about lossless rips ... it’s a master copy for you at best quality you can have ... if need smaller size for handheld, then create those from your master

Once on lossy path ... it’s one way trip ... if decide need higher bitrate than your lossy trip, not possible ... some ppl convert mp3 to flac thinking it will increase quality ... nope once the information is lossed in compression, no way to get it back
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Compressing MKV Files
« Reply #7 on: May 15, 2019, 02:36:45 am »

I liked your post a lot Brian.

The only way it could have been better is if at the end you had the TL;DR summary "Everything WER said was right and you should just follow his example."    ;) ;D

You're highly respected so people will listen to you!


My experience was similar to yours, but for different reasons.  I always knew I wanted pure, "bit-perfect" copies, but 20 years ago, drives weren't so capacious as they are today.  So I would squeeze things down to fit them on Ipods and such, but like you, I always found flaws with the reduced size re-encoded copies.

Nowadays, in the world of 8 and 10TB hard drives, when I get a new disc of whatever type, it gets ripped to FLAC or MKV and put on my main media server, and then the disc goes in a box never to be seen again.

If I ever need a small version for a portable player, I can always convert from the lossless copy.  And I enjoy the security of knowing what I'm seeing/hearing is the best quality possible.

So indeed, you said everything I was thinking, I just didn't think anyone would care.  So bravo on an excellent post!

Back to Quarterwave... You have our advice.  Feel free to go your own way.  But in 5 years or so, just see if you don't come to regret all the time and effort you've wasted, and come around to our way of thinking.   ;D

Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Re: Compressing MKV Files
« Reply #8 on: May 16, 2019, 12:49:42 am »

Its worth mentioning though that MakeMKV in some cases wont make bit perfect copy of video. Some times (especially if main title is made of many mt2s segments) there are sync issue with video and audio on discs … and MakeMKV will drop couple of video frames out of final mkv file (it will give you notifications … at least it is not hiding the fact)

Folder rip in MakeMKV is bit perfect … but you get all the BD menus and extras (something that not everybody want).

Stripping folder rips from unwanted menus and extra is something MakeMKV cannot do … I am not aware of any free tool that can do it … ones I am aware of are not free (aka DVDfab)

PS. one of the reason I went with mkv instead of iso or folder rips … is ability to merge 2 MKV files into one using MKVToolnix (handy if movie is made on 2 discs … LOTR and Ben Hur are examples … I guess you can use LINK feature of MC to link iso or folder rip, but not sure how that will be handle)

PSS. also with mkv (again using MKVToolnix) can add in additional audio tracks/subtitles … eg I have both 3D and UHD discs of Incredibles 2 … so I added Atmos sound track from 4K version into mkv of 3D remux
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)

rec head

  • Citizen of the Universe
  • *****
  • Posts: 1009
Re: Compressing MKV Files
« Reply #9 on: May 17, 2019, 11:33:14 am »

Its worth mentioning though that MakeMKV in some cases wont make bit perfect copy of video. Some times (especially if main title is made of many mt2s segments) there are sync issue with video and audio on discs … and MakeMKV will drop couple of video frames out of final mkv file (it will give you notifications … at least it is not hiding the fact)

FWIW I have ripped a lot of MKV's and never had this problem.

PSS. also with mkv (again using MKVToolnix) can add in additional audio tracks/subtitles … eg I have both 3D and UHD discs of Incredibles 2 … so I added Atmos sound track from 4K version into mkv of 3D remux

I have done this too and pleasantly surprised at how easy it is and doesn't take very long.



Logged

tij

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1563
Re: Compressing MKV Files
« Reply #10 on: May 17, 2019, 01:06:10 pm »

FWIW I have ripped a lot of MKV's and never had this problem.

those are rare ... it usually (not always) happens on disc that have main title made up from multiple mt2s (these are usually disc with multiple version of movie on one disc ... main title is broken down to segment ... and versions of movies are mpls playlist of those segments where extra/alternative scences are inserted/replaced)

from what i recall ... Gladiator, Alien series, Total Recall where such BD ... also animations like to do this to localize movie (french version of animation will have importan scences with text actually rendered in french)

in older versions of makemkv this was not so noticable ... as it will tell you at the end,that the rip was succsseful but has some warnings ... you have to open separate log file before to see that warning ... but now makemkv just give you those as the disc is beeing ripped

from what i understand ... video is 23.97hz while audio is 48hz ... so at the end of each segment, the end of video does not exactly match end of audio ... when you try to piece whole movies from these segments, some sync issue is expected ... sync is usually puny (i dont think you will see it if no resycing is done) and makemkv usually resync by dropping 2 or 3 frames from video
Logged
HTPC: Win11 Pro, MC: latest 31(64b), NV Driver: v425.31, CPU: i9-12900K, 32GB RAM, GeForce: 2080ti
Screen: LG 2016 E6
NAS: FreeNAS 11.1, SuperMicro SSG-5048R-E1CR36L, E5-1620v4, 64GB ECC RAM, 18xUltrastar He12-SAS3 drives, 2x240GB SSD (OS)
Pages: [1]   Go Up