Handbrake: How do people calculate RF values?

Avatar image for ezekiel
#1 Edited by Ezekiel (2257 posts) -

I've been compressing most of movies using average bitrate instead of the RF slider, because I know exactly how the file is going to be. But recently, I read that using the RF slider brings out more consistent quality, since the bitrate shouldn't be constant. I have a movie that I don't want any quality loss with, one more important than most of my collection. All I want to do is remove the letterboxes. So I compressed with an RF value of 12. The compressed MP4 of the 25,000 kbps video ended up being twice as big. I wasted over ten hours. How do I calculate it? What RF value would I choose for this video?

Also, how much have I ruined my film collection by using average bitrate (18-22 MB) instead of the slider and using Main profile 4.0 instead of High 4.1? I did always compare the my compressed file with the raw, but I had no idea it could look even better.

Avatar image for hamst3r
#2 Posted by Hamst3r (5480 posts) -

I have the RF on 18 most of the time and it looks great and I use the tuning presets as they seem to do a lot. For older grainier anime I use an RF of 16 and the grain tuning. The files are bigger than my encodes of newer cleaner anime, but that's okay. I went with 18 because it was the best quality setting of the suggested ranges.

Avatar image for retrometal
#3 Posted by RetroMetal (871 posts) -

Don't pirate movies.

:-)

Avatar image for colourful_hippie
#4 Posted by colourful_hippie (5913 posts) -

@retrometal: you know that many people use handbrake to rip the dvds and blurays they own right?

Avatar image for retrometal
#5 Posted by RetroMetal (871 posts) -

And many pirate movies, what's your point?

Avatar image for facelessvixen
#6 Posted by FacelessVixen (2668 posts) -

Maybe I'm crazy, but I like having the RF around 9 for DVDs to try to have the things as 1:1 as possible since I edit video on occasion. I'm sure that setting the x264 preset to Very Slow, the H.264 Profile to High, the H.264 Level to 4.1, and going to the Filters tab and setting the Deinterlace setting to Deinterlace Slower works to my advantage. With those settings, my rips were usually a little above 3 Mb/s at 480p and 29.7 fps. I imagine that you can ease up on the RF if you're ripping Blu-rays; maybe RF 14 or 15 for those if you're shooting for around 15 Mb/s at 1080p and 29.7 fps.

It's just one of those things that you have to get feel for as opposed to looking for a calculator, at least in my experience: finding a good balance between bitrate, resolution, frame rate.

Avatar image for mordukai
#7 Posted by mordukai (8516 posts) -

@retrometal: Your post just came off as if you immediately assumed the OP has been pirating his video collection, that's all.

Avatar image for retrometal
#8 Posted by RetroMetal (871 posts) -

Nope, I was just commenting in general. Didn't accuse anyone of anything.

Avatar image for baillie
#10 Posted by Baillie (4711 posts) -
Avatar image for deactivated-5a0917a2494ce
#11 Posted by deactivated-5a0917a2494ce (1350 posts) -

@ezekiel: there's no one answer that will fit your needs. I don't even handbrake anymore because of the low cost of storage and services like Amazon Drive, I just dump to MKV and leave it. Generally though you are going to have a hard time distinguishing between 18 and 20 or 21 unless you are very close to the tv. I've watched movies that are 8 megabit and 26 megabit and I really didn't notice much difference. If you're concerned about quality, just buy storage and leave the rips in an MKV format.

Avatar image for marz
#12 Posted by Marz (6095 posts) -

mess with the x264 preset setting, very slow will always give the best compression(placebo squeezes more but I don't think it's worth the added time) at the CRF quality you set

Avatar image for ezekiel
#13 Posted by Ezekiel (2257 posts) -

@ezekiel: there's no one answer that will fit your needs. I don't even handbrake anymore because of the low cost of storage and services like Amazon Drive, I just dump to MKV and leave it. Generally though you are going to have a hard time distinguishing between 18 and 20 or 21 unless you are very close to the tv. I've watched movies that are 8 megabit and 26 megabit and I really didn't notice much difference. If you're concerned about quality, just buy storage and leave the rips in an MKV format.

I watch movies with a monitor, so it's probably easier for me to tell the difference. Before I switched to "average bitrate", I tried out a few RF values and found 20 to reduce the quality too much. The confusing thing is that, looking through old posts of mine, I was using RF 12, which actually reduced the file sizes of some of my Blu-ray copies. Yet it has doubled the size of this video. There's no point in keeping all my movies at such huge sizes and spending more on storage when I can barely tell the difference between good compression and a raw. Though, I wish I had kept the raw backups until I understood Handbrake better.

just buy storage and leave the rips in an MKV format.

I mux with MKVToolNix, so my movies are almost all in MKV containers, including the compressed ones.

Avatar image for viciousreiven
#14 Posted by ViciousReiven (983 posts) -

I tend to stick to the 20-24 range, while using slower more intensive processing, anything under 20 feels like overkill to me but I'm unsure how much the other stuff is affecting quality.

Avatar image for clagnaught
#15 Posted by clagnaught (2140 posts) -

