Log in

View Full Version : What does "quality per bit" ratio translate to in CRF encoding?


Makaveli84
13th September 2014, 21:37
I read this in another thread:
Video compression always is a trade-off between quality (compression artifacts) and file size (bitrate). Though using "slower" settings can improve the "quality per bit" ratio.

When encoding in CRF, using slower (= higher quality) settings/presets, the higher "quality per bit" ratio leads to:

a) A smaller file size then a similar CRF encode with faster settings/presets.

or

b) An equal sized file with a better perceived quality then a similar CRF encode with faster settings/presets.


Which is it, (a) or (b)?

LoRd_MuldeR
13th September 2014, 22:58
In general: A higher bitrate results in larger file and better quality. Conversely, a lower bitrate results in smaller file and worse quality.

Though that only applies as long as you do not change other influential encoder settings!

By using "slower" encoder settings, you can squish out better quality at the same bitrate/filesize, i.e. it improves the "quality per bit" ratio. Conversely, using "faster" settings will result in worse quality at the same bitrate/filesize.

This also applies to CRF mode: Given that two CRF encodes happen to come out at the same bitrate, the file that was created with "slower" settings will have better quality than the one that was created with "faster" settings.

However be aware that, if you switch between "fast" and "slow" encoder settings, the same CRF value will probably no longer result in the same bitrate/filesize! So it's neither exactly (a) nor exactly (b) ;)

See also:
http://forum.doom9.org/showpost.php?p=1692606&postcount=61

Makaveli84
13th September 2014, 23:42
First, let me just say that Doom9 feels like a magic lantern and LoRd is its resident genie! :D

Now, back to business.. Unfortunately, for me, that means back to square one! :(

Slower settings/presets lead to better quality, but also a different (and I suppose higher) bitrate when encoding in CRF mode. Is that right?

LoRd_MuldeR
13th September 2014, 23:47
Slower settings/presets lead to better quality

Yes. At least if you mean better quality at the same bitrate (file size).

but also a different (and I suppose higher) bitrate when encoding in CRF mode. Is that right?

Yes. At least if you mean different bitarte at the same CRF value.

Though I'm not sure the bitrate will necessarily come out higher. Might also come out lower. Should not make any presumptions here.

Makaveli84
14th September 2014, 00:24
Yes, and yes, that's what I meant.

As for the effect of different encoding settings/presets on a fixed CRF value, is it safe to say that slower settings/presets lead to better decisions (i.e. bit-distribution), and hence a higher "quality per bit" ratio, though these different settings have an unpredictable effect on bit-allocation for a fixed CRF value?


And here comes a really tough question: is there a predictable maximum percentage value of a bitrate's fluctuation (let it be up or down) for fixed value CRF encodes when going from "medium" to "slow" or "very slow" settings/presets?

LoRd_MuldeR
14th September 2014, 01:58
As for the effect of different encoding settings/presets on a fixed CRF value, is it safe to say that slower settings/presets lead to better decisions (i.e. bit-distribution), and hence a higher "quality per bit" ratio, though these different settings have an unpredictable effect on bit-allocation for a fixed CRF value?

That's pretty much it.

And here comes a really tough question: is there a predictable maximum percentage value of a bitrate's fluctuation (let it be up or down) for fixed value CRF encodes when going from "medium" to "slow" or "very slow" settings/presets?

Nope, not that I'm aware. I suggest you evaluate the differences between the various Presets in 2-Pass mode, at a fixed target bitrate.

But be careful to not choose your bitrate too high for this test! If you choose a bitrate where "Medium" looks great already, then how could "Slow" or "Very Slow" look even better?

Once you have figured out the slowest Preset you are willing to accept, simply stick with that Preset, go back to CRF mode and fine-tune your CRF value.

Makaveli84
20th September 2014, 18:49
That's pretty much it.



Nope, not that I'm aware. I suggest you evaluate the differences between the various Presets in 2-Pass mode, at a fixed target bitrate.

But be careful to not choose your bitrate too high for this test! If you choose a bitrate where "Medium" looks great already, then how could "Slow" or "Very Slow" look even better?

Once you have figured out the slowest Preset you are willing to accept, simply stick with that Preset, go back to CRF mode and fine-tune your CRF value.

Thx for the suggestion Lord. I'm set with the "slower" preset and am fine tuning the CRF value now. I'm pretty happy with 24 coupled with the slow settings, but greedy as I am, I'm looking to see if I can get away with 25! :cool: