Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > High Efficiency Video Coding (HEVC)

Reply
 
Thread Tools Search this Thread Display Modes
Old 31st May 2021, 21:35   #1  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Best Option for Bluray x265 Encodes to Maintain Quality?

Hey guys,

I have a very large blu-ray collection that I would like to backup in the best quality possible. About 25% of the collection will be backed up 1:1 without menus (main movie only). The other 75% of the movies are the ones that I need help encoding.

I have an i9-9900k processor that I can use for the encoding or a 2080 Super Nvidia GPU. I have been doing a lot of reading and it seems that I will get better quality with my CPU.

I want to keep the audio quality original to the source. For 5.1/7.1 i want to stick with the DTS MA/True HD tracks. For 2 channel DTS MA i can probably convert it to FLAC or keep as is depending on your recommendations.

For video quality, I realize I am going to lose some detail but would like to keep it as close to the original as possible. My goal is to cut the original video file by at least 20%. I have a lot of storage but not enough to do full backups.

I have used Handbrake before. Is it still a viable option in 2021 or is there something better like StaxRip? I would prefer to have a one sized fits all setting approach, if possible. If this means having to do a CRF of 16 for every movie, then that's fine by me. I realize every movie compresses differently, but as long as I save some space over the original that is what matters most.

Thank you for any suggestions! I really would like to use advanced settings to maintain the best quality possible if you have any suggestions for that as well.
StormMeows is offline   Reply With Quote
Old 31st May 2021, 23:18   #2  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
Why bother with any of this to only save 20% on the video bitrate? Just keep the tracks you want and mux to MKV

I'd maybe consider compression if I wanted to save 40-50% or more (which is totally viable with transparency for most BluRay discs using x265).
Blue_MiSfit is offline   Reply With Quote
Old 1st June 2021, 00:10   #3  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Blue_MiSfit View Post
Why bother with any of this to only save 20% on the video bitrate? Just keep the tracks you want and mux to MKV

I'd maybe consider compression if I wanted to save 40-50% or more (which is totally viable with transparency for most BluRay discs using x265).
Hey, thanks for your reply! I totally get what you're saying and I apologize if I wasn't clear in the first post. I have a lot on my mind and it probably came out jumbled. I am definitely going to keep my favorite movie backups as full 1:1 but for the rest of the movies I am really going to need to save space. I have a few thousand Blurays and any space I can save on those, while keeping the original audio will be very helpful. When I stated that I am fine with around 20% space saved, I was just implying that any additional space saved would help me out. If I can do around 50% space savings on most of the backups, that would be great. My goal is to not lose much original video quality compared to the original file.

I have been playing around with Handbrake and so far I have come up with the following for my Bluray backups.

Video Codec: x265 10 Bit
Framerate Same as Source
Constant Framerate
Encoder Preset Slow
CRF 16-18 depending on movie
Encoder Profile HIGH
Encoder Level 4.1
deblock -3,-3
I'm not sure on more advanced options to input. I know the Encoder Tune setting will change the advanced options further as well.

Any tips appreciated! Thank you
StormMeows is offline   Reply With Quote
Old 1st June 2021, 00:37   #4  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
Those are good options. Slower is still helpful, if you can stand the speed decrease (1000s will take a while on a 9900k). CRF 18 should give great quality and still be noticeably smaller.

For anime and similar --tskip is very helpful.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 1st June 2021, 01:32   #5  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Asmodian View Post
Those are good options. Slower is still helpful, if you can stand the speed decrease (1000s will take a while on a 9900k). CRF 18 should give great quality and still be noticeably smaller.

For anime and similar --tskip is very helpful.
Thank you! With how inexpensive HDDs are now, I may just back these up with full quality instead. I'm not a professional encoder so I feel like I may end up leaving quality on the table and with my OCD, I should probably just stick to main movie "Muxing."

Last edited by StormMeows; 1st June 2021 at 02:43.
StormMeows is offline   Reply With Quote
Old 1st June 2021, 05:52   #6  |  Link
RanmaCanada
Registered User
 
Join Date: May 2009
Posts: 331
Quote:
Originally Posted by StormMeows View Post
Thank you! With how inexpensive HDDs are now, I may just back these up with full quality instead. I'm not a professional encoder so I feel like I may end up leaving quality on the table and with my OCD, I should probably just stick to main movie "Muxing."
You haven't checked prices recently have you. Chia has made HDD prices stupid in most regions due to miners buying them up..just like video cards.