I personally went away from RF quality settings, because it felt inconsistent and there was guess work. Sometimes when I do movie editing projects I use Handbrake primary to convert the size down while keeping the quality (Basically my movie editing program is not the greatest, and final render sizes fluctuate, so I end up making a big file with great quality, and then size it down through Handbrake, as opposed to changing the quality settings and getting crappy audio/visual quality)

What I personally do is go through the bitrate path. If you are still looking into the RF route, a couple of things that might be worth looking into:

  • Set the quality around the low 20's for HD/close to HD size and upper teens for SD. If I remember correctly, the quality spikes up really fast depending on the values, so going from 23 to 25 can be a huge jump, where you get videos with 40,000 kbps bitrate. Most of my videos are either 720p or 1080p, so I don't have a ton of input for SD.
  • It might be worth trying a 2 pass encoding or changing the speeds. My results have been mixed, but I've run this through videos as short as a minute to videos closer to 2 hours; basically a lot of my videos and tests vary drastically in file size, quality needs, etc. For my larger files, fiddling with the bitrate or RF values and the encoding process and speeds do make a difference. In truth, it is probably a combination of all of these factors, with the bitrate being the most important. (Speed alone, as an example, hasn't really made a difference from what I have observed)

Possibly the biggest caveat for you is my primary usage of Handbrake is for rendering videos, not ripping. I just checked a test rip I did a few years ago, and those movies have a bitrate of about 900 kbps, although this was for a DVD, so the quality I got is probably not too far off from the original. (I was mainly testing how to rip a video with the subtitles, I never actually thought about the quality of the rip) I'm not sure if there is any real changes one should make if they were ripping instead of just converting.

Avatar image for ezekiel
#16 Edited by Ezekiel (2257 posts) -

@clagnaught said:

Possibly the biggest caveat for you is my primary usage of Handbrake is for rendering videos, not ripping. I just checked a test rip I did a few years ago, and those movies have a bitrate of about 900 kbps, although this was for a DVD, so the quality I got is probably not too far off from the original. (I was mainly testing how to rip a video with the subtitles, I never actually thought about the quality of the rip) I'm not sure if there is any real changes one should make if they were ripping instead of just converting.

I've actually never ripped with Handbrake. I use MakeMKV.

2-pass encoding only works with average bitrate. I don't know... I might go back to using average bitrate. You saying RF seems inconsistent is making me reconsider. Yeah, it's guess work.

@marz said:

mess with the x264 preset setting, very slow will always give the best compression(placebo squeezes more but I don't think it's worth the added time) at the CRF quality you set

I always use "slower," which is already almost too long.

Avatar image for clagnaught
#17 Posted by clagnaught (2140 posts) -

@ezekiel: RF just seemed to fluctuate a lot more than setting the bitrate in my experience. The scale is probably appropriate for the algorithm and the guts that's running those conversions, but it feels like you quickly escalate the file size and bitrates when you mess with it. The right numbers still seem to be around the low 20s for my uses (may not be relevant for SD, but SD is typically so much smaller than HD it might not be a concern for you)

Granted I'm also talking about ending up with files with 30,000 kbps on purpose and then using Handbrake to cut the file size by half. I ended up setting with bitrate conversions, because I can say, "This needs to be a high quality, I'll set it to 4,000" or "The quality is what it is, I'll just go down to 2,000". And you can probably go lower than those figures. I go higher than necessary, because for those types of renders I care about the quality and I'm only doing it for a couple of things; not an entire archive of my DVD collection.

Avatar image for ezekiel
#18 Edited by Ezekiel (2257 posts) -

I do also compress DVD movies, but only when they have letterboxes. If a DVD was 2.4:1 (720x480) and 4200 kbps, I would crop and set the bitrate at 3500, to compensate for the black bars. I wonder how much the black bars really add to the bitrate.

A few days ago, I compressed a BD video with 16, which looked pretty good. I'm gonna try out 16 and 14 and see if the results are consistent. I still don't understand why months ago I was able to reduce file sizes with 12, but when I did it the other day, the size was doubled. Edit: Actually, it must have been because those Blu-rays (I don't remember which they were.) had quite different bitrates from this movie.

Avatar image for ezekiel
#19 Edited by Ezekiel (2257 posts) -

Oh FFS, it happened again with RF 16, even though I'm pretty sure I compressed the other 30 MB video a few days ago with 16, reducing the bitrate to 18 MB. This video is 35 MB and the compressed file is 40. Fine, 18 RF! I'll see what happens in another half day. A built-in calculator would be amazing. Edit: Actually, maybe the Preview option will suffice. I just never use that for this purpose because then I have to find the scene in the original to compare it. It's also a different aspect ratio, making the guesswork even more confusing.

Edit: Lol, a difference of one RF point created a 30 MB preview and an 18 MB preview.

Avatar image for deactivated-5a0917a2494ce
#20 Edited by deactivated-5a0917a2494ce (1350 posts) -

@ezekiel: for me it's about time. If you only have a few files to convert, I get it. I had 600 blu rays to convert and after about 200 I said screw it and bought a couple hard drives. Also, I just got that unlimited subscription to Amazon Drive which you can use to stream through Plex. I've been syncing for about a month now and still have More to go but I'll feel relieved to know all of my videos are pretty safe up there.