I know I’ve probably already added TMI for the average person, but I find the subject interesting and maybe it will help other folks with the same questions.
The DVD I used as an source actually makes for an interesting example because the source material is notoriously in bad condition (a lot of HK action films from John Woo’s heyday are in pretty bad condition).
The reasons that’s interesting is you can see what a non-ideal encode looks like to begin with, and then it’s clearer what Handbrake is doing when it does things like deblocks it.
Here’s a screenshot of a frame from the source (and sadly, one of the better releases) DVD.
You can see there’s lots of blockiness. In some places it’s almost comical, like if you look at Chow Yun-fat’s pants. They’re not supposed to be “checkered”,
Oof. Chow Yun-fat also has a powerful aura of pixels around his head:
Now, here’s what it would look like using the settings I mentioned above, which are basically Very Fast 576p25:
The pants aren’t as blocky, it’s kind of smoothed (or smeared) out:
It’s a similar situation with the noise around his head:
But a lot of the detail is gone, too.
Here’s one with my preferred settings for the DVD:
It kept a lot more detail and is closer to the (unfortunately bad) original. But, that also means it kept the same flaws too. My personal preference is weighted towards the source material even if it’s non-ideal. I like preserving film grain, too.
The pants have had a touch of deblocking. You can see some wrinkles that aren’t present in the Very Fast preset:
His face also still has cheekbones and a chin, but also some of the noise around the head:
These were just quick screengrabs. For a “real” or official comparison I’d make sure each frame/screenshot/crop/zoom is exactly the same, but I’m just trying to point out basic differences.
When you adjust the CQ, Tune, Profile, or Level, Handbrake makes adjustments to the parameters for the encode behind the scenes. A lot of changes. And those affect things like where to focus more bitrate, strength of deblocking/sharpening, etc.
For example, let’s say you apply the “Film” tune. That tells Handbrake to set a deblock level of “deblock=-1,-1”, which means it’s actually less aggressive with deblocking than the default.
Where if you choose “Animation” it sets “deblock=1,1” so it’s more aggressive with the deblocking. In this case animation=2D, it wouldn’t be ideal for CG.
Profile kind of controls the “tools” available in the encoder toolbox. Not every playback device can make use of every technique/algorithm/magic sauce that a codec uses, so this restricts some settings depending on the profile you choose.
It would be kind of like if you wanted to give someone a zipped file, but the system knew, based on their computer’s specs they wouldn’t be able to unzip it, so it disables that ability. Zipping the file would save space… but if they can’t use it what’s the point?
Let’s take “bframes”. Bframes can help with motion/compression by only storing data that changes between frames.
If you were using the “Placebo” preset, bframes would be set to “bframes=16” (too high for almost any human, fwiw). BUT, if you set the Profile level to “baseline”, you can’t use bframes. So no matter what your encode will be set to “bframes=0”.
Similarly, Level places a “cap” on certain features. Again, if you were using Placebo it would tell the encoder to use more “reference frames”. So it would set “ref=16”. BUT, if you set the Level to “1.0”, it would cap the number of reference frames at “ref=1”.
So when the encoder needs to perform tasks where it compares frames, it would only ever use a single other frame from the video to make its guesses. Kind of like how a survey size can affect its accuracy, but require more time/energy/effort, more references can improve quality but drastically increase encoding time.
The Level also limits things like the “VBV buffer” and “VBV maxrate”. In this case 1.0 would be the tragically low max values of “vbv-bufsize=218” and “vbv-maxrate=80”.
So you’d use things like Profile and Level to set limits for compatibility purposes. These days “High” and “4.1” seem to be the general consensus, but if you have a lot of older devices you may want to use different settings. Or, if your devices handle everything you throw at it regardless, you could just set it all to auto and let the encode guess which brackets to put you in.
The speed preset, you guessed it, also enables/disables specific features and sets certain limits in Handbrake with the hope of controlling how long it will take to encode a file.
Let’s take “submotion estimation” as an example. That’s kind of what techniques and how much effort the encoder will go to in order to preserve detail/have a higher quality image/smaller filesizes when dealing with motion scenes in your video. Placebo adjusts this setting (and many others) so that they’re very, very high, so in this case it would set “subme=10”, the max value for that setting, and it’s expontentially slower than even 8 or 9.
To get really into the weeds, you can see the types of settings being changed whenever you enable or disable an option by hovering your mouse in the “More settings” area of the Video tab.
That can also help tell you if Handbrake is ignoring an “advanced setting” you manually type into the “More Settings” area, such as if you’re asking it to do 16 reference frames but the Level you’ve chosen uses just 1 reference frame.
And further down the rabbit hole you can read about all the various options a codec has, like h264:
Whew! For me, in my completely subjective opinion and use-case, I’ve settled on these settings in my preset:
h264_mkv_rf22_ref4_bframe4_film_high_41.zip (1.6 KB)
But if you’re not OCD about it or curious like I am, and you’d rather spend more time watching movies than encoding them (YOUR LOSS!), “Fast 1080p30” provides a really good template that you can make tweaks to, such as changing the framerate to “Same as source” or selecting different audio tracks and codecs.
Or maybe “HQ 1080p30 Surround” and changing the framerate to “Same as Source” and moving the Preset slider to “Fast” or “Faster”.
In my examples the “Very Fast 576p25” preset took 8 minutes to encode (yay Ryzen 3700x!) with a filesize of 1.1gb, my custom DVD preset took about 30 minutes and resulted in a filesize of 1.7gb (with a single AAC audio track), and the original DVD video is 7.2gb.
Placebo would be clocking in at 90 minutes, and with a much higher quality source at a higher resolution like a Blu-ray you’ll grow old waiting for an encode to finish (remember, all things being exponential when you adjust for quality/effort/resolution).
Also to clarify, using the 1080p preset won’t make your DVD 1080p or try to “upscale” it, it just sets a maximum resolution. So if you use the preset on a DVD (480p/576p) source or 720p source, it’ll just make its best guess for cropping and resolution to maintain a picture as close to the original aspect ratio as possible.
Compare that to just throwing on the “Fast 1080p30” preset with zero changes, and you get an encode that took 13 minutes, resulted in a filesize of 1.4gb (pretty much what you’d expect between “very fast” and all my custom settings), and doesn’t look that different, especially if you consider the time and energy I took to read through a lot of pages/posts on Handbrake:
So you might want to just use that instead and get on with your life instead.
To my eye, I prefer my preset, but other folks might hate it. So that’s the basics of “best” or “optimal”, the personal tradeoffs between encoding speed, filesize, and quality that you want. But beyond the presets you quickly hit diminishing returns all the way down.
tl;dr after ALL that, essentially I’m saying just slap on Fast 1080p30 and be done with it unless you want to invest more time/energy into tweaking things to your exact preferences, because there’s no real one-size-fits-all answer.
Okay, I’m done, I swear! No more updates.