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 19th November 2018, 11:41   #1  |  Link
TEB
Registered User
 
Join Date: Feb 2003
Location: Palmcoast of Norway
Posts: 357
CRF question

hi! Ive been doing alot of test encodes on CRF lately and i find it using way to low bitrate on average than i would prefer..
My principle behind the encoding has been the focus is quality, but not waste bits thats not needed given a quality level (like static VBR will do).

CRF22, for me is a bit low quality on some titles (prores source), and even CRF20 looks a bit daft and triggers a 2-3mbps avg bitrate..
But on noisy sources the bitrate like spikes to like 20-30mbps...

The strange thing is the VMAF scores are like 98-99 in average and some dips into the sub 95s..

So the question is: anyone know if its possible to tune CRF against non-noise focused PQ?
Or should i just offset it all down to a lower CRF value and cap it ?
Like CRF18 with a 15mbps cap ?

TEB
TEB is offline   Reply With Quote
Old 20th November 2018, 10:03   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,473
These days, when film/video is commonly shot using digital cameras, I'm still sometimes surprised at how low the bitrate can be when there's no film grain to compress (usually CRF16-18 and Tune Film, in my case).

I prefer to remove the noise when possible, although I guess that's another topic, but I'd be using a lower CRF value for everything and a noise filter as required.

Last edited by hello_hello; 20th November 2018 at 12:56.
hello_hello is offline   Reply With Quote
Old 22nd November 2018, 20:30   #3  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Metropolitan City of Milan, Italy
Posts: 1,412
I generally use CRF 18 and --vbv-maxrate 25000 to limit it, even though it rarely hits 25Mbit/s.
If you wanna let x264 adjust the bitrate in a slightly different way on certain type of scenes 'cause you are not pleased with the perceived picture quality, you can play with aq-mode, aq-strength and psy-rd.
--aq-mode lets you choose which mode to use; try with --aq-mode 2.
--aq-strength can have a significant impact on the perceived quality; try to set a value of 0.6.
Then it's up to you.
The whole thing about --aq-strength is "whatever works best for your source", but generally an high --aq-strength tries to retain gradients as much as possible, but it's prone to introduce ringing, while a low --aq-strength preserves edges but it's prone to introduce banding.
As to --psy-rd, try to set it to 0.9
The higher you raise --psy-rd, the more sharp the picture will be, but the more artifacts you might introduce.

Anyway, keep in mind that a slower preset like placebo or veryslow will achieve the same quality using less bitrate by using things like a more complex motion estimation, allowing a better prediction and so on.
Last but not least, as hello_hello said, some movies may have grain and if you wanna preserve it, you are gonna need bitrate and --tune grain does a very good job in retaining grain.
Whenever I get grain, I do filter it out at 16bit precision and then I add a debanding filter in order to limit banding. But again, even though filters are very complex nowadays, it's always a tradeoff: you get rid of grain, you get banding.
It always comes down to finding a "sweet spot".

Last edited by FranceBB; 22nd November 2018 at 20:33.
FranceBB is offline   Reply With Quote
Old 23rd November 2018, 10:17   #4  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 1,901
Also try --aq-mode 3, it produces (at least it's theoricaly what this mode has made been for) better result in dark scenes than aq-mode 2.
__________________
My github.
jpsdr is offline   Reply With Quote
Old 23rd November 2018, 23:06   #5  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 3,630
Quote:
Originally Posted by TEB View Post
The strange thing is the VMAF scores are like 98-99 in average and some dips into the sub 95s..
VMAF isn't good at discriminating between clips at high quality. And it's not great at picking up some classes of artifacts, like banding in low luma areas.

Quote:
So the question is: anyone know if its possible to tune CRF against non-noise focused PQ?
Or should i just offset it all down to a lower CRF value and cap it ?
Like CRF18 with a 15mbps cap ?
Fire-and-forget settings are hard, since content varies so much. And the same title with/without film grain may take >>2x the bitrate to look good with the grain. The peaks you describe may be x264 doing what you've asked.

I always recommend setting vbv-bufsize and vbv-maxrate, to the max allowed by your Profile @ Level if nothing else. That'll maintain compatibility with HW decoders, and prevent crazy high spikes like you describe. In practice, they're all random noise and those extra bits might not be that psychovisually important.

Throwing a little -nr (50-250) can help knock out a little of the random motion of grain, saving bits and reducing swirling and other grain annoyances.

It'd be helpful if you could share your whole command line. The optimal CRF can shift based on other settings.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner 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 08:38.


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