• Most new users don't bother reading our rules. Here's the one that is ignored almost immediately upon signup: DO NOT ASK FOR FANEDIT LINKS PUBLICLY. First, read the FAQ. Seriously. What you want is there. You can also send a message to the editor. If that doesn't work THEN post in the Trade & Request forum. Anywhere else and it will be deleted and an infraction will be issued.
  • If this is your first time here please read our FAQ and Rules pages. They have some useful information that will get us all off on the right foot, especially our Own the Source rule. If you do not understand any of these rules send a private message to one of our staff for further details.
  • Please read our Rules & Guidelines

    Read BEFORE posting Trades & Request

How to encode well in Handbrake : Guide

I told you what to do here V



If you still aren't happy with the render time then you may need to buy a faster computer.

we can't break the laws of physics though.....
I'm pretty sure they're trying to prepare a source file to start editing, not a delivery format for a finished edit. In which case, they shouldn't be using Handbrake anyway.
 
I'm pretty sure they're trying to prepare a source file to start editing, not a delivery format for a finished edit. In which case, they shouldn't be using Handbrake anyway.
Thanks for pointing that out.
That's really interesting, my guide wasn't intended for that. I'll make sure I specify in my OP.

...........

I don't re-encode for editing, I let my NLE create proxy files.
If I need to for some reason though :-

Encoding for editing.... I use ffmpeg. (FFmpegGUI-2)
Output Container = MP4
Video Codec = Apple ProRes
Audio Codec = PCM
I set everything else on auto or leave it on default.
image.png

This results in a very large file that is easy to edit with. it's usually something like 300-400 GB but it is pretty much maximum quality.
 
Last edited:
As someone who doesn't know much about files, or have a good eye for video quality, I tend to prioritise smaller file size for storage/transfer.
How does the visual quality change depending on the quality and encoder speed settings? Am I understanding right that average bitrate results in a smaller filesize than constant quality, and if so, what is the best average bitrate for 1080p?

I don't want to frustrate people who are concerned with video quality, but ideally I'd like as small a file as I can get away with.
 
As someone who doesn't know much about files, or have a good eye for video quality, I tend to prioritise smaller file size for storage/transfer.
How does the visual quality change depending on the quality and encoder speed settings? Am I understanding right that average bitrate results in a smaller filesize than constant quality, and if so, what is the best average bitrate for 1080p?

I don't want to frustrate people who are concerned with video quality, but ideally I'd like as small a file as I can get away with.
@krausfadr made a good topic about this too.

When you set your computer to encode, it's repainting the images. The more time it has, the better they look.
As in my diagram above, you can have a good quality and small file size if you render slower. You can't have all 3 at once though. If you want small file and fast render, you sacrifice quality. Finally, if you want good quality and fast render, you end up with a large file.
we can't break the laws of physics though.....
image.png
 
Am I understanding right that average bitrate results in a smaller filesize than constant quality, and if so, what is the best average bitrate for 1080p?
Sorry I missed this.
if you set bitrate at average 3000kb/s and render a file that is 10 minutes long,
then that's 600 seconds, so it's 600x~3000 = ~1800000 kilobits, which equals ~195.3 megabytes.
that means when you set a bitrate, you are effectively setting your approx file size.
with the quality setting, you're setting visual quality so your file size could be wildly different depending on the images.
 
if you set bitrate at average 3000kb/s and render a file that is 10 minutes long,
then that's 600 seconds, so it's 600x~3000 = ~1800000 kilobits, which equals ~195.3 megabytes.
Oh, I see!
Seems obvious in hindsight😅
 
@Prism_Skywalker please take time to re read the guides and do some research on Google. Asking others to figure out your specific barriers that don't align with the topic of this thread are better suited in a PM. You are free to start a technical help thread where you can clearly outline your barriers and what hardware and software you are using.
 
An obvious tip which might be easily overlooked when approaching this for the first time is to use a short sample for testing.

Instead of trialling these options with your final 120+min render, just create a 5min or so sample file of your project. This will allow you to trial various Handbrake settings quickly, getting various encodings which you can directly compare for processing time, visual quality, and file size.

