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 6th July 2022, 17:23   #1  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
ipratio/pbratio for very high bitrates

Hi,
I would like to make a preset for a "visually lossless" quality (or almost) for archive purposes and to keep well preserved sources if I have to re-encode for whatever reason (editing...).
I'm aiming for "DVD-like" bitrates for SD (5000-9000 Kbps) mainly for my VHS project, and higher bitrates for 720p sources (15-20 Mbps).

I did some tests (with 3 bframes + no-mbtree) by keeping ipratio and pbratio defaults values and by lowering them, and each case seem to have its pros and cons so I can't decide what to choose. I don't really like playing with Quantizers-related settings (most of time, the result wasn't really satisfying to me) and I want to make sure I do things right since I'll get rid of the lossless material.

So I'm wondering :

- Could lowering pbratio to 1.1 in this context cause some issues ? (Maybe it's for good reason that no preset/tune lowers ipratio only or pbratio only.).

- Is it a good thing to use ipratio 1.1 + pbratio 1.1 (like in grain tune) for these bitrates ranges (or at least better than using 0 b-frames ?)


Any other advices that can help are welcome

Thank you

Last edited by andiandi; 7th July 2022 at 15:28.
andiandi is offline   Reply With Quote
Old 6th July 2022, 23:15   #2  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,197
Quote:
- Is it a good thing to use ipratio 1.1 + pbratio 1.1 (like in grain tune) for these bitrates ranges (or at least better than using 0 b-frames ?)
I am aiming at the same bitrates for the same occasion,
use close to that (ipratio 1.2, pbratio 1.1) all the time in my presets and limit qpmax to 48
and I can recommend that for your case.
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."
Emulgator is offline   Reply With Quote
Old 7th July 2022, 15:26   #3  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by Emulgator View Post
I am aiming at the same bitrates for the same occasion,
use close to that (ipratio 1.2, pbratio 1.1) all the time in my presets and limit qpmax to 48
and I can recommend that for your case.
Thanks,

Seems good to me, because according to my tests, ipratio 1.1 + pbratio 1.1 quality seems a bit insufficient and for defaults ipratio & pbratio values, there's still often a slight blur. As for qpmax 48, is it that useful ? IIRC default qpmax was changed because of mbtree, but is qpmax 51 (the older default value) alright for these bitrates as well ? (I'm wondering because 48 and 51 are close).

Last edited by andiandi; 7th July 2022 at 15:29.
andiandi is offline   Reply With Quote
Old 7th July 2022, 22:37   #4  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,197
It is your choice. I was just aiming for best Blu-ray quality at blu-ray bitrates.
So I just decided not to allow too much quantization because of water, leaves, hair and such.

You may decide any limiting qp value depending on what bitrate overshoot your playback device can handle.
You may consider limiting gpmax below 40 if more quality is your goal, and not go for bitrate.
(Lowering ipratio, pbratio helps in reducing GOP pumping, not necessarily against blur.
If you encounter blur it may be quantization artifacts already and you just limit that by lowering qpmax see above.
Lowering qpmax just lets encoder spend more bits where hard-to compress content needs it, not looking at bitrate.
while allowing high qpmax allows butchering to stay in bitrate constraints,
and 51 is already too high for me, and 69 is insanely poor,
and I considered 48 good enough while not pushing bitrate too high.
For a mezzanine you may set qpmax far below.)
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."

Last edited by Emulgator; 7th July 2022 at 22:44.
Emulgator is offline   Reply With Quote
Old 8th July 2022, 16:19   #5  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by Emulgator View Post
It is your choice. I was just aiming for best Blu-ray quality at blu-ray bitrates.
So I just decided not to allow too much quantization because of water, leaves, hair and such.

You may decide any limiting qp value depending on what bitrate overshoot your playback device can handle.
You may consider limiting gpmax below 40 if more quality is your goal, and not go for bitrate.
(Lowering ipratio, pbratio helps in reducing GOP pumping, not necessarily against blur.
If you encounter blur it may be quantization artifacts already and you just limit that by lowering qpmax see above.
Lowering qpmax just lets encoder spend more bits where hard-to compress content needs it, not looking at bitrate.
while allowing high qpmax allows butchering to stay in bitrate constraints,
and 51 is already too high for me, and 69 is insanely poor,
and I considered 48 good enough while not pushing bitrate too high.
For a mezzanine you may set qpmax far below.)

Ok, it's very interesting because the only thing that bothers me a bit is this slight blur with default ipratio and pbratio values. So if i can compensate this with qpmax I could stick to default values since I prefer their result overall if exclude the blur.

However, I'll possibly have to change ipratio & pbratio since I'd like to lower keyint to make lossless cutting easier, just in case (I don't plan to lower it that much - maybe 1 keyframe each 2/2.5 seconds ideally, or 5 seconds). So in this context, I'm wondering if it could cause that "GOP pumping" ? (It's when the visual quality variation between frames become too much noticeable when keyframes are very close, right ?).

Also, I would be interested to know if they're other settings that could reduce this slight blur while suiting these bitrates at the same time ? (I thought about lowering Aq-strengh but from several tests I did, I'm not really convinced so far).
andiandi is offline   Reply With Quote
Old 12th July 2022, 13:55   #6  |  Link
Boulder
Pig on the wing
 
Boulder's Avatar
 
Join Date: Mar 2002
Location: Finland
Posts: 5,429
You could try disabling mbtree to see if it helps with the blurring.
__________________
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 12th July 2022, 15:59   #7  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by Boulder View Post
You could try disabling mbtree to see if it helps with the blurring.

Yes, I disabled it, I lowered aq-strenght to 0.5 as well and it helps a lot. The blur is almost entirely gone. However, I'm very careful about how it looks since I want to make potential sources for re-encoding. So I'm still hesitating between :

- "Aq-strength 0.5 + lowering ipratio & pbratio + qcomp 0.8" (very homogeneous quality even though it seems slightly insufficient even at these bitrates; it's particularly noticeable on colors and since I want to encode in 4:2:2 Chroma subsampling I think compression is quite important).

- "Aq-strength 0.5 + default ipratio & pbratio" (almost no blur at all and very satisfying quality, but i'm not sure if quality could vary much or not and if "gop pumping" could be noticeable at these bitrates - especially if i lower keyint).

Last edited by andiandi; 12th July 2022 at 16:09.
andiandi is offline   Reply With Quote
Old 12th July 2022, 19:17   #8  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,225
Quote:
Originally Posted by andiandi View Post
Yes, I disabled it, I lowered aq-strenght to 0.5 as well and it helps a lot. The blur is almost entirely gone. However, I'm very careful about how it looks since I want to make potential sources for re-encoding. So I'm still hesitating between :

- "Aq-strength 0.5 + lowering ipratio & pbratio + qcomp 0.8" (very homogeneous quality even though it seems slightly insufficient even at these bitrates; it's particularly noticeable on colors and since I want to encode in 4:2:2 Chroma subsampling I think compression is quite important).

- "Aq-strength 0.5 + default ipratio & pbratio" (almost no blur at all and very satisfying quality, but i'm not sure if quality could vary much or not and if "gop pumping" could be noticeable at these bitrates - especially if i lower keyint).
frame strobing (aka "gop pumping" which I think is a confusing name) can be detected somewhat well by comparing SSIM values between I, P, and B frames (--ssim, --csv-log-level 2). There should be very little variation when there isn't any strobing.

If you are having chroma issues, you could lower both chroma qp values to -1. It'll bump bitrate a bit, of course.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 12th July 2022, 21:57   #9  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by benwaggoner View Post
frame strobing (aka "gop pumping" which I think is a confusing name) can be detected somewhat well by comparing SSIM values between I, P, and B frames (--ssim, --csv-log-level 2). There should be very little variation when there isn't any strobing.

If you are having chroma issues, you could lower both chroma qp values to -1. It'll bump bitrate a bit, of course.
Ok, thank you.

I tried but --csv-log-level 2 isn't working with x264, it appears to be an x265 option.
andiandi is offline   Reply With Quote
Old 13th July 2022, 03:52   #10  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,225
Quote:
Originally Posted by andiandi View Post
Ok, thank you.

I tried but --csv-log-level 2 isn't working with x264, it appears to be an x265 option.
Oh, right. I keep forgetting which is which as x264 hasn't gotten new parameters in a long time. I'd love to see the csv logging patch make it into mainline. IIRC, MCW contributed it to x264 many years back.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 13th July 2022, 19:35   #11  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by benwaggoner View Post
Oh, right. I keep forgetting which is which as x264 hasn't gotten new parameters in a long time. I'd love to see the csv logging patch make it into mainline. IIRC, MCW contributed it to x264 many years back.
Regarding this SSIM values test (supposing it could be done) I wonder if the result could be generalized to most videos at these bitrates (in theory) or if it only concerns the tested video ? Because I prefer having a preset I re-use in any case without having to check that frame strobbing/GOP Pumping.
Otherwise, I think it'd be better to improve the preset with lowered ipratio & pbratio (I still can't decide but colors are better preserved using Qcomp 0.6 or a bit more instead of 0.8 - which seems to hurt much compression in this context).
andiandi is offline   Reply With Quote
Old 14th July 2022, 17:20   #12  |  Link
Emulgator
Big Bit Savings Now !
 
Emulgator's Avatar
 
Join Date: Feb 2007
Location: close to the wall
Posts: 1,197
If comparing more than 2..3 parameters Zopti is your friend.
https://forum.doom9.org/showthread.php?t=176076
__________________
"To bypass shortcuts and find suffering...is called QUALity" (Die toten Augen von Friedrichshain)
"Data reduction ? Yep, Sir. We're working on that issue. Synce invntoin uf lingöage..."

Last edited by Emulgator; 14th July 2022 at 17:23.
Emulgator is offline   Reply With Quote
Old 15th July 2022, 01:01   #13  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,225
Quote:
Originally Posted by andiandi View Post
Regarding this SSIM values test (supposing it could be done) I wonder if the result could be generalized to most videos at these bitrates (in theory) or if it only concerns the tested video ?
It's a generalized recommendation.

Ugh, the lack of per-frame .csv logging in x264 mainline is such a drudge. It's a very powerful tuning and QA tool with x265.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 15th July 2022, 16:11   #14  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by Emulgator View Post
If comparing more than 2..3 parameters Zopti is your friend.
https://forum.doom9.org/showthread.php?t=176076
Interesting, I'll look it up, thanks.
Quote:
Originally Posted by benwaggoner View Post
It's a generalized recommendation.

Ugh, the lack of per-frame .csv logging in x264 mainline is such a drudge. It's a very powerful tuning and QA tool with x265.
Ok, it should help me choose which preset I'll keep if I can make both presets closer between them.
If there're other settings that could help even more in this case (without really hurting compression) please let me know, thanks.
andiandi is offline   Reply With Quote
Old 17th July 2022, 01:12   #15  |  Link
takla
Registered User
 
Join Date: May 2018
Posts: 135
Or you can use this to compare
takla is offline   Reply With Quote
Old 17th July 2022, 17:49   #16  |  Link
andiandi
Registered User
 
Join Date: Aug 2017
Posts: 39
Quote:
Originally Posted by takla View Post

Thanks, now I'm pretty sure to prefer the preset that has ipratio and pbratio lowered + aq-strenght 0.5 (which I'm still trying to perfect a bit even though it's already satisfying), but this program interests me much, thanks again
andiandi 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 17:51.


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