superfast smaller than slow?

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
velocidad
Posts: 4
Joined: Tue Apr 25, 2017 8:27 pm

superfast smaller than slow?

Post by velocidad »

I've just discover this program and I make some tests.

I encoded a 8GB mkv h264 file to h265 (audio passthrough) with constant quality 15. I try two diferent settings (slow and superfast), this are the unexpected results:

-superfast = 2h40min encode time = 4Gb file size
-slow= 19h encode time = 5Gb file size

Looking closer at file details:

original file bit speed 11099kb
superfast file bit speed 5527kb
slow file bit speed 6843kb

Acording to the help that pop-ups when mouse over the slider it says

"Adjust encoder settings compression efficiency against encoding speed.

This establishes your default encoder setting.
Tunes, profiles, levels and advanced option string will be applied to this.
You should generally set this option to the slowest you can bear since slower setting will result in better quality or smaller size"

So why the slow setting result in bigger file size? Yes it that has better quality, but that's because it uses more bit speed, not better compression.
mduell
Veteran User
Posts: 8202
Joined: Sat Apr 21, 2007 8:54 pm

Re: superfast smaller than slow?

Post by mduell »

Quality isn't constant across different settings.
velocidad
Posts: 4
Joined: Tue Apr 25, 2017 8:27 pm

Re: superfast smaller than slow?

Post by velocidad »

Then what is the constant quality setting for? How do I know what will be the final size of the file?

I want to have best quality but about 1/3 file size from the original, so what settings should I use?

Thanks in advance.
mduell
Veteran User
Posts: 8202
Joined: Sat Apr 21, 2007 8:54 pm

Re: superfast smaller than slow?

Post by mduell »

velocidad wrote: Tue Apr 25, 2017 9:54 pmThen what is the constant quality setting for? How do I know what will be the final size of the file?

I want to have best quality but about 1/3 file size from the original, so what settings should I use?
Constant quality across different sources. The output size is unpredictable, depends on the content.

A bitrate calculator and the veryslow preset.
velocidad
Posts: 4
Joined: Tue Apr 25, 2017 8:27 pm

Re: superfast smaller than slow?

Post by velocidad »

I don't get it. You mean that if I use multiple files at source the constant quality prevail and if I use single file the enconder preset prevail?

When you say to use a bitrate calculator, you mean using "Avg bitrate (kbps):" and the result from the bitrate calculation? I notice that using this option is making an extra pass (1 turbo and 2 normal), as "2-Pass Encoding" and "Turbo first pass" are selected by default.

Is that the best settings for what I'm looking for?
rollin_eng
Veteran User
Posts: 4858
Joined: Wed May 04, 2011 11:06 pm

Re: superfast smaller than slow?

Post by rollin_eng »

CQ encoding will use whatever bitrate is needed so you cannot predict file size before encoding.

If you want your encodes a specific size use avg bitrate and a bitrate calculator.
mduell
Veteran User
Posts: 8202
Joined: Sat Apr 21, 2007 8:54 pm

Re: superfast smaller than slow?

Post by mduell »

velocidad wrote: Wed Apr 26, 2017 8:29 amI don't get it. You mean that if I use multiple files at source the constant quality prevail and if I use single file the enconder preset prevail?
I have no idea what you're trying to ask in this word salad.
velocidad wrote: Wed Apr 26, 2017 8:29 amWhen you say to use a bitrate calculator, you mean using "Avg bitrate (kbps):" and the result from the bitrate calculation? I notice that using this option is making an extra pass (1 turbo and 2 normal), as "2-Pass Encoding" and "Turbo first pass" are selected by default.

Is that the best settings for what I'm looking for?
Based on your statements and requirements so far, yes.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: superfast smaller than slow?

Post by JohnAStebbins »

Constant quality (CQ) encoding will produce roughly the same quality output for every source for a given fixed set of settings. If you change any of the other video encoder settings, the quality of the output will change slightly. There are a variety of reasons that this happens and I'm not really enough of an expert on the subject matter to give an authoritative description of why it happens.

Since CQ encoding produces the same quality output for every source (given that other settings don't change), the bitrate varies from source to source. A more complex video requires more bits to achieve the same quality as a less complex video. Things that add complexity are motion, noise, and high visual detail.

So if you require a predictable bitrate (or filesize), you need to use average bitrate (ABR) encoding. ABR will use the same bitrate across the entire encode, which means that the quality will vary. More complex scenes will be lower quality than less complex scenes. But the predictable bitrate allows you to calculate what the final file size will be.
velocidad
Posts: 4
Joined: Tue Apr 25, 2017 8:27 pm

Re: superfast smaller than slow?

Post by velocidad »

Well, thanks all for your answers, this explains a lot.
mduell wrote: Wed Apr 26, 2017 2:34 pm
velocidad wrote: Wed Apr 26, 2017 8:29 amI don't get it. You mean that if I use multiple files at source the constant quality prevail and if I use single file the enconder preset prevail?
I have no idea what you're trying to ask in this word salad.
My english sucks, I know. Anyway, thanks for the help
JohnAStebbins wrote: Wed Apr 26, 2017 2:48 pm Constant quality (CQ) encoding will produce roughly the same quality output for every source for a given fixed set of settings. If you change any of the other video encoder settings, the quality of the output will change slightly. There are a variety of reasons that this happens and I'm not really enough of an expert on the subject matter to give an authoritative description of why it happens.

Since CQ encoding produces the same quality output for every source (given that other settings don't change), the bitrate varies from source to source. A more complex video requires more bits to achieve the same quality as a less complex video. Things that add complexity are motion, noise, and high visual detail.

So if you require a predictable bitrate (or filesize), you need to use average bitrate (ABR) encoding. ABR will use the same bitrate across the entire encode, which means that the quality will vary. More complex scenes will be lower quality than less complex scenes. But the predictable bitrate allows you to calculate what the final file size will be.
First thanks for clarifying my questions, this explain all I was asking.

If by "slightly" you mean a difference of 1Gb output, then your stament explain what I was not understanding.

When I start the program for the first time, my first thought was "Wow!!, this is very intuitive and easy to use". After reading your statement, understanding what it involves, now I can clearly say how wrong I was with my first statement.

In my opinion, this should be changed somehow, as it's by far from been intuitive.
nhyone
Bright Spark User
Posts: 252
Joined: Fri Jul 24, 2015 4:13 am

Re: superfast smaller than slow?

Post by nhyone »

I'm surprised superfast results in a small file. In my experience, superfast and ultrafast get their speed by throwing bits at the encode, i.e. they are not space-efficient. The quality is largely determined by the CQ you choose.

Can you attach your encode log?

The one-liner summary, if you are after encoding speed/size, use superfast. If you are after quality/size, use a tweaked veryslow.

You can read this post viewtopic.php?f=7&t=36205 and follow the link there.

The x264 presets are not linear in any one sense. There are three factors: speed, size and quality.
nhyone
Bright Spark User
Posts: 252
Joined: Fri Jul 24, 2015 4:13 am

Re: superfast smaller than slow?

Post by nhyone »

Oops, I just saw that you encoded using x265 (HEVC). What I wrote is true for x264 only.
Post Reply