Handbrake allows you to queue things so you can just create a stack of encodings with different settings (eg CQ 18,19,20,21 etc or Speed setting), then it will run through the queue and in a few hours you can have many sample files to look at. Just make sure that you title each file appropriately so you can easily see what settings were used for it (eg "SampleFile_h265_Slower_CQ20.mp4". Look in 'settings/preferences' for auto-naming options). The queue window gives details of settings used and lists the encoding time, so you don't have to sit there with a stopwatch observing it. All the data is listed there. Just be aware that the queue will be cleared when quitting Handbrake so you'll lose the list. (I don't know if Handbrake keeps a permanent text file log which you can look up any time.)

This will avoid the problem had by someone such as Prism Skywalker who seems to be jumping in with both feet and then saying "omg I can't spend 12 hours on this". Everyone's computer setup and project specs will differ, so there's no absolute guide to how long it will take. Using a small sample which is visually representative of the typical kind of imagery/detail in your project will allow you to get a good idea of what settings to use.

It's probably also worth getting your head round the difference between h264 and h265. For the same visual quality, h264 will give faster encoding times but a larger filesize. h265 is a more efficient way of encoding, meaning you can get the same visual quality in a smaller filesize, but it takes longer to encode. In my experience/testing, using slower speed settings with h265 can dramatically increase encoding times as compared to using slower speeds for h264.

For ease, make your sample file length a round number which you can easily multiply to accurately estimate the ultimate per hour/project encoding time and filesize. For example, a 2min, 5min, or 10min sample can be easily multiplied by 30, 12, or 6 respectively to give you a good idea of the encoding time and filesize for 1 hour of video.

All the basic settings (speed, bitrate, CQ/RF 264/265 etc) make a significant difference in the three things you care about: picture quality, processing time, and file size. But what you'll find is that for all settings there comes a point where increasing the bitrate, or slowing the encoding speed etc just gives diminishing returns.

To this point, I'll urge caution regarding one thing Tremault said about encoding speed: "ideally want to make this 'encoder preset' go as slow as you can bear." I've done extensive testing across three variables (264/265, CQ number, Encoder Speed) to compare the numbers and found encoding speed to be the biggest potential pitfall, in practical terms. What I mean is that when adjusting the Encoder Speed, there really is such a thing as too slow. Using a mid-slow speed gives longer encoding times for some gain in quality, but when you get to the slowest speeds (particularly with h265) it can drastically increase encoding times (like 10-20x baseline) while giving marginal differences in resulting filesize/quality. Rule of thumb for me is that it's more beneficial to use a higher quality setting (lower CQ number) with a mid-slow speed, compared to a lower quality setting with a very-slow speed. But that's just me on my rig (M1 Mac Mini). It will vary for others which is why I'd recommend everyone doing some of their own testing to see what works for them.
 
Last edited:
To this point, I'll urge caution regarding one thing Tremault said about encoding speed: "ideally want to make this 'encoder preset' go as slow as you can bear." I've done extensive testing across three variables (264/265, CQ number, Encoder Speed) to compare the numbers and found encoding speed to be the biggest potential pitfall, in practical terms. What I mean is that when adjusting the Encoder Speed, there really is such a thing as too slow. Using a mid-slow speed gives longer encoding times for some gain in quality, but when you get to the slowest speeds (particularly with h265) it can drastically increase encoding times (like 10-20x baseline) while giving marginal differences in resulting filesize/quality. Rule of thumb for me is that it's more beneficial to use a higher quality setting (lower CQ number) with a mid-slow speed, compared to a lower quality setting with a very-slow speed. But that's just me on my rig (M1 Mac Mini). It will vary for others which is why I'd recommend everyone doing some of their own testing to see what works for them.
The reason I advise this is because we may not necessarily be able to see issues as well as other people. I know that I am not as experienced comparing video quality between different sources and it's taken me a long time to learn to recognise really subtle banding, among other issues. I've done encodes that I thought look good and most other people do, but then a review pops up talking about visual quality and I realise that I have room to improve in that area.
 
The reason I advise this is because we may not necessarily be able to see issues as well as other people. I know that I am not as experienced comparing video quality between different sources and it's taken me a long time to learn to recognise really subtle banding, among other issues. I've done encodes that I thought look good and most other people do, but then a review pops up talking about visual quality and I realise that I have room to improve in that area.
Sure, I wasn't disagreeing with what you said, I was just saying that of the variables I tested, Speed gave the most varied results and that people should exercise caution when using the slowest speeds.

Other variables I tested such as CQ number (23 to 17) give intuitively predictable results as you turn the dial towards better quality – it takes a bit longer, the bitrate/filesize scales accordingly in a moderately linear fashion. The differences between 264 and 265 seem pretty stable across settings. But h265 combined with the slowest speeds can give drastically long encoding times. Given that a big part of people optimising their encoding settings is finding a happy balance between size/time/quality, it's the one setting I'd tell people to watch out for.

Ultimately, I'm just saying that it's worth people doing a bit of their own testing to see what works for them.
 
I understand that you're saying the trade-off may not be worth it. So it's about how long you're comfortable with. If you're comfortable with setting it to encode over 6 hours, then it's worth it to get a smaller file size. If we are talking about the difference in size being 50kb for a 2 hr movie, then sure, it may not be worth doubling the encode time. Do you have any hard data on that specifically?
 
I understand that you're saying the trade-off may not be worth it. So it's about how long you're comfortable with. If you're comfortable with setting it to encode over 6 hours, then it's worth it to get a smaller file size. If we are talking about the difference in size being 50kb for a 2 hr movie, then sure, it may not be worth doubling the encode time. Do you have any hard data on that specifically?
Yes I've got a decent amount of data. I actually did a big write-up here when I did the testing a few months ago, but eventually I decided it was stupid posting a huge table of numbers which are specific to my rig and so I deleted the draft without posting it.

I tested most combinations of 5 Speed settings, 5 CQ settings, and h264/265, normalising the resulting encoding times and filesizes for 1 hour of video. Audio switched off to give a better comparison of the relative differences between the video variables, as well as a semi-objective/subjective rating system for final picture quality.
For h265 at CQ21 at various speeds, I found that "Medium" had an encoding time of about 60min, while "Slower" was 600min and "Very Slow" was 1000min for an hour of video (so that would be 20 or 33 hours vs 2 hours encoding time for a 2 hour project). Strangely, both "Slower" and "Very Slow" had almost exactly the same bitrate/filesize as each other. Both were only modestly higher bitrate than Medium speed (2900 vs 2400). I gave all the same picture quality rating.
 
Thank you, that's really helpful. It's a shame you deleted that post, I think it could have been very valuable. I appreciate the effort you put into this. I may consider avoiding these slower settings in that case.
 
The point of sharing the data was to give people an overview of how the different variables affect the output and the relative differences of each variable, but I was put off going ahead with it as I figured that it was too specific to be useful, and would amount to a huge list of numbers with little relevance to anyone else. Different material being encoded, different graphics cards etc etc etc would just lead to an arbitrary mess and people complaining when they took guidance from my numbers but it took longer than expected etc
 
Back
Top Bottom