RF and File Size

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

RF and File Size

Post by CraigHB »

Hello, first post here.

Been using Handbrake a while (great software BTW) and I'm having a bit of an issue with something. What I'd like to do it target a file size using Constant Quality. Right now the only way I can see to do that is with trial and error. I don't want to use Average Bitrate because from what I understand image quality can vary and I don't want that.

Is there a way to calculate the correct Constant Quality RF number for a target file size without resorting to trial and error?
rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: RF and File Size

Post by rollin_eng »

No, Constant Quality means just that. Bitrate will vary to maintain a certain quality.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: RF and File Size

Post by mduell »

The size will vary from movie to movie depending on the length and complexity of encoding it. Grainy high motion scenes like Saving Private Ryan take a lot more bits to get the same quality than clean slow moving scenes like The Social Network.

Encode a variety of movies to see what size you typically get on average and adjust from there. Rule of thumb is changing RF by 6 points will double or halve the size.
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

Re: RF and File Size

Post by CraigHB »

Thanks, I understand that, but file size varies with RF and I'd like to select an RF that arrives at a file size within some range.
Deleted User 11865

Re: RF and File Size

Post by Deleted User 11865 »

For the same output bitrate, 2-pass average bitrate and constant RF are the same (only a computer could tell the two apart). The difference is, you cannot predict file size when using CRF, but you cannot predict quality when using 2-pass ABR.
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

Re: RF and File Size

Post by CraigHB »

I can't see where to edit the posts here. Wanted to add that I'd like to be able to find the resulting file size of a video without having to actually encode it. Thought maybe there might be a tool to do that or something. So I guess I'm stuck with encoding a movie at various RF values to see how they come out (trial and error).
rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: RF and File Size

Post by rollin_eng »

If you want a fixed size use 2 pass ABR.
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

Re: RF and File Size

Post by CraigHB »

Rodeo wrote: Tue Jul 23, 2019 7:03 pmFor the same output bitrate, 2-pass average bitrate and constant RF are the same (only a computer could tell the two apart). The difference is, you cannot predict file size when using CRF, but you cannot predict quality when using 2-pass ABR.
So that brings up a point I'm not clear on with Average Bitrate. From what I understand bitrate varies depending on what's happening from frame to frames. Does Average Bitrate allow those fluctuations or does it throttle quality to maintain a constant bitrate at any small interval?

Thing is if the quality is not all over the place with Average Bitrate, then I could just use that. But everything I read says not to use it unless you have an actual bitrate restriction, which I don't.
rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: RF and File Size

Post by rollin_eng »

If you don’t have bitrate restrictions why are you trying to restrict the bitrate?
User avatar
BradleyS
Moderator
Posts: 1860
Joined: Thu Aug 09, 2007 12:16 pm

Re: RF and File Size

Post by BradleyS »

RF naturally varies greatly with the source material's complexity, so you'll be stuck with trial and error for every source. If you really care about size, 2-pass average bit rate will still allow quality to vary while maintaining an overall average bit rate, hence its name and purpose.
Deleted User 11865

Re: RF and File Size

Post by Deleted User 11865 »

CraigHB wrote: Tue Jul 23, 2019 7:18 pm
Rodeo wrote: Tue Jul 23, 2019 7:03 pmFor the same output bitrate, 2-pass average bitrate and constant RF are the same (only a computer could tell the two apart). The difference is, you cannot predict file size when using CRF, but you cannot predict quality when using 2-pass ABR.
So that brings up a point I'm not clear on with Average Bitrate. From what I understand bitrate varies depending on what's happening from frame to frames. Does Average Bitrate allow those fluctuations or does it throttle quality to maintain a constant bitrate at any small interval?
You're thinking of Constant Bitrate. 1-pass Average Bitrate also has some restrictions by not knowing video oroperties ahead of time, but 2-pass ABR and Constant RF are equivalent (except each serve a different purpose).
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

Re: RF and File Size

Post by CraigHB »

Okay, thanks for the replies people.

It sounds like 2 pass Average Bit rate is what I'm looking for. If quality holds fairly constant from frame to frame I'll be good with that. I just didn't want to have quality go way down for higher bitrate sections of the video compared to lower bitrate sections.
Deleted User 13735

Re: RF and File Size

Post by Deleted User 13735 »

Time (Sec) x Bitrate (Mbps) x .125 = File Size (MB)
Bitrate means Average video bitrate plus the sum of audio bitrates.

Unless you need a constrained bandwidth for streaming and broadcast servers, there is no need to know the exact bitrate. Storage size is no longer an issue.
mduell
Veteran User
Posts: 8198
Joined: Sat Apr 21, 2007 8:54 pm

Re: RF and File Size

Post by mduell »

CraigHB wrote: Wed Jul 24, 2019 12:42 amIt sounds like 2 pass Average Bit rate is what I'm looking for. If quality holds fairly constant from frame to frame I'll be good with that. I just didn't want to have quality go way down for higher bitrate sections of the video compared to lower bitrate sections.
Frame to frame is consistent with 2 pass (well, subject to the x264 psychovisual model), but movie to movie variation will still occur.
CraigHB
Posts: 6
Joined: Tue Jul 23, 2019 6:02 pm

Re: RF and File Size

Post by CraigHB »

Yeah I expect that movie to movie quality will vary. Thing is I want to store a bunch of movies on my laptop computer's SSD and I don't have a huge amount of space on that drive. I want movie files to be more on the smaller side without getting too much visual loss. I end up doing trial and error with Constant Quality which becomes time consuming. I've tried a few now with 2 pass Average Bitrate and it seems to be doing what I want. I think that will work for me.
rollin_eng
Veteran User
Posts: 4854
Joined: Wed May 04, 2011 11:06 pm

Re: RF and File Size

Post by rollin_eng »

If you post your logs we might be able to suggest some settings.
Post Reply