Reducing MKV size with Handbrake without loosing too much quality

Please post here for issues related to UHD discs
Post Reply
davie
Posts: 4
Joined: Sun Sep 29, 2019 9:57 pm

Reducing MKV size with Handbrake without loosing too much quality

Post by davie » Mon Sep 30, 2019 4:11 am

Whats the best video settings for handbrake to reduce the size of a 4K BD rip size without loosing too much quality?

Woodstock
Posts: 7343
Joined: Sun Jul 24, 2011 11:21 pm

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by Woodstock » Mon Sep 30, 2019 1:24 pm

This is not the handbrake support forum, and "too much quality" is subjective in any case.

Best way to not lose quality is to not encode, but that ship sailed when the disk master was created. The 1080p version is already smaller with good quality.
How to aid in finding the answer to your problem: https://www.makemkv.com/faq/item/8

oddeyeball
Posts: 33
Joined: Wed Sep 18, 2019 8:20 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by oddeyeball » Tue Oct 01, 2019 9:49 am

Personally I would just use the regular blu-ray version as Woodstock suggested. If your 4k rip is a UHD one, do not use handbrake since it uses 8-bit processing and the 4k UHD video uses 10-bit. The colors will be washed out. If you really want to shrink that 4k video, I would do some research on google for it, its kinda of a pain.

Edit - My mistake, Handbrake actually has codecs for 10-bit so ignore the part where I say handbrake uses 8-bit processing only. Now I need to start messing with this new discovery for me, even though its been around for a long time........
Last edited by oddeyeball on Fri Oct 04, 2019 10:19 pm, edited 1 time in total.

MartyMcNuts
Posts: 859
Joined: Wed Nov 22, 2017 11:45 pm

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by MartyMcNuts » Tue Oct 01, 2019 10:16 am

davie wrote:
Mon Sep 30, 2019 4:11 am
Whats the best video settings for handbrake to reduce the size of a 4K BD rip size without loosing too much quality?
A bitrate of 25 Mb/s.
Cheers :D
----------------------------------------------------------------------------------------------------------------------------------------
For UHD capable drives in AUS & NZ: viewtopic.php?f=20&t=18747

1wayjonny
Posts: 23
Joined: Wed Oct 31, 2018 12:03 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by 1wayjonny » Thu Oct 03, 2019 9:45 pm

https://codecalamity.com/encoding-setti ... -bit-x265/

This should help as a starter, not sure about the loss of 10bit to 8bit being I see an update from 2017/2018 that can handle 10bit but that may be worth looking into in case I am wrong.

I have a 40TB adaptec raid and will leave the quality as it sits. Int he future time and size will not matter. Remember trying to store 5-10GB files? Its an after thought now. =)

oddeyeball
Posts: 33
Joined: Wed Sep 18, 2019 8:20 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by oddeyeball » Fri Oct 04, 2019 10:15 pm

1wayjonny wrote:
Thu Oct 03, 2019 9:45 pm
https://codecalamity.com/encoding-setti ... -bit-x265/

This should help as a starter, not sure about the loss of 10bit to 8bit being I see an update from 2017/2018 that can handle 10bit but that may be worth looking into in case I am wrong.

I have a 40TB adaptec raid and will leave the quality as it sits. Int he future time and size will not matter. Remember trying to store 5-10GB files? Its an after thought now. =)
Oh, you're right. I never noticed they included the libraries for it because I already have presets already made. Previously I've had to download the libraries for night builds just to do it and now I finally clicked the video codecs and see the 10-bit ones listed. My mistake, that's what I get for just using the same presets for a long long time, lol

1wayjonny
Posts: 23
Joined: Wed Oct 31, 2018 12:03 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by 1wayjonny » Sun Oct 06, 2019 12:37 am

No worries at all, I have been interested my self and searched over time but never did the compress with my raid. But this thread forced me to search again and I came across that detailed article, saved it myself for potential future use. It was a nice write up.

Cheers

majstrzvasi
Posts: 3
Joined: Mon Oct 28, 2019 11:36 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by majstrzvasi » Tue Oct 29, 2019 9:37 am

Hi a did some testing in handbrake at a 30 second movie clip i extracted from a original 4k hdr movie. For me personaly a 2hour movie 2160p hdr rip compresed to arround 4 to 5gb is good enough quality.
Looking from my couch on my 43inch HDR tv i cant really benefit from higher bitrates and filesizes becasue diference is not noticable in my case.

For riping i use H265 10bit and constant quality. Becuase this way quality is always constant and it adapts bitrate to the scene complexity.

And there are presets. Slower the preset better the quality but also bigger the filesize. Slower the preset longer the riping times. Example on my intel i7 cpu 2 hour movie 4k resolution on medium preset it needs arround 20-30hours on fast preset it needs like 15-20hours.
ultrafast
superfast
veryfast
faster
fast
medium (default)
slow
slower
veryslow
placebo
For diferent presets diference in filesize is around 10-15% between each preset

RF settings is constant quality and lower the number better quality bigger the filesize.
Recommended settings for x264 and x265 encoders:
RF 18-22 for 480p/576p Standard Definition1
RF 19-23 for 720p High Definition2
RF 20-24 for 1080p Full High Definition3
RF 22-28 for 2160p 4K Ultra High Definition4
difference between each rf is quite big and it is around 30-40% in filesize.

So medium preset at 23rf has better quality and biger filesize than preset fast on 23rf. Also fast preset on 22rf shuld have similar quality and size as medium 23rf but fast preset would need shorter amount of time to process because the fast preset is not that demanding.

I made a graf of different presets and RF.
Results in the graf are filesize in MB
Image

So you can test this for yourselfs what i am talking about i made a 4k hdr rip 30second clip in diferent settings and you can download and check the quality.I would really appreciate if you try to play sthis clips on you home HDR tvs and tell me your opinions. Link to clips

[Link to copyrighted material removed]

Woodstock
Posts: 7343
Joined: Sun Jul 24, 2011 11:21 pm

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by Woodstock » Wed Oct 30, 2019 1:32 am

Loss of quality is a subjective matter. Any lossy encoding scheme loses quality by definition, with each pass through an encoder.

The key metric is, "Is the result acceptable to ME?" We aren't you, so our opinion isn't that relevant.

Also, the handbrake forum is a better place to discuss handbrake topics.
How to aid in finding the answer to your problem: https://www.makemkv.com/faq/item/8

majstrzvasi
Posts: 3
Joined: Mon Oct 28, 2019 11:36 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by majstrzvasi » Wed Oct 30, 2019 9:44 am

Link of the clips is removed i gues even 30 seconds is too much for a copyright.
I must say only one thing today i tried the new x265 version 3.2 For 4k video on medium preset and rf 22 it realy does some amazing results at realy small filesize. Best is the riping time it is much faster it is as fast as x265 version 2.9 on fast settings.

Woodstock
Posts: 7343
Joined: Sun Jul 24, 2011 11:21 pm

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by Woodstock » Wed Oct 30, 2019 12:28 pm

Rule of thumb in US copyright law is "up to 10 seconds" will often (but not always) be overlooked by courts in the US.

Other parts of the world? I cannot say, because I don't live there.
How to aid in finding the answer to your problem: https://www.makemkv.com/faq/item/8

majstrzvasi
Posts: 3
Joined: Mon Oct 28, 2019 11:36 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by majstrzvasi » Fri Nov 15, 2019 5:06 pm

Now i compresed like 10 4k hdr movies and decided to use the crf 20 at medium preset because at 22crf i noticed some minor color banding in realy demanding slow scenes and some loss of detail in large similar color areas.
Problem is the thing needs like 15-20 hours of work. I would go to the slow preset at crf 20 but then i am getting to 40+ hours.
My intel i7 realy has a hard time. I am considering a new cpu something like ryzen 9 3950x but i dont know how well the h265 10bit scales will it use all the cores does anione know?

Woodstock
Posts: 7343
Joined: Sun Jul 24, 2011 11:21 pm

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by Woodstock » Fri Nov 15, 2019 9:17 pm

How many cores are useful varies, depending on choice of encoder and filters. You can find more information about this on the handbrake forum, where it has been discussed many times.

Generally, if you have more than 8 cores, and certainly with more than 12, the only speed-up you'll see is if you run multiple encodes at the same time. And some encoders have reduced quality if there are too many threads running.

Remember, you do not need to encode a complete video to test different parameters.
How to aid in finding the answer to your problem: https://www.makemkv.com/faq/item/8

troyBORG
Posts: 18
Joined: Wed Mar 23, 2016 4:47 am

Re: Reducing MKV size with Handbrake without loosing too much quality

Post by troyBORG » Sun Dec 01, 2019 5:34 pm

I've been using ffmpeg to reduce mine.

This script will convert it from HDR to SDR, and make it 1080p, and cropping it to 2.35:1 aspect ratio..:

Code: Select all

ffmpeg -i "Cold Pursuit-FPL_MainFeature_DV_t00.mkv" -c:v hevc_nvenc -vf zscale=t=linear:npl=100,format=gbrpf32le,zscale=p=bt709,tonemap=tonemap=hable:desat=0,zscale=t=bt709:m=bt709:r=tv,format=yuv420p,scale=1920:-1,crop=1920:800:0:140 -rc constqp -qp 24 -b:v 6000K -maxrate 12000K -max_muxing_queue_size 1024 -acodec copy -scodec copy "Cold Pursuit (2019).mkv"
It brought the file down to 4.5 GiB from its 55.6 GiB RAW version.

Post Reply