Trying to understand RF and bitrate
Trying to understand RF and bitrate
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?
- JohnAStebbins
- HandBrake Team
- Posts: 5712
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Trying to understand RF and bitrate
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.
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.
Re: Trying to understand RF and bitrate
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.
Re: Trying to understand RF and bitrate
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.
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.
Re: Trying to understand RF and bitrate
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).
Re: Trying to understand RF and bitrate
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.
- JohnAStebbins
- HandBrake Team
- Posts: 5712
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Trying to understand RF and bitrate
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.