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 > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th July 2021, 22:35   #1  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Dialing in Settings for x264 8-bit Transparent Blu-Ray Encodes

Hey guys,

I have learned so much in the past few months, it is just crazy! I am encoding a large blu-ray collection at the highest quality (transparent to source) and had some questions.

The main settings that I am having a bit of trouble with are aq-strength, qcomp, psy-rdo, and ip/pb ratio.

Here is what I do for each encode - I do test samples to find the highest CRF I can get away with to maintain transparency to the source. I use avspmod to interleave the source to encode. I do samples of CRF 15-20 and find the highest value that is transparent to the source throughout the test scenes.

Once I have found my ideal CRF value, I switch to 2-pass using the bitrate I retrieved from the CRF testing and dial in aq-strength, qcomp, psy-rdo, ip/pb ratio mainly. Once those settings are found, then I go back and test it with the CRF value in another test and as long as the latest sample encode is transparent to the source throughout, that's my ideal settings for the live action blu-ray.

Are there any general rules that I can use for each movie and if it looks good, then just find the right CRF value and encode it? For instance, modern digitally shot movies typically doesn't have as much grain as a 1980's movie. So right away, couldn't we do a preset for digitally shot modern movies, one preset for grain, then another one for animation and call it a day?

From what I have gathered in my review samples, here is what I have came to the conclusion to on these settings using a "normal live action modern movie as an example.

Normal Live Action Modern Movies - deblock -3:-3, q comp between .6-.65, IP Ratio 1.3, PB Ratio 1.2, AQ Mode 3, AQ Strength .8, Psy-RDO- between 1 and 1.05.

Please let me know your thoughts on how I can better dial in aq-strength, psy-rdo, qcomp, ip/pb ratio, and even CRF values. My goal is to save space, but I am willing to only save 30% file size of the source to have high transparency to the source.

*I guess I just need some of these settings simplified a bit more in laymen terms. So it seems like a value of psy-rdo 1.10-1.15 may work better for grainy movies because the goal of psy-rdo is to sharpen the picture a bit more so to preserve detail, we may want to do that on the grainier source. I should point out that I always keep the trellis strength at 0. *

Thanks for any help. I really appreciate it guys. It means a lot and I'm just trying to get everything dialed in a bit more so I can encode more movies.

Last edited by StormMeows; 17th July 2021 at 03:50.
StormMeows is offline   Reply With Quote
Old 17th July 2021, 03:12   #2  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
I am sorry to inform you that your process is not a good one.

You need to pick aq-strength, qcomp, psy-rdo, ip/pb ratio while encoding using 2-pass so you are always comparing files of the same size. Only after you have figured out all your settings can you tune crf values.

--tune grain/film/animation
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 17th July 2021, 03:48   #3  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,988
Quote:
pick aq-strength, qcomp, psy-rdo, ip/pb ratio while encoding using 2-pass so you are always comparing files of the same size
Although this recommendation is generally good when tuning a specific encoder, any time you're involving rate control things can get a little messy, especially if you're comparing two encoders against each other.
Blue_MiSfit is offline   Reply With Quote
Old 17th July 2021, 03:48   #4  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Asmodian View Post
I am sorry to inform you that your process is not a good one.

You need to pick aq-strength, qcomp, psy-rdo, ip/pb ratio while encoding using 2-pass so you are always comparing files of the same size. Only after you have figured out all your settings can you tune crf values.