In the end the only thing that matters is that you're happy with the encode and your eyes and ears can't tell the difference.
RanmaCanada is offline   Reply With Quote
Old 1st June 2021, 20:07   #7  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
Quote:
Originally Posted by StormMeows View Post
Thank you! With how inexpensive HDDs are now, I may just back these up with full quality instead. I'm not a professional encoder so I feel like I may end up leaving quality on the table and with my OCD, I should probably just stick to main movie "Muxing."
This is what I did. Referb 10TB drives with lots of redundancy and very little CPU time needed.

Quote:
Originally Posted by RanmaCanada View Post
You haven't checked prices recently have you. Chia has made HDD prices stupid in most regions due to miners buying them up..just like video cards.
Hopefully this will not be a long term trend. Chia prices are less than half of the release price so it doesn't seem like a very attractive target for mining.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 1st June 2021, 21:25   #8  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Asmodian View Post
This is what I did. Referb 10TB drives with lots of redundancy and very little CPU time needed.
.
I have a NAS with a ton of storage and can add on additional expansion units (QNAP) so this definitely seems like the best way for us to go. As you mentioned, muxing doesn't take long at all with Make MKV or MKVtoolnix and the backups average around $1-2 for blu-ray. If I later do my 4K UHDs, then those are going to be more like $6 on average, which still isn't too terrible..

Quote:
Originally Posted by RanmaCanada View Post
You haven't checked prices recently have you. Chia has made HDD prices stupid in most regions due to miners buying them up..just like video cards.

In the end the only thing that matters is that you're happy with the encode and your eyes and ears can't tell the difference.
With the average of my blu-ray muxes being in the low 20GB range, I do think this is probably the best option for me. My NAS allows me to upgrade to additional add-on expansion units so I should never have a problem with storage, even with main movie only muxes. I do see prices are a bit higher right now, but per GB it is not too bad when I consider that most of my muxes are only around $1-2. Hopefully things get better though. I am definitely keen on good quality so I am going to stick with muxing and not encoding.

Last edited by StormMeows; 25th June 2021 at 00:15.
StormMeows is offline   Reply With Quote
Old 3rd June 2021, 22:15   #9  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Still, ask yourself if reencoding saves enough to be worth your time, reduced ability to use your computer, and increased power bill. Doing an elementary stream bit-copy means you don't have to worry about whether you are losing video quality, and thus don't have to test and tune to avoid it.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 23rd June 2021, 22:02   #10  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by benwaggoner View Post
Still, ask yourself if reencoding saves enough to be worth your time, reduced ability to use your computer, and increased power bill. Doing an elementary stream bit-copy means you don't have to worry about whether you are losing video quality, and thus don't have to test and tune to avoid it.
Hey again - I'm reviving this thread from a couple of months ago. With how many movies I have and the prices currently for hard drives, it seems that H265 HEVC encoding makes the most sense. Can you recommend a specific program and settings that will allow me to keep the video as untouched as possible? I prefer not to crop or change anything like grain from the original. I need settings that will provide the best possible encode. I definitely want to keep the framerate original and constant as well. I want to use CRF encoding as well with a low number and keep the original uncompressed audio track. Even if I save 20-30% space overall, that would GREATLY help me out. Any help would be appreciated guys! Thank you
StormMeows is offline   Reply With Quote
Old 24th June 2021, 09:36   #11  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 324
Quote:
Originally Posted by StormMeows View Post
Hey again - I'm reviving this thread from a couple of months ago. With how many movies I have and the prices currently for hard drives, it seems that H265 HEVC encoding makes the most sense. Can you recommend a specific program and settings that will allow me to keep the video as untouched as possible? I prefer not to crop or change anything like grain from the original. I need settings that will provide the best possible encode. I definitely want to keep the framerate original and constant as well. I want to use CRF encoding as well with a low number and keep the original uncompressed audio track. Even if I save 20-30% space overall, that would GREATLY help me out. Any help would be appreciated guys! Thank you
Here is the section for frontends https://forum.doom9.org/forumdisplay.php?f=78

For example you can try out MeGUI or StaxRIP to see what you like the best.

No one will be able to answer what the best possible encode is for you, as you can put in settings that are so slow that it will never be feasible for you to encode your archive, but it might work for some ones else workflow and requirements.

But something like this would be a place to start:

Code:
1080p24 SDR
--preset slow --profile main10 --level-idc 41 --crf 17 --keyint 240 --min-keyint 24 --no-sao --deblock -1:-1 --aq-mode 1  + flags (--colorprim bt709 --transfer bt709 --colormatrix bt709 --range limited)

2160p24 HDR
--preset slow --profile main10 --level-idc 51 --crf 16 --keyint 240 --min-keyint 24 --no-sao --deblock -1:-1 --aq-mode 1 --hdr-opt + flags (e.g. --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" )
For network playback I would specify the target level so you get VBV limits or else you can get buffer issues when running uncapped with a low crf value, especially for wifi connections.

When it comes to the CRF value I usually increase it by 1 for 2160p, and decrease it by 2 for HDR content from what I use as a baseline for 1080p SDR.

Last edited by excellentswordfight; 25th June 2021 at 18:51.
excellentswordfight is offline   Reply With Quote
Old 24th June 2021, 17:37   #12  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
I'm skeptical that the effort to find your settings and actually run the encodes is going to save you on net versus more storage. You can get a good HD for $25/TB or less. Non-4K Blu-ray discs max out at 50 GB with most using less that that, and a lot less if you select the tracks you care about, you're looking at <$1/disc for just remuxing. A typical good PC will still take 12+ hours to reencode a full movie at a quality and bitrate savings worth the effort.

Since pre-4K Blu-ray discs only use 8-bit H.264, you can get some speed back by encoding in 8-bit HEVC. 10-bit won't give any quality improvements or bitrate savings with HEVC, unlike H.264. H.264 would get significant savings encoding in 10-bit from 8-bit source, but HEVC fixed 8-bit so there isn't that efficiency gap.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 25th June 2021, 00:12   #13  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by excellentswordfight View Post
Here is the section for frontends https://forum.doom9.org/forumdisplay.php?f=78

For example you can try out MeGUI or StaxRIP to see what you like the best.

No one will be able to answer what the best possible encode is for you, as you can put in settings that are so slow that it will never be feasible for you to encode your archive, but it might work for some ones else workflow and requirements.

But something like this would be a place to start:

Code:
1080p24 SDR
--preset slow --profile main10 --level-idc 41 --crf 17 --keyint 240 --min-keyint 24 --no-sao --deblock -1:-1  + flags (--colorprim bt709 --transfer bt709 --colormatrix bt709 --range limited)

2160p24 HDR
--preset slow --profile main10 --level-idc 51 --crf 16 --keyint 240 --min-keyint 24 --no-sao --deblock -1:-1 --hdr-opt + flags (e.g. --colorprim bt2020 --transfer smpte2084 --colormatrix bt2020nc --max-cll "1000,400" --master-display "G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,1)" )
For network playback I would specify the target level so you get VBV limits or else you can get buffer issues when running uncapped with a low crf value, especially for wifi connections.

When it comes to the CRF value I usually increase it by 1 for 2160p, and decrease it by 2 for HDR content from what I use as a baseline for 1080p SDR.
Hey there and thank you so much for taking the time to reply. I also appreciate you giving me examples of the advanced settings. Is there any good reads on advanced settings like you showed here so I can become more familiar with what each does to the encode? From my understanding if I choose preset slow vs medium, the slow will actually use more advanced settings to give a better encode, at the cost of time of course. I am really debating on building a higher end encoding rig, but there is a lot to consider with how many movies we have. The energy cost is pretty crazy, especially on some of those higher end CPUs used for encoding. I really wish I could just put a really low CRF and use my 2080 Super Invidia card. It sounds like that might not give me nearly as good of quality as the CPU though. I also read that the more threads I am using on the higher end CPUs, the lesser quality the final encode would be. I'm sure there is some truth to that, but will still be a lot better than my GPU. I'll check out Staxrip again and Megui. I used to use Megui 15 years ago. Thanks!

Quote:
Originally Posted by benwaggoner View Post
I'm skeptical that the effort to find your settings and actually run the encodes is going to save you on net versus more storage. You can get a good HD for $25/TB or less. Non-4K Blu-ray discs max out at 50 GB with most using less that that, and a lot less if you select the tracks you care about, you're looking at <$1/disc for just remuxing. A typical good PC will still take 12+ hours to reencode a full movie at a quality and bitrate savings worth the effort.

Since pre-4K Blu-ray discs only use 8-bit H.264, you can get some speed back by encoding in 8-bit HEVC. 10-bit won't give any quality improvements or bitrate savings with HEVC, unlike H.264. H.264 would get significant savings encoding in 10-bit from 8-bit source, but HEVC fixed 8-bit so there isn't that efficiency gap.
Hey again and thank you for taking the time to reply. There is definitely a lot to consider here. Even if I build a custom AMD threadripper it is going to cost at least $3k. Then as you mentioned i will be encoding all day long every day. The build looks to be just shy of 500w, which will add a lot to the electric bill. Even with the inflated costs of hard drives, full backups with 1 lossless audio track may still be a really good option. I know you have a lot of experience with the GPU Invidia encoding. Even if I do h265 NVENC with a CRF of 12 and slow preset, it won't be good enough compared to the original and CPU? The GPU would obviously save a lot of time and money. I tried this method in handbrake and it did make the file size a lot smaller. It seemed to smooth the image out more than the original though. So it sounds like if I do decide to encode Blurays, then you would recommend regular x265 HEVC (this should be 8 bit) over x264? Thanks again for your reply!
StormMeows is offline   Reply With Quote
Old 25th June 2021, 01:48   #14  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,989
NVENC is not a good fit for your goals

As you've seen, it's super fast and not too bad, but it doesn't retain fine detail well, especially if your goal is to make smaller outputs than the encodes already on your discs.

If you want a transparent BluRay quality encode you need software encoding. x265 is ideal for this. You could use 8 or 10 bit, but the benefit of 10 bit (from an 8 bit source) isn't really there with HEVC. There's no harm in using 10 bit tho, since any HEVC decoder you care about will support both. Software HEVC encoding is indeed processor (thus time and money) intensive -- hence why we both recommend just remuxing
Blue_MiSfit is offline   Reply With Quote
Old 25th June 2021, 08:37   #15  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,730
Quote:
Originally Posted by Blue_MiSfit View Post
NVENC is not a good fit for your goals

As you've seen, it's super fast and not too bad, but it doesn't retain fine detail well, especially if your goal is to make smaller outputs than the encodes already on your discs.

If you want a transparent BluRay quality encode you need software encoding. x265 is ideal for this. You could use 8 or 10 bit, but the benefit of 10 bit (from an 8 bit source) isn't really there with HEVC. There's no harm in using 10 bit tho, since any HEVC decoder you care about will support both. Software HEVC encoding is indeed processor (thus time and money) intensive -- hence why we both recommend just remuxing
There is the benefit that 10-bit output should have less banding. With current day devices, I see no reason to encode at 8 bits even if the source is 8 bits as well.

Quote:
The build looks to be just shy of 500w, which will add a lot to the electric bill.
My stock clockspeed, undervolted 3900X system uses about 300W when encoding, and this is with Avisynth+x265 using 85-95% of CPU. I do have a lot of old, spinning HDDs in the system which can easily cause a 100-150W load. In that sense, 500W sounds a lot with modern CPUs.

And yes, stock speed and manual undervolting is a good combo. The amount of power it saves can really make a difference. AMD's automatic overclocking (PBO) may sound like a good idea but with video encoding it's not. It will only cause the temperatures and power usage shoot through the roof but the gain in performance is quite small.
__________________
And if the band you're in starts playing different tunes
I'll see you on the dark side of the Moon...
Boulder is offline   Reply With Quote
Old 25th June 2021, 18:42   #16  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,770
Quote:
Originally Posted by Boulder View Post
There is the benefit that 10-bit output should have less banding. With current day devices, I see no reason to encode at 8 bits even if the source is 8 bits as well.
You've seen reduced banding even in 8-bit to 8-bit encodes? I can imagine how that's possible, but haven't tested that scenario much myself as I mainly work from 10-bit 422 sources.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 25th June 2021, 19:02   #17  |  Link
excellentswordfight
Lost my old account :(
 
Join Date: Jul 2017
Posts: 324
Quote:
Originally Posted by Boulder View Post
There is the benefit that 10-bit output should have less banding. With current day devices, I see no reason to encode at 8 bits even if the source is 8 bits as well.
Not only banding, see the samples i took in this post https://forum.doom9.org/showthread.p...98#post1922398 there is a big difference between using 10bit & 8bit with 8bit soures in x265.

Quote:
Originally Posted by StormMeows View Post
Hey there and thank you so much for taking the time to reply. I also appreciate you giving me examples of the advanced settings. Is there any good reads on advanced settings like you showed here so I can become more familiar with what each does to the encode?
https://x265.readthedocs.io/en/master/cli.html
Quote:
From my understanding if I choose preset slow vs medium, the slow will actually use more advanced settings to give a better encode, at the cost of time of course.
Correct
Quote:
I also read that the more threads I am using on the higher end CPUs, the lesser quality the final encode would be. I'm sure there is some truth to that, but will still be a lot better than my GPU.
If you leave settings related to threading at default there will be negligible differences in quality between a high and low core count system. Do note though that at default a single instance of x265 cannot saturate/give full load on the highest core count CPUs, but 8/16 models should give good scaling on 1080p and 2160p scales nicely with 16/32 (you will get scaling beyond that but you probably wont get 100% utilization).

Last edited by excellentswordfight; 25th June 2021 at 19:05.
excellentswordfight is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:45.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.