• 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

tremault

Well-known member
Faneditor
Messages
1,191
Reaction score
1,365
Trophy Points
123
I'm going to give as much info as I can on handbrake so that people can get decent encodes if they are unfamiliar with it.
This guide is intended for distribution. Please don't do this to prepare files for editing. see the end of this post for more info on that.

BtPtUCX.png

generally this will be the first thing you see. I wouldn't tick 'web optimised' because it'll make your encode last a lot longer than it would otherwise. what it does is it rewrites your entire file at the end to put one tiny little bit of data at the beginning of the file. The other settings, I don't bother with. Your file format is up to you. MP4 is most common but MKV is also pretty favourable.

lV9DFNF.png

check your source dimensions. ideally you want the storage size to match the display size. if it doesn't match and you're unsure why, you might way to check the settings in your project and re-render your source file. make sure your resolution limit is sufficient to give you the right output. you can usually leave the rest on automatic. if you have black bars, automatic will remove them and that will save file space. if you definitely want to keep black bars, turn cropping off automatic.

E1YusYU.png

I would make sure all these are off. after all, you've already fixed all this stuff before your edit, right?

M1nJEOI.png

video encoder is important. h264 and h265 are probably what you want, unless you're burning to a dvd or bluray. (I don't know much about that).
h264 has been standard for a long time but h265 is slowly becoming the standard. h265 can be difficult to run for some slow computers so I personally do one render of each.
with h264, I try to keep it simple, so I don't go for 10bit as that can be difficult for some computers. I'd avoid NVENC as it is mainly intended for streaming and isn't good for accuracy. it would require larger file sizes to look good. for h265 i feel you can get away with more, so you could choose 10bit or even 12bit. I personally think 12bit is overkill.
If you know your source framerate, which you really should, set it to that to be safe.
for encoder options, you ideally want to make this 'encoder preset' go as slow as you can bear. this will look better with a smaller bitrate. you can have an incredibly low bitrate and make it look really good if you set this slow.
Encoder tune, I would normally be setting it to film since that's what I do, but you might need it on animation if that's what you're doing. The encoder profile, I would set that to auto as handbrake bases it on your other settings.
Quality, is a point of contention for many people. some people like to choose constant quality, a setting of 20 is said to be good for most things, you might need to do tests. a lower number is higher quality. lower tha 18 is probably not necessary but I think that depends on how slow you set the encoder preset.
I prefer to aim for a certain file size, so I choose average bitrate. I do turn on 2-pass though so handbrake can work out which parts need more data and which parts need less. I don't touch turbo, it probably reduces the quality of the outcome.

That's all I focus on. The audio, it's pretty basic. I usually just set it to 256. I'm not an audiophile.

This is most of what I know. Please feel free to add to what I've said if you have the knowledge. feel free to ask questions and I'll try to answer or maybe somebody else can answer.

------------------------------

If you want to encode your videos to edit with please refer to the following quote:
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:
You're probably not going to want to mess with your framerate so keep that constant. set it to automatic so it picks the same as your source.

I would not set it to automatic, personally. Doing that just leaves it up to handbrake to decide what the framerate of your source file is (which it can misinterpret). I feel like it's a safer bet to tell it what my source framerate is and cut out the middle man, so to speak.
 
In Handbrake, I once always used 2 pass but now instead avoid using a target filesize altogether because this makes the encoder use an average bitrate, causing more scenes to be prone to artifacts like blocking. This blocking can happen especially when quickly transitioning from lower complexity scenes (static, closeups, bright) to higher complexity (movement, far angle, dark). Content with more grain might need 5x the “normal” bitrate, so the issue is that setting the same target (example, 4GB) based solely on runtime will yield VASTLY different results between different films.

Using constant quality avoids this and gives whatever bitrate is needed to maintain the desired quality based on the visual complexity of each scene. It does not constrain itself by an arbitrary average it constantly has to maintain. Tradeoff is unknown filesize until the encode is complete.
 
And as far as setting the framerate to automatic, this can be problematic if the input video framerate is variable (it will keep it as variable). This is weird but normally ok unless you are going to then import the encode into an NLE. NLE’s mostly can’t handle variable framerate resulting in random frame skips.
 
In Handbrake, I once always used 2 pass but now instead avoid using a target filesize altogether because this makes the encoder use an average bitrate, causing more scenes to be prone to artifacts like blocking. This blocking can happen especially when quickly transitioning from lower complexity scenes (static, closeups, bright) to higher complexity (movement, far angle, dark). Content with more grain might need 5x the “normal” bitrate, so the issue is that setting the same target (example, 4GB) based solely on runtime will yield VASTLY different results between different films.

Using constant quality avoids this and gives whatever bitrate is needed to maintain the desired quality based on the visual complexity of each scene. It does not constrain itself by an arbitrary average it constantly has to maintain. Tradeoff is unknown filesize until the encode is complete.
The reason I have traditionally used average bitrate is because it's tangible. we can judge how much space is available on our distribution method and get a rough idea of general quality. 2 pass means it will analyse which sections need a higher bitrate and so will effectively do the same as what the quality setting does. Personally, I find the quality setting rather arbitrary. the number doesn't mean anything to me. It requires experimentation to pick the right number and might yield a file size way too large and I can't know that until after a lengthy render. after all, if I'm using google drive, i have 15GB available. I want to use each account for two movies, so that means I need to aim for 7.5GB for an h264 plus an h265 for each movie. using the quality setting just doesn't work for this. I don't know how else people distribute things where they don't need to worry about final file size? Perhaps that involves paying for space? I don't have the funds for that myself.

