Trying to understand RF and bitrate

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
curious d
Posts: 6
Joined: Sun May 06, 2018 3:37 pm

Trying to understand RF and bitrate

Post by curious d » Fri Jun 15, 2018 5:57 am

Hello. I was fiddling with the settings while transcoding a video file. I noticed that when I set the RF value to 25 for a particular file while setting the Encoder Preset to Slow, the output file had a video bitrate that was 1927 kb/s. When I set the RF value to 24 for the same file and the Encoder Preset to VerySlow, the output file had a video bitrate of 1952 kb/s. The file size was about the same. I had understood that the lower the RF value, the better the video quality. However, if the video bitrate is about the same, isn't the video quality about the same as well? I feel like the second transcoding took longer for the same quality despite the change in RF setting. What am I missing?

User avatar
JohnAStebbins
HandBrake Team
Posts: 5214
Joined: Sat Feb 09, 2008 7:21 pm

Re: Trying to understand RF and bitrate

Post by JohnAStebbins » Fri Jun 15, 2018 2:37 pm

You can't compare settings across presets. The only thing you can say after changing a preset is that if all the other settings are the same, the results will be approximately the same with slower presets generally providing better quality and/or smaller file size, but sometimes better quality and larger file size. It's a bit of a flip of a coin whether you'll get better quality or smaller file size in these circumstances.

So in your particular example, what probably happened is this. Changing from Slow to VerySlow resulted in better quality and a somewhat smaller file size. Then changing the RF from 25 to 24 increased the quality yet again while also increasing the size to be the same as your original Slow encode.

Bitrate has very little to do with quality. Better (which usually means slower) encoding settings result in higher quality at lower bitrates.

curious d
Posts: 6
Joined: Sun May 06, 2018 3:37 pm

Re: Trying to understand RF and bitrate

Post by curious d » Mon Jun 18, 2018 3:46 am

Thank you. That would explain why setting the Encoder Preset to VerySlow reduces file size and bitrate if the RF value is constant. If bitrate doesn't help determine quality, how does one objectively measure the quality of a video file? Is it more a subjective thing? I had always thought bitrate was tied to quality given that the original files had very high bitrates.

Woodstock
Veteran User
Posts: 2765
Joined: Tue Aug 27, 2013 6:39 am

Re: Trying to understand RF and bitrate

Post by Woodstock » Mon Jun 18, 2018 5:25 am

Think of it more as, the more effort you put into encoding the video, the fewer bits it takes to convey the information.

That works "to a point", where the effort to encode becomes ridiculous. Such as the latest codecs that can take a month to encode a 10-second video, but it makes it REALLY small.

curious d
Posts: 6
Joined: Sun May 06, 2018 3:37 pm

Re: Trying to understand RF and bitrate

Post by curious d » Mon Jun 18, 2018 7:35 am

Ok. I think I understand. Is there a way to gauge this objectively and quickly since file size and bitrate doesn't necessarily convey quality? In the end, I understand that it boils down to a more subjective observation (ie. does it look good enough to me).

mduell
Veteran User
Posts: 6153
Joined: Sat Apr 21, 2007 8:54 pm

Re: Trying to understand RF and bitrate

Post by mduell » Mon Jun 18, 2018 4:12 pm

curious d wrote:
Mon Jun 18, 2018 3:46 am
If bitrate doesn't help determine quality, how does one objectively measure the quality of a video file? Is it more a subjective thing?
Real video quality is subjective.

There are some objective metrics, like PSNR or SSIM, but if you optimize for them you will produce worse looking video at the same bitrate.

User avatar
JohnAStebbins
HandBrake Team
Posts: 5214
Joined: Sat Feb 09, 2008 7:21 pm

Re: Trying to understand RF and bitrate

Post by JohnAStebbins » Mon Jun 18, 2018 5:18 pm

PSNR and SSIM metrics can be generated in the activity log during encoding if you want to see them (see the PSNR and SSIM tune options on the video tab). But they are primarily used to tune algorithms during development and should not be used for encodes you plan to keep because as mduell said, tuning *only* for these metrics can lead to worse subjective quality. When the tune option is set to PSNR or SSIM, subjective quality will suffer.

Post Reply