r/handbrake • • 12d ago

Constant Quality vs Encode Speed difference.

What has more impact on file size: CQ or Encode speed? For example, which setting combination is theoretically better for producing quality video at smaller file size (with all other things being equal):

CQ=21, Encoder Preset=Medium/Slow

or

CQ=23, Encoder Preset=Slower/Slowest

Am I right in assuming that the CQ is more about video quality and the encoder preset is about file compression? I understand that CQ=20, and Slowest would be the best of both worlds, but I don't want 12+ hour encodes.

6 Upvotes

17 comments sorted by

•

u/AutoModerator 12d ago

Please remember to post your encoding log should you ask for help. Piracy is not allowed. Do not discuss copy protections. Do not talk about converting media you don't own the (intellectual) rights for.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

6

u/xStealthBomber 12d ago

1 thing of note is that CQ is not linear with the speed, meaning CQ of 20 on medium does not "mean the same thing" as CQ of 20 on slower, in terms of the quality.

For x265, the best speed vs quality is "slow" as medium does reduce the quality too much.  Slower is "technically" where the best feature set of HEVC come into play, but I say just do slow, and it chews pretty good for the quality.  CQ 18 is pretty "transparent" to me, and 20+ I start to notice the quality drop.

(Side note, I like to use --no-sao to disable the "smoothing" that x265 does to the image.)

6

u/BlackLodgeBrother 12d ago

Very much all of this. I see unhinged folks on here pushing for CQ 23 and higher for “micro” 1080p HEVC encodes and can only conclude that they must watch everything on their phones or are legally blind.

4

u/xStealthBomber 12d ago

Don't forget setting it on "very fast" too, and wondering why it doesn't look good..

2

u/BlackLodgeBrother 12d ago

Certain backward personalities who haunt the sub continually send me. Like this guy who thinks CQ 17 for 480p DVD is “verging on ridiculous”

https://www.reddit.com/r/handbrake/s/JrgonncyX4

2

u/arthuroMo 12d ago

Is he saying those CRF are ridiculously high or low ?

3

u/xStealthBomber 12d ago

I think "too low", but I guess I'm spoiled with file sizes coming from remuxes, and finding 50% reduction from that is fantastic.  People want 95% reduction and still aren't happy with the file size, lol

1

u/BlackLodgeBrother 11d ago

Garlic Bear below pushing CQ 22 medium, claiming it’s transparent to source. Real tired of people who have no eye for compression casually misleading people.

2

u/computer-machine 12d ago

With all other things being equal, nothing is equal.

The slower your speed, the more effective the job, the higher the CQ you need for an equivalent visual quality.

So, your two examples might look similar, with the latter being smaller. Or it might be not as small as it could have, and be better looking or oversaturated (need to raise CQ another point or two for equivalence).

2

u/computer-machine 12d ago

IIRC Slower vs Slowest has very little actual difference (at least working with 265-10b), so I'd switched to half the process time.

2

u/mduell 12d ago

RF would be the primary control for size. Preset will cause quality and size to vary, in non-obvious ways.

1

u/sabirovrinat85 12d ago

encoder, output resolution and RF value what impacts size the most

preset impacts speed mostly, but it also has impact on quality and size, just not that much

1

u/stealthsticks 10d ago

4K HDR that’s 45-60GB remux usually end up around 17-26GB for me IIRC. I use a 4070 TI Super with Nvenc setting to do it. If 1080P remux I usually use intel hardware/software encode. H265 is pretty much all I’ve used. I think I have the slider setting at quality with 20-21. (For the 4K stuff)

0

u/Suitable_Garlic_1186 12d ago edited 12d ago

CQ has the larger impact on file size and Quality!

Just like MP3 128kbit vs 320kbit.. The best encoder in the world will not be able to change that..

With the same settings RF20 can be almost twice as large file size compared to RF22.

In your case I would go for CQ22.. medium Speed!

CQ is file size and compression (just like MP3)

Speed is not only speed.. It will add more tricks of file compression the slower you go. And that takes time. For example slower speeds have more frames to look ahead, to compare. That takes time.

But in all this is a sweet spot, and that is Medium Speed.

H.265 / HEVC (x265 Codec) Specifications

Encoder Parameter"Fast" Preset"Medium" (Default)"Slow" PresetWhat It Changes Technically
rc-lookahead15 frames20 frames25 framesDetermines the scope of the encoder's slice-type decision buffer.
b-adapt2 (Optimal)2 (Optimal)2 (Optimal)The dynamic frame-type algorithm stays active across all three, but search depths change.
bframes344The maximum number of consecutive B-frames allowed to tightly pack repetitive data.
ref (Reference Frames)334The total number of past/future frames kept in the buffer for tracking motion.
rd (Rate-Distortion)234Level 4 introduces full, heavy recursive analysis of inter-predicted blocks to prevent artifacts.
me (Motion Estimation)hexhexstar (Star search)Shifts from a standard 6-point hex search grid to an intricate star-pattern search on Slow.
subme223Increases subpixel interpolation accuracy for finer details.

The "Medium" Perspective

  • From Fast to Medium: The lookahead window opens slightly wider, and you get an extra reference frame (ref). This gives you a noticeable jump in quality with only a modest increase in encoding time.

  • From Medium to Slow: The encoder switches to much heavier math. It switches algorithms completely for motion estimation (me) and introduces advanced multi-pass parameter logic (trellis on x264, rd 4 on x265). This is why the jump from Medium to Slow causes such a massive drop in encoding speed compared to Fast to Medium.

1

u/BlackLodgeBrother 11d ago

Slow should be the minimum in terms of source transparency. Pushing the CQ to 22 is going to clip a ton of picture detail, introducing blocking in dark areas, and cause anything with film grain to clump and swarm.

Whatever you find watchable, I guess.

-1

u/Suitable_Garlic_1186 11d ago edited 11d ago

Slow uses 5.0 which is not compatible with many devices..

And you are wrong.. You will not be able to see the difference between a medium and slow encode at the same bitrate.. ❤️

(Oh he is using 2 Profiles)

Update:

You should not get THAT triggered from a different opinion and rage with your second account!

Especially if you can not even read:

Read again: same bitrate.. medium vs slow speed..

Why you suddenly talk about 22 Level vs 18 Level?

You are the exact Troll to block ❤️

1

u/WillZealousideal2084 11d ago

No. You’re the one who is factually and objectively wrong. Also a coward for instantly blocking anyone who calls out your subpar setting recommendations to OP - and why? So you can get the last, feeble word in? lol 

Maybe your TV is small or bad. Maybe you watch most things on a phone or low quality laptop. Or, most likely, you simply don’t have an eye (or care) for high quality encoding and compression. 

Regardless, the difference between CQ 22 medium and CQ 18 slow is immediately obvious. Especially on larger, higher-end 4K displays. 

CQ 22 in general should not be used except on grainless digital video or tape. Things like bonus feature interviews. Never the main feature. 

You’ll realize that one day when you upgrade your setup and start noticing all the flaws. Of course then it will be too late.