Anyway, I'll update the guide with information about the quality setting for those who don't worry about file sizes and I'll restore the images.
 
I had one major time when constant quality rendered a filesize that was much larger than I wanted. So I went back and used some noise removal in the NLE to reduce the grain. That did the trick. Had I used a target instead, the grain would have been turned into ugly swirling blur-amoebas onscreen.

Also with constant quality I often find 7GB is way overkill. An encode I’m working on of a 2 1/2 hour edit will be around 3GB. Sounds small but for the content it is perceptually lossless.

So it can go both ways. You can also save space with constant quality (and I’m picky AF).
 
I had one major time when constant quality rendered a filesize that was much larger than I wanted. So I went back and used some noise removal in the NLE to reduce the grain. That did the trick. Had I used a target instead, the grain would have been turned into ugly swirling blur-amoebas onscreen.

Also with constant quality I often find 7GB is way overkill. An encode I’m working on of a 2 1/2 hour edit will be around 3GB. Sounds small but for the content it is perceptually lossless.

So it can go both ways. You can also save space with constant quality (and I’m picky AF).
ah yes, I explained that poorly, I aim for around 3GB for my h265 and around 4.5GB for my h264, but it depends on the length of the movie.
 
I did your settings but it takes 7 hours. @tremault
Good renders will often take a long time.

you have a few options.
a) accept inferior quality by changing the preset to faster (or larger file if you chose constant quality)
b) bite the bullet and leave your pc merrily working away
c) upgrade your hardware.

Have I covered all bases?
 
no, the rip will be whatever the resolution of the bluray is. I'm pretty sure that's always going to be 1080p for normal blurays and 4k for ultra blurays.

Honestly, this is complicated, as you know. If you're not satisfied with the settings I gave, you'll have to experiment. I can't really cater to your machine, it's unfair to ask me to effectively hold your hand through it. change your encoder preset faster and hit 'start encode' and see if the render time is to your liking. I don't know what quality that will result in and I don't know what bitrate will be necessary to get a good quality image using whatever speed setting you end up on. you'll have to check it and see.
 
apologies for double post. I just realised it makes far more sense for you to choose constant quality. set it to 20 and set your speed to whatever gives you your desired render time.
200.gif
 
The encode I did for the last of us took about 36 hours for each part.
wow! that's dedication!! I can't bring myself to leave my PC rendering for more than 10 hours, the risk of having made an error is too high for my comfort.
 
Purely for the purpose of watching via Plex on a TV that does not support HDR10/etc... and thus having to transcode I use these settings with good size and quality results:

Quality: Constant Quality 22-24 (Depends on length of th film)
Video Encoder: H.264 10-bit
Framerate: Same as source, Constant
Encoder Preset: VerySlow
Encoder Tune: Film (or Animation if the movie is)
Encoder Profile: high10
Encoder Level: 4.1
Advanced Options:
Code:
ref=4:bframes=2:direct=auto:subme=6:me=hex:deblock=-1,-1:rc-lookahead=70:trellis=0:partitions=all:aq-mode=2
*deblock and lookahead I may adjust as well depending.

For audio since I just have a vizio soundbar AAC or AC3 is totally fine at 160kbps Stereo.
Of course these would be bad settings if you have like a true 5.1 or 7.1 system but for anyone that only has a soundbar setup I don't see needing to do anything special audio wise.
 
I am replying because this isn't working, I followed your guide @tremault and it's still taking up to 10-15 hours. I can't do this, I want to be a film editor, no matter if it's Marley & Me, or the sequel trilogy the blueray rips are taking way too long, and I need to know what to do. I need to know specifically what can I do to get away with good quality for a fan edit and a balanced pace. I recall you saying hardware could be the issue, if so is there a solution? I don't have that right now. Look I just really need help. I'm so unmotivated to edit because everything takes forever, please help. If you've got any suggestions lmk.
 
I am replying because this isn't working, I followed your guide @tremault and it's still taking up to 10-15 hours. I can't do this, I want to be a film editor, no matter if it's Marley & Me, or the sequel trilogy the blueray rips are taking way too long, and I need to know what to do. I need to know specifically what can I do to get away with good quality for a fan edit and a balanced pace. I recall you saying hardware could be the issue, if so is there a solution? I don't have that right now. Look I just really need help. I'm so unmotivated to edit because everything takes forever, please help. If you've got any suggestions lmk.

What hardware are you working with? Mainly graphics card?
I have a 4070 and depending on the source and my settings or what I'm testing I can have encodes that take 30-40 mins to 1-2 hours.
If you are trying to squeeze file size and keep quality up and you utilize advanced x264 or x265 settings you will for sure just need to be patient.
 
I am replying because this isn't working, I followed your guide @tremault and it's still taking up to 10-15 hours. I can't do this, I want to be a film editor, no matter if it's Marley & Me, or the sequel trilogy the blueray rips are taking way too long, and I need to know what to do. I need to know specifically what can I do to get away with good quality for a fan edit and a balanced pace. I recall you saying hardware could be the issue, if so is there a solution? I don't have that right now. Look I just really need help. I'm so unmotivated to edit because everything takes forever, please help. If you've got any suggestions lmk.
I told you what to do here V
apologies for double post. I just realised it makes far more sense for you to choose constant quality. set it to 20 and set your speed to whatever gives you your desired render time.


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.....
image.png
 
Last edited:
Back
Top Bottom