--tune grain/film/animation
Hey there, what about my process isn't good though? Can you please elaborate on it so I know? Also, after I have found a transparent CRF value, I do the settings adjustments using the bitrate that I got from my CRF test with 2 pass. There are certain settings within the tune-presets like tune-grain that I do not like so that's why I choose not to use them. Any additional insight would be great. Thank you for your reply! Hope you having a great weekend.
StormMeows is offline   Reply With Quote
Old 17th July 2021, 03:52   #5  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Blue_MiSfit View Post
Although this recommendation is generally good when tuning a specific encoder, any time you're involving rate control things can get a little messy, especially if you're comparing two encoders against each other.
I usually take the bitrate that I got from my CRF transparency testing and use the highest CRF that looks like the source, then use that bitrate to test all of the various settings in 2 pass mode. Also, I have noticed a lot when comparing settings, it seems like the encode will make people's eyes blacker and create shadows around them. It sometimes makes their pupils bigger as well. What settings are affecting these kind of things? Any help with testing for transparency would be great. Thanks
StormMeows is offline   Reply With Quote
Old 17th July 2021, 08:02   #6  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Quote:
Originally Posted by StormMeows View Post
I do the settings adjustments using the bitrate that I got from my CRF test with 2 pass.
Ah, that is good then. Ignore me.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 17th July 2021, 17:22   #7  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Asmodian View Post
Ah, that is good then. Ignore me.
I appreciate the help man. I just forgot to put that in there. I noticed early on that if I try to test settings with the same CRF, it yielded completely different results and bitrates. For some of these settings like adjusting the qcomp or ip/pb ratios, will the tests even look much different? I have to either zoom in to 200% or get really close to my monitor to see any changes. Even then, it is usually just grain shift or the new settings create like dark shadows around people's eyes or their pupils get bigger/blacker.
StormMeows is offline   Reply With Quote
Old 17th July 2021, 23:48   #8  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,406
Maybe try with a lower bitrate to exaggerate the differences. Then it isn't exactly the same situation, but if you start with bitrates that seem transparent then by definition it is going to be really hard to spot any differences.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 18th July 2021, 03:44   #9  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by Asmodian View Post
Maybe try with a lower bitrate to exaggerate the differences. Then it isn't exactly the same situation, but if you start with bitrates that seem transparent then by definition it is going to be really hard to spot any differences.
That's very true! I completely understand what you're saying. All in all, if I use a lower CRF like 16-18, then wouldn't you say that the settings matter as much? From my testing so far, if I give it enough bitrate (typically CRF 16-18) then I can usually use the same settings for each movie and be fine. I haven't noticed too many differences when the bitrate is pretty transparent. I should technically be able to use the same settings for each bluray live action movie unless it is very grainy or animation, right? Also, what are some examples of really grainy movies? Most movies have grain in them and some really grainy scenes but I haven't ran into too many that are just crazy grainy. Probably like 60s, 70s, 80s movies mainly? On really grainy movies I should be able to just increase the qcomp a bit and lower aq-strength from my typical live action value. Thanks
StormMeows is offline   Reply With Quote
Old 18th July 2021, 10:17   #10  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Test and compare to tune and check effects of settings are difficult, because... If bitrate is too high (or result is too good) differences are hard to see. Opposite is also true, if bitrate is too low (or result too bad). You have to find the threshold bitrate, where things are not too good and not too bad, to be able to realy see if any change setting has significant effect. It's realy not easy.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 18th July 2021, 15:21   #11  |  Link
StormMeows
Registered User
 
Join Date: May 2020
Posts: 74
Quote:
Originally Posted by jpsdr View Post
Test and compare to tune and check effects of settings are difficult, because... If bitrate is too high (or result is too good) differences are hard to see. Opposite is also true, if bitrate is too low (or result too bad). You have to find the threshold bitrate, where things are not too good and not too bad, to be able to realy see if any change setting has significant effect. It's realy not easy.
Thank you for the detailed reply. I agree, if it looks transparent, the settings don't seem to have much effect on it. This is why I just use the highest CRF I can get away with that's still transparent to the source and call it a day. For the really grainy movies where my typical CRF 17 -18 don't work, should I do a really high CRF like 22 or will that ruin transparency? I have noticed with really grainy movies if you use a typical lower CRF, the bitrate is WAY too high. In that case, I have 2 options.. either use a CRF of like 22-24 or switch to 2 pass and set my own bitrate for it. Thoughts? Thank you
StormMeows is offline   Reply With Quote
Old 29th July 2021, 07:24   #12  |  Link
orion44
None
 
orion44's Avatar
 
Join Date: Jul 2007
Location: The Background
Posts: 303
Quote:
Originally Posted by StormMeows View Post
Normal Live Action Modern Movies - deblock -3:-3, q comp between .6-.65, IP Ratio 1.3, PB Ratio 1.2, AQ Mode 3, AQ Strength .8, Psy-RDO- between 1 and 1.05.

Please let me know your thoughts on how I can better dial in aq-strength, psy-rdo, qcomp, ip/pb ratio, and even CRF values.
Those are great settings, similar to what I use for most of my Blu-ray 1080p backups.

I don't change q comp, IP Ratio, PB Ratio, Psy-RDO, I leave them at their defaults.

Here are my settings that I use for most of my Blu-ray live action movie backups:

Code:
C:
cd "C:\FFmpeg 2019\bin"
ffmpeg.exe -i "D:\Project\AviSynth Scripts\BluRay.avs" -codec:v libx264 -preset slower -crf 20 -deblock -3:-3 -aq-mode 3 -aq-strength 0.6 -g 240 -keyint_min 24 -x264-params no-dct-decimate=1:no-mbtree=1 -an D:\Project\Output.mp4
pause

Last edited by orion44; 3rd August 2021 at 11:01.
orion44 is offline   Reply With Quote
Old 29th August 2021, 15:54   #13  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 182
Completely pointless to use x264 on 1080p bluray and to expect a bluray transparent file which won't have 90% of the original file size.
takla is offline   Reply With Quote
Old 29th August 2021, 19:27   #14  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by takla View Post
Completely pointless to use x264 on 1080p bluray and to expect a bluray transparent file which won't have 90% of the original file size.
Not necessarily.
Bluray encodes need to respect a whole bunch of things which harm compression, like --keyint 24 --ref 4 etc.
The thing about the GOP etc were implemented to make life easier for hardware decoders but when you're re-encoding for your own personal use you might just not care about those if you're planning to watch them on your computer with a powerful enough CPU.
Therefore, even something as simple as --preset placebo --ref 16 --me esa --subme 11 and no restrictions to the GOP / keyframe about having 1 keyframe per second allows the user to save space.
And of course, there's the bitrate question: specifying a --crf is a much more efficient way than using a two pass VBR encode with vbv/maxrate constraints to stay within the maximum allowed bitrate like the one used by the studios, also 'cause I've noticed that some studios (I'm looking at you, Aniplex) encoded at CBR 1 pass with a certain number of lookahead frames and never looked back.

Sure, it's not gonna be such a huge reduction and sure, you're always gonna lose something 'cause it's the lossy of the lossy, but still, cutting out x264 to re-encode official BDs only 'cause there's x265 seems a bit harsh eheheheh

Last edited by FranceBB; 29th August 2021 at 19:30.
FranceBB is offline   Reply With Quote
Old 29th August 2021, 19:47   #15  |  Link
rwill
Registered User
 
Join Date: Dec 2013
Posts: 343
Quote:
Originally Posted by FranceBB View Post
And of course, there's the bitrate question: specifying a --crf is a much more efficient way than using a two pass VBR encode with vbv/maxrate constraints to stay within the maximum allowed bitrate like the one used by the studios, also 'cause I've noticed that some studios (I'm looking at you, Aniplex) encoded at CBR 1 pass with a certain number of lookahead frames and never looked back.
1 pass CBR is a valid option if the encoder does not benefit from multiple passes when in CBR mode. Can x264 benefit from multiple passes when the bitrate control mode is CBR ?
rwill is offline   Reply With Quote
Old 31st August 2021, 10:32   #16  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by rwill View Post
1 pass CBR is a valid option if the encoder does not benefit from multiple passes when in CBR mode. Can x264 benefit from multiple passes when the bitrate control mode is CBR ?
Yep, I know, but in all my tests with x264, it actually does benefit from 2 passes even when in CBR compared to just using a lookahead, while 3 passes were totally useless.
FranceBB 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 11:40.


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