mattgadient.com

A rundown of Handbrake settings (0.9.6)

Update: If you’re using Handbrake 0.9.9 and would rather use the new “x264 Presets”, I have an updated guide for Handbrake 0.9.9 which focuses on that. However, if you’re sticking with the “Advanced Settings” or want more in-depth information on the Audio Settings, Picture Settings, etc (which I did not repeat in the new guide), keep reading….

 

The old best H.264 / x264 settings for Handbrake wasn’t very complete, and became outdated. Here I’ll try to take a more thorough peak at settings here to help you get the best x264 / Handbrake settings possible for your encode. Warning: the previous write-up was short. This one is insanely long and detailed. If you find yourself overwhelmed (don’t feel bad, there’s a lot to take in), muddle through in Handbrake the best you can and just use this as a reference when you get to an option you’re unsure about.

The focus here is on getting the best quality using x264 through Handbrake, even if it takes a long time to encode (within reason on a modern processor anyway).

Heaven help you if you’re using an old Athlon…

I’ll start with the advanced settings and work backwards.

 

Advanced Settings

Reference Frames: max possible

This goes up to 16. Unfortunately, 16 will break playback on a lot of hardware devices (and possibly some software players). So if you’re using say… an iPad3, WDTV, Roku, AppleTV3, etc, you’re going to have to find the max for that player. The easiest way is to see what “Profile” your device supports.

I’ll use an example. The iPad3. The specs page  lists “Profile level 4.1” under the “TV and Video” section (right now anyway – that page might change whenever the iPad4 comes out). So we don’t want to go higher than what “Level 4.1” supports if we want the video to play back on the iPad3.

Next we take that “Level 4.1” to the MPEG4 page on Wikipedia where we’ll see a bunch of cryptic stuff under the “Level 4.1” part. When it comes to Reference Frames, we need to look at the following in the last column:
1280×720@68.3 (9)
1920×1080@30.1 (4)
2048×1024@30.0 (4)
The stuff in brackets (max stored frames) means Reference Frames.

A typical DVD will fit within the 1280×720 confines and can use up to 9 reference frames*.

For a 1080p BluRay, up to 4 reference frames.

If we go above this, the iPad 3 (using Level 4.1) might choke when trying to play it back.

*For the sake of simplicity, I’m being conservative here mentioning 9 ref frames for a DVD. If you look at a lower level such as Level 3.1 you’ll notice that it actually lists a DVD’s resolution of 720×480, and will handle 13 reference frames. So you might be able to push 13 reference frames (or more) at Level 4.1 on a DVD. Suffice it to say, finding the true max ref frames at your particular resolution and framerate can get very tricky – the wikipedia page just lists a few examples for each Level. If you’re very hard-core about finding the true max ref frames for your source, you can try to math-it-out or simply do some trial-and-error.

So look at your device’s specs to find the “Profile Level” and then match it up with the Wikipedia link above to find out the max reference frames you can use. Remember, this depends on the resolution and as we saw in the above example, a DVD can get away with 9 reference frames on the iPad 3, while a BluRay can only get away with 4 ref frames.

If you’re just playing your content on a decent computer (through VLC for example), feel free to crank it all the way up to 16. Just remember that it probably won’t play on many (if any) current hardware devices. And a really slow HTPC might even choke.

Note that high values will take noticably longer to encode, even on a fast machine. If 16 makes your encode take way too long, feel free to bump down to something like 8 (the default for the “slower” preset in x264).

Maximum B-Frames: 16

16 is considered a “placebo” setting in x264. That said, it doesn’t add a ridiculous amount of time to the encode.

This just tells the encoder how many consecutive bframes it can use. Chances are that the encoder isn’t going to find a situation where it makes sense to actually *use* 16 consecutive bframes. If your encode times are are really hurting, 8 might be more reasonable.

 

CABAC Entropy Encoding, 8×8 Transform, Weighted P-Frames: yes (checked)

They’re all different, but just about everything relatively-recent supports these. If you’re trying to play the video on a really old or really weak device (where many of the other settings I’m listing will probably be problematic too), you might have to turn them off.

CABAC simply uses better compression for certain data in the encode.
8×8 Tranform lets the encoder do another nifty technical thing with i-frames.
Weighted P-frames tends to improve compression when fades take place.

 

Pyramidal B-Frames: Default (Normal)

If you’re creating an actual BluRay disc from your encode, use “Strict”. Otherwise, most recent devices support it (if you’re using something old/weak, you may need to turn it off).

B-Frames are great. This makes them even better. This allows B-Frames to be used as references for other frames (like other B-Frames!).

 

Adaptive B-Frames: Optimal

We’re aiming to pump as much quality into a filesize, so set this to Optimal.

From what I gather, if you set this to “none”, B-Frames would be put into a simplistic “cookie cutter” order, which isn’t likely to be ideal. Both “fast” and “optimal” allow the encoder to use them effectively/efficiently, with optimal doing a better job.

 

Adaptive Direct Mode: Auto

This has to do with “motion vector prediction”. I assume that spacial looks at individual frames whereas temporal looks across multiple frames. Spacial is supposed to be the most useful, but because that isn’t *always* the case, using Auto is the best way to go so that the encoder can use whatever is most useful.

 

Motion Estimation Method: Uneven Multi-Hexagon (umh)

UMH is about the highest you can go without running into insane encode times.

The encoder uses certain motion estimation patterns (do some googling if you want to know what each looks like). If you go beyond this to exhaustive (or transformed exhaustive – considered the “placebo” setting), it becomes something of a dumb brute force search.

If you’re intent on going with Exhaustive or Transformed Exhaustive, your encode even on a fast machine might take days, so consider if it’s really worth it for the “placebo” effect.

 

Subpixel ME & Mode Decision: 10 QPRD in all frames

Suffice it to say, higher is better, but 11 would take a good bit longer and is considered a “placebo” setting.

 

Motion Estimation Range: 24-64

Despite 64 being considered far beyond even the “placebo” setting, my DVD encodes have had pretty reasonable encode times (under an hour for a 44-min episode), which is the only reason I’ve allowed it to stay so high. BluRay encodes on the other hand…. those approach the better part of a day at a setting of 64.

Something in the range of 16-24 is probably more sensible.

This is the maximum range in pixels that the encoder will search for motion. Higher settings should be more valuable at higher resolutions (since a hand moving on a BluRay travels more pixels than a hand moving on DVD, despite travelling the same distance on your screen). Obviously, a high-motion video will tend to be more sensitive to this setting than a low-motion video.

 

Partition Type: All

As I understand it, the “most” (default) setting enables 4 primary partition types, and “all” enables a 5th, which is supposed to have negligable usefulness and slows down the encode. The “some” setting only enables the 2 most critical/beneficial ones.

If you’re using a modern 2011/2012 processor, I’d be inclined to set it to “all”. I myself haven’t noticed adverse effects on encode times (and I used “all” 3 years ago on older systems too), so if it might help sometimes, may as well keep it.

 

Trellis: Always

It’s required by the Subpixel ME & Mode Decision setting of 10 that was used earlier. If you’re doing 2-pass encodes and are finding the first to be painfully slow, you could consider setting it to “Encode Only”

 

Deblocking:
-1, -1 for film (tv/movies) and 3d animation (Pixar stuff)
1, 1 for animation (Bambi, etc)
-2, -2 for high levels of film grain

Note that if you’re trying to tune to retain film/grain, you should read over additional manual settings at http://forum.handbrake.fr/viewtopic.php?f=6&t=19426

The above are typical guidelines from x264’s “tune” settings. Unsurprisingly, this is designed to reduce “blocking” in your final video. It comes at the expense of “smoothing” the overall image though.

Generally, go with the above suggestions. If you’re seeing “blocking” in your video that didn’t exist in the source, you’re better off either increasing the RF setting (or average bitrate) first and/or playing with the AQ/Trellis settings I mention next.

Adaptive Quantization Strength: (slider)
1.0 (Default) for tv/film and 3d animation (Pixar stuff)
0.6 for animation (Mikey Mouse, Bambi, etc)
0.5 for high levels of film grain (you’ll need a high bitrate or quality setting)

These are x264 “tune” defaults and are good guidelines. The easiest way to explain this is that higher values tend to take some bits away from highly-detailed areas and put them in lower-detailed (flatter) areas. I’ve seen it explained as ringing (high AQ strength) vs banding (low AQ strength), though even that depends on the source.

From what I’ve tested, it doesn’t seem to have much visual impact for low-bitrate film encodes although it can affect the file size. Unless you’re willing to do your own testing/research, I’d recommend you use the recommended settings for a “one size fits all”.

 

Psychovisual Rate Distortion: (slider)
1.0 (Default) for tv/film and 3d animation (Pixar Stuff)
0.4 for animation (Mikey Mouse, Bambi, etc)

Again, x264 “tune” defaults, and good guidelines. This bears similarities to the above “AQ” setting in that it moves around bits. Higher values try to maintain “detail” the way you’d see it across the scene, at the expense of overall quality.

 

Psychovisual Trellis: (slider)
0.15 for tv/film and 3d animation (Pixar Stuff)
0 (default) for animation (Mikey Mouse, Bambi, etc)
0.25 for high levels of film grain

Tied into the Trellis setting above. The defaults are good guidelines.

 

Other goodies:

There’s a slew of custom settings at http://mewiki.project357.com/wiki/X264_Settings you can add in the text box.
You may have to modify some of them slightly to suit Handbrake. Settings in the text-box tend to be in the format settinga=1:settingb=5:settingc=32:etc with a colon (:) separating settings. By glancing at the text box in handbrake, you can probably figure out the format.

rc-lookahead – If you click the “High Profile” preset in Handbrake, you’ll see this pop up in the text box (there’s no option box or slider). There are a couple systems in the encoder that make use of this, and higher is generally better (max is 250). That said, rc-lookahead=60 is about the max recommended (even the “placebo” setting doesn’t go higher).

A couple reasons for this… First, it gobbles up RAM. If you’ve got 8GB+ of RAM and find yourself wishing that Handbrake would utilize more, this will do it. By the same token, if you’re on a 32-bit system or are on 2GB or 4GB of RAM, I’d imagine increasing this too much will probably crash the encoder.

The next reason is that huge values don’t really have much benefit – large values take quite a bit longer for the encode, and file size / quality don’t seem to change. I tend to set it to around 120, but I can’t say I’ve noticed any benefit.

nr – this isn’t touched/referenced by handbrake, but you can use it by manually adding nr=100 to the text box. It’s a denoiser built into x264. The good news is that it’s built in, motion-compensated, is minimal in the way of negative side-effects, will reduce your filesize slightly, and it’s fast. The bad news is that it’s not terribly good (the x264 devs are open about this) – from what I gather they only added it because they already had motion-compensated data in the encoder so it was easy to implement.

I used nr=100 and values up to nr=1000 in an encode with a very noisy/grainy source. There wasn’t a massive difference between 100 and 1000 (though quality didn’t really suffer either, and filesize went down).

Surprisingly, it’s alright at the 1 thing the denoiser in Handbrake is bad at – noise in the source during motion. See, the denoiser included with handbrake (hqdn3d) is good at temporal denoising during static scenes, but rather poor at addressing noise during motion – normally you end up having to bump up the spacial denoiser to clean that up, but at huge expense to your image.

However, the x264 denoiser does alright when catching noise during motion, which complements the hqdn3d denoiser in Handbrake quite well. I’d imagine it still pales in comparison to other motion-compensated denoisers, but it’s better than nothing, and as I said, doesn’t seem to hurt the rest of the image much (if it does at all… I really couldn’t tell – I’d have to try it on a clean source to see if I notice anything).

There are a number of other x264 settings you can manually plug into Handbrake too, but the 2 above are the only I’ve played with.

 

Chapters:

By default, if you load a source that includes chapters, they’ll be included here, often named Chapter 1, Chapter 2, etc. Not very descriptive.

Here, you can edit the chapter names.

In DVD/BluRay TV shows and movies, some have a “select scene” feature in the menu that lists all the scene names and lets you jump to a scene (which is actually jumping to a chapter). If you’d like, you can manually enter these chapter names in Handbrake. Alternately, you can visit a site like http://chapterdb.org/ and see if your movie is listed (and has actual names instead of chapters), and manually copy/paste that way. It’s also possible to import a CSV with Chapter names if you happen to obtain one.

Handbrake does NOT support editing anything other than the names though. So if your video has no chapters (or you want to add/remove some), you have to use a different program to do this.

That said, in the upper-section of Handbrake, you can choose which Chapters to encode. Sometimes a DVD/BluRay will have the last chapter be where the credits start. If you don’t want to encode the credits, check the DVD/BluRay in a video player (jump to the last chapter), and if it’s all credits, feel free to leave them out of your encode.

Note that credits don’t take a *lot* of bitrate, but in the case of something like a “Lord of the Rings” encode, they do take a long time (and cutting them out can save a good bit of filesize). In other cases, cutting them is just convenient – I’m not a fan of seeing constant credits when I watch 2-3 episodes of a show back-to-back.

 

Subtitles:

If Handbrake found subtitle tracks in your source, you can add them here (as many as you want). The “default” selection will make it the default track that plays when the video does (if there’s no default, none will play automatically unless you turn them on).

However, not all devices will play subtitle tracks. This can be particularly frustrating when you have “foreign audio” or “forced” subtitles. For example, when Jabba the Hutt speaks in Star Wars or somebody speaks Russian in a TV show. In these cases, you can “burn in” a track so that it’s now part of the picture.

But how do you know which track has the “foreign audio” subtitles? Handbrake makes it easy – select “Foreign Audio Search” along with “Forced Only” and “Burned In”. This will search subtitle tracks for anything that plays 10% or less of the time (which is usually the forced subtitles). If it finds anything meeting this criteria, it’ll burn it right into the picture so that it’s always there no matter what device it’s playing on. The only downside is that if you add regular subtitles too, they’ll overlap while the video plays. So if you’re burning in “forced subs”, you may want to consider leaving out any others.

The benefit to “Foreign Audio Search” is that if you’re not sure whether your video had a scene or two with some foreign audio, you can turn this on anyway – if there was, handbrake will find it. If there wasn’t any, nothing will be added.

Note that in some sources, subtitles are already burned-in to the picture. A good example is the US-region BluRay for Lord of the Rings (Extended Edition). So don’t panic if you don’t see a separate subtitle track in your video… it might already be burned in.

 

Audio:

Handbrake will list the audio tracks from your source and automatically add the one it believes is the main one (usually English with the most channels). You can add more tracks if you’d like – often there will be a Main 5.1ch of sorts, a Main 2.0 channel, perhaps a few 2-channel with director’s commentary, other languages, etc.

For the audio codec, most devices will play either AAC or MP3. AAC is generally considered to be superior in quality nowadays, although most people won’t notice the difference.

For AAC, the “CoreAudio AAC” codec is generally considered to be the best. However, it’s limited to those encoding on the Mac (it will play on anything that supports AAC though, including Windows machines). If you’re stuck on Windows, the “faac AAC” is the best option here, unless you’re willing to use something like MeGUI instead of Handbrake (which supports a Nero AAC encoder which is considered as good as CoreAudio)

Dolby Pro Logic II is a common mixdown option – it’ll play on anything in 2-channel, and is alright when it comes to “faking it” if you play it on say.. a home theater system with multiple channels, though you want to read further for “passthru” details which you may prefer.

Samplerate – you can generally leave it at “Auto”. If you have a reason for specifying something specific (like 44.1), go ahead and do so, but note that by manually setting it, you risk low-samplerate audio being needlessly upsampled, and vice-versa.

Bitrate – 160 is common. 128 is often considered too low (a number of people can tell the difference between 128 and 160). You could push higher, but some devices aren’t rated for it. It’s very tough to distinguish bitrates above 160, and insanely difficult to distinguish anything above 192. Note that if you’re adding “commentary” tracks, it can be a good idea to drop the bitrate of those simply so you don’t waste space – the quality of a couple people talking isn’t as critical as the main movie track, you don’t need a high bitrate to get good quality of simple voice anyway, and they often aren’t listened to frequently.

There are also “Passthru” options – these are a little riskier to use since it will depend on device support to play them. For example, you can passthrough AC3, or DTS, but if your player doesn’t support it, you might be out of luck. In addition, these don’t compress the audio stream, so passthrough is a terrible idea if you’re aiming for low-filesize encodes. If you play your content extensively through a 5.1 channel Home Theater system though, passthrough may be your best option.

 

Video:

For the codec, x264 (hopefully you didn’t read this far without committing to it!).

For the framerate, “Same As Source” (Variable Framerate) is generally best unless you have a very good reason to target a specific rate. This goes double if you do anything like detelecing the source. Really, “same as source” is awesome. Setting something manually just runs the risk of creating issues.

Constant Quality vs Avg Bitrate – Both work in a similar fashion. They both vary the bitrate throughout the encode – using more bits when necessary, and less bits when they’re not needed.

The difference is that Constant Quality targets a certain level of quality whereas Average Bitrate essentially targets a file-size.

Note that “compression-type” improvements in the advanced settings tend to affect these in different ways. With Constant Quality, higher settings (like going from 1 to 5 reference frames) will tend to maintain the quality level you set, but decrease the file size. With an Average Bitrate, an improvement (like going from 1 to 5 reference frames) will tend to maintain the file size you chose, but increase the quality.

A great example of a benefit of CQ here is if you’re encoding a TV series with Constant Quality. Episode 10 will look as good as Episode 1, even if Episode 10 had a zillion explosions, lots of movement, etc. Sure, Episode 10 might end up being a bit larger, but Episode 15 which had people standing around talking for most of the episode was probably a bit smaller.

On the other hand, had you used an Avg Bitrate instead, Episodes 1, 10, and 15 would probably be roughly the same file size. Episode 1 might look good, but Episode 10 might look terrible. Episode 15 might look the same as Episode 1, but could be larger than it otherwise would have been if you’d used Constant Quality instead.

Really, the only tangible benefit to Avg Bitrate is if you’re targetting a specific filesize. If you absolutely require all your shows to be 350mb so that you can fit 2 per CD, pulling out a calculator and calculating the Average Bitrate is the only way you’re going to be able to do it easily. And because Average Bitrate needs 2-pass to perform best (since it has to figure out how exactly it should pack all the bits optimally into the file-size bottle), you’re also spending more time during the encode – had you gone with Constant Quality (which doesn’t need a 2nd pass), you would have saved time – time you could have put into a higher quality advanced setting if nothing else.

Constant Quality does look more confusing on the surface at first. You have an RF setting, and if you’re new to this, you probably have no idea what it means. To start, lower settings here mean higher quality. RF:16 will be much better quality (and larger in size) than RF:24 for example.

As a basic guideline, RF:20 is a common starting point for DVD encodes and RF:22 for BluRay encodes. If you’re a real stickler for quality, 16-18 for a DVD might be more ideal (or even lower numbers if you’re determined to make it indistinguishable). On the other hand, if you’re looking for really low filesizes and are willing to accept that it won’t look as good as the source, 22-25 can work for DVD’s.

After a few encodes with Constant Quality, you should have a good idea as to what setting you prefer, whether you’re looking for high-quality, or are looking for low filesizes.

If you do need Avg Bitrate though, go with 2-pass. The encoder really needs that 1st pass to learn which scenes are complex (and will need more bits), and which scenes are simple (and will need fewer bits) before it actually goes and starts allocating things.

Think of it this way. If you’re hosting a party and have 350mb of pizza to go around (i know pizza isn’t measured in MB – bear with me), it’s good to know how many people are arriving beforehand, and ideally how many are kids (small eaters) and how many are adults (big eaters). 2-pass is like that – it does some research beforehand (during the 1st pass) so that it can cut up the pizza properly so that everybody is fed (during the 2nd pass). Without that research, you might start handing out too many portions to people at the beginning and run out when the adults arrive later.

Ok, not the greatest analogy (better than the “milk” one I was going to use mind you), but you get the idea. 2-pass is good if you’re going Average Bitrate. If encode time is an issue, you can use “Turbo first pass” – it does less thorough research beforehand, but is still much better than none.

 

Video Filters

(Recommended)
Detelecine: Default
Decomb: Default
Deinterlace: Off
Deniose: depends
Deblock: Off (usually)

Handbrake is beautiful in this area.

For both Detelecine and Decomb, at the default settings Handbrake looks for telecined and interlaced content, and then detelecines/deinterlaces as necessary (and only IF it detects these things). That means you can set-and-forget. If you have a really weird issue with an encode you can go and turn these on manually, but 99% of the time there’s no need to. Set them to default and let Handbrake do the work of determining whether they’re needed.

 

Denoise…. I’ve gone into details in a long post here. UPDATE: A new, better post with images/video here. The short version is that If you have noise (or film grain) in your SOURCE that you want to get rid of, start with the “Weak” setting. It will “smooth” your image some, but will usually at least reduce the noise/film. If “Weak” isn’t enough, I strongly suggest reading the write-up and using custom settings because “medium” and “strong” tend to soften the image too much, making people look like Ken & Barbie dolls.

It’s worth noting that because denoise smooths out detail, it also reduces the filesize (or increases quality) of your encode. If you’re ok with the results of the “Weak” filter, it’s a great trick to bump down the file size of your encode rather substantially. However, you do run the risk of over-smoothing or banding so don’t be overzealous.

 

Deblock…. this is supposed to remove “blocking” that exists in your SOURCE. It really smoothes out video to the point where it probably causes more damage than it fixes (I can’t stand it). If your source has heavy blocking for some reason, it may be worth the trade-off to use it.

Note that the Deblocker in handbrake has a similar effect to high de-noise settings. Because it drastically smoothes, it tends to destroy grain and other noise. That means you could effectively use it as a denoiser. In some cases it will do a better job denoising than the denoiser.

 

Picture

I’ll assume you’re not trying to resize the video (if you are, I’m sure you’re capable of figuring out how).

Anamorphic is almost always used, since it acts the way a DVD would, and plays well with both computer software players and various devices. Reading up on the Handbrake site is probably the easiest way to go here for further details on what it means.

It used to be that Anamorphic LOOSE was recommended because it makes everything divisible by 16 for the encoder. However, from what I gather the encoder has improved, and Anamorphic STRICT is generally the preferred way to go now (since loose might do some slight resizing which we usually don’t want).

 

Cropping – Automatic is usually fine. Handbrake basically looks for (and then chops off) any black bars in the source. Nearly every player will add it’s own black bars (since the video is set to Anamorphic), so encoding them is senseless.

You can of course manually set these if you have a good reason to.

 

 

Well, that’s that. All on one (really long) page, so you’re not exposed to a zillion ads in a multi-page article.

I should end by noting that this may not all be 100% correct. I’ve gathered the information from as many sources as possible, but chances are I read something I shouldn’t have taken at face value.

So take it with a grain of salt, and do your own tests before you spend a week encoding a TV series only to find that it all went horribly wrong because I made a mistake somewhere :p

 

Good luck!

Leave a Reply

74 Comments on "A rundown of Handbrake settings (0.9.6)"

Sort by:   newest | oldest | most voted
Amber

Hi,
Great article but I’m looking at this from sort of the opposite direction ie maximum file and as near to the original as possible. Any suggested set ups for this please?
Thanks!

Roger

Nice guide.
Still there is one question left: HB can use Profiles h.264 mainline + high or the advanced tab. Is there a way to encode in 10 bit (high 10), instead of high without losing the advanced tab? Maybe a console parameter?

Erico
Erico
Very Good article indeed, however i would like to add an important note regarding B-FRAMES and GOP sizes. There is TONS of comments which i didn´t read all, so if this is already discussed just take this postage as a reinforce of the importance of this matter. Differently from most of others settings, when increasing the number of B-frames and GOP sizes, (b+p frames), despite increasing codec efficiency, you actually lose a very little tiny bit of fine detail. B and P frames cumulates rounded lossy compression motion information, thus, lose original fine picture information, the more you have of then, and the larger the GOP, the more fine information will be cumulative lost. This is specially true on noisy/grainny sources like a DSLR high-iso footage. They do however increase overall compression efficiency, and thus, on a restriced file size, overall quality. However, on a constant quality setting on a… Read more »
bjk_kds

your two articles are very helpful n clearly explained, since i’m newbie about encoding work..
thank you so much.. 🙂

François Racine

Personnally, I tried detelecine once and the sound got unsync. It was correct on VLC but not on my bluray.

mark

hey matt, do you think your guide is still up to date? I’m planning on using it for ripping my collection with a recent nightly version off handbrake. I’m also willing to set near placebo quality so just wondering if anything major has changed since last summer.

many thanks for the great guide

OldSchool
I have a small collection of downloaded videos from the days long ago when I lived in a place far away that had super-speed internet and no interest in enforcing US copyright laws. Most of them are scene releases that, as has been noted above, often achieve great quality at small file sizes. I personally have viewed a large part of my collection on 40″ and larger full hd TV’s and find the quality of the old XviD rips adequate. As long as there are players that play the files, I think the playback technology will continue to improve the “psychovisual” aspects of even older rips. Anyway, since I started making my own, my objective has been to continue building my collection at roughly the same quality and file size. Looking at file properties in my downloaded collection, I see that the visible standards for h264 scene releases, after the… Read more »
Oddbrother
Oddbrother

Anything regarding subtitles settings that we can change over in videos to make them compatible with Xbox Video?

It’s an app for Xbox 360 and Windows 8… Dunno about Windows Phone, though.

Mike

#-o !!
Sorry for the post. I found the “denoise” discussion. That is what I get for just staying in handbrake discussion.

The quest

Mike

Matt –
Thanks for explaining some of the behind-the-scenes voodoo.

I do have a couple of questions though –
Could you explain some of the denoise settings that you mentioned in earlier posts? If there is anything that bugs me is to have a transcode that suddenly turns to garbage when there is a cut to a dark scene….

I also read somewhere (don’t remember where, could have been the HB forums) where it was indicated that the order in which settings were entered in the x264 encoder options box. Is there any merit to that?
Thanks!

Andrew Smith
Hey Matt, Relying heavily on your excellent guide, I felt for a time like I was getting pretty slick at hitting my file size / quality targets, when ripping my blu-rays. I was happy to get older, grainier movies down around 7 to 10 GB, and newer films around 4 to 6 GB. That is until I acquired an .mp4 of a recent movie, made by the torrent guy / group YIFY. It really blew my wig off – 1h58 runtime, 1.72 GB video stream, at 1080p with practically no loss of quality. The picture might be a bit softer than the original source (pure speculation, I have not seen the original) and the audio is definitely not up to my standards (142 Kbps max. stereo AAC). Some colour accuracy may have been lost. But man… it’s still WAY better than I’ve been able to pull off in Handbrake. There… Read more »
Darrell

I’m not too “techy” on this encoding stuff, so your article helps. I’m looking for a simple answer/solution to the issue of rather narrow video on the iPad2 after encoding from DVD via Handbrake (using MacBook Pro). I’ve tried the universal and iPad presets. I thought the Anamorphic loose vs strict would address it (tried to understand this in the Handbrake help), but it has not. Seems like the picture size output of 720×352 is the constraint (right?). Any simple work around to get the video to fill my iPad screen better?

Brian
Hi Matt, Excellent job – very helpful. No matter what the settings it seams, I still experience a subtle issue with judder during movement that pans across a screen. It is always worse with DVD encodes than BluRay. I have a dual core 3GHz w/ 6GB RAM along with an NVIDIA GeForce 210 510mb running HDMI to a Denon Receiver and then to a 55″ LED LCD. I’ve tried bumping up the priority of VLC to high in Task Mgr. I’ve also tried bypassing the receiver. These same encodes work flawlessly on my slower laptop when copying the file to the local drive. Some have mentioned that AC3 Passthru Audio could be the problem. I’ve considered that and tried different audio formats but it doesn’t seam to make a difference. The advantage to AC3 Passthru, as written in the Handbrake guide, is that you do not lose the Subwoofer channel… Read more »
Luis

Outstanding Guide. I use it as a reference. Thanks.

Neil
Neil

Very helpful. I use this in the advanced field to ensure that I remain in compliance (within spec) of the AppleTV 3 and AppleTV 2:
vbv-maxrate=25000:vbv-bufsize=31250

-Neil

Guy

When using the custom advanced settings instead of high profile my fps drops to around 6 from 30 for blu rays is there anyway to fix this

Zak
After doing some test encodes, I came across an issue, maybe you can help. The TV episodes I am encoding are 4:3 ratio. When I play the encoded files on my WDTV, the video does not fill the entire screen. There’s black bars on the side, which is expected since its 4:3 content playing on a 16:9 HDTV. Here is the thing, when I play these DVDs on my HDTV using my Sony DVD player, the DVD player fills the entire screen. I thought maybe its stretching the image, but the image doesn’t look stretched. I do see a slight cropping compared to playing the files on my computer, so maybe the DVD player is automatically cropping and stretching the video to fit the screen? Whatever its doing my wife wants the files I am encoding to look the same. I checked the various settings on my WDTV player and… Read more »
Jared

Well, I really found this write-up helpful, so thank you for that. As a hobby, I record some video game gameplay; would the settings that are best for film and 3d also apply in this case?

Zak

First, thanks for the write up. Can you post your custom profile .plist file or post the code that’s at the bottom of the “Advanced” tab?

Thanks!

Daniel

Hi
First of all. Great Handbreak guide!
I have a question about the subs.
I use the “basic settings” for a high profile mp4 rip with strict anamorphic and automatic cropping. When I watch the movie with the subs on in VLC, the subs are moved up into the movie. About the same distance as when its uncropped.
Can I do anything to place the subtitles in the correct position so the don’t cover the movie?
(I’m from Sweden so please don’t judge my english 😀 )

Andrew Smith

Hi Matt,

Just wanted to drop you a big thank-you for putting together this Handbrake guide – it is the clearest, most complete of its kind that I have found online, and has been incredibly helpful in the task of converting my movie collection to files!

Jacopo

For the AAC Codec… the BEST option is “AAC (ffmpeg)” in Windows version of HandBrake: is slightly better, because it keeps better definition of the original AC3 audio. 😉

Gazza
So all if this testing is based on the assumption that when using CRF, the quality of the video is maintained, and only the size of the file changes with each adjustment to the settings. If this is not the case, disregard. I only tested Reference Frames; B Frames; Motion Estimation Range; Subpixel ME & Mode Decision/Trellis (combined); Psychovisual Trellis; and Deblock. First of all, Deblock did not alter the file size or increase encode times. Reference Frames: 4 – (base value) 9 – 40% Increase in encode time ; 0.35% Reduction in file size B-Frames: 4 – (base value) 16 – 32.5% Increase in encode time ; 1.27% Reduction in file size Motion Estimation Range did NOT alter the file size, but did increase encode times: MER 24 – (base value) MER 16 – 3% Decrease in encode time MER 32 – 6.5% Increase in time MER 64 –… Read more »
Gazza
Thanks for the reply Matt. Yes I was originally using Deinterlace until I read this. Then I checked it with Decomb and it was fine; looked the same and the log showed that it de-interlaced every frame except 1. I might try testing encode times to see if Deinterlace is faster(maybe because it doesn’t have to check each frame) seeing as I know the source video is interlaced anyway. That’s great advice regarding the quality settings, you’ve convinced me to go down to RF 19 or maybe even 18. I was originally doing RF 20 and getting file sizes of about 6.5g but I’m happy to use a bit more space with that in mind. It’s impossible to get old games here, unless it’s a final, and even then you’d be lucky to get it if it was 10 years old. I spent some time last night testing different setting… Read more »
Gazza

Very nice!!! I’ve been looking for a tutorial like this but most seem to skip over these specific options.
I have recently started to capture and encode 1080i Sports content(NRL in Australia) for archival purposes and would like to get the best quality possible! Without having enormous file sizes obviously.
I’m now using your settings as a template 🙂

Do you suggest any further adjustments that will be more effective specifically with sports?

After reading through I am guessing I should set the Motion Estimation Range to at least 64.
Deblocking to -1, -1?
rc-lookahead to at least 60.
Any suggestions would be great and thanks for this amazing guide!

Ralphaldo

Good tutorial!
I just ran into a snag if you can help me out please. I am backing up my Bluray, video is VC1 Advanced@L3, when I encoding using these settings I end up with a High@L3.1 (I also resize down to 720p). Is there a way to encode this and result to High@L4.1?
Thanks for all your knowledge and great site 🙂

Elliott Klein

Hi there: a quick question.
If my source file is an AVC TS file (Level Main 3.1) with 2 references frames, is there any benefit of pushing it past 2 in Handbrake? Thanks.

Rilwan

i m converting videos which are already brrip(mkv HD) to m4v for itunes. i dont want to play those files on my ipod as im converting a different version for ipods (HD-SD)… after the encode (i use AppleTV 2 preset) i tag the movie with metaX. but when i m playing it on itunes it the video gets stuck at some places and especially when i skip the movie to somewhere. SO WHY IT HAPPENS?? i have intel i3 processor 2gb ram… but 720p videos from itunes store plays very smoothly..

George

Kudos for this great summary. I’d basically given up understanding these setting and just ran high profile. I’m trying an encode with your settings as I type…. thanks again!

Swizzle Dizzle

Good stuff, mon! Using the Google Machine to study Handbrake settings led me to this page but your entire website is lovely. Keep up the excellent work!

Giorgio
Giorgio

Thank you so much for the article. I was looking for something like this for so long! It’s very complete and interesting. Congratulations and keep going on.

Harry
Hello, Just to let people know about my encoding testing: I came to the conclusion that 2-pass encoding combined with no-mbtree=1 is a much better idea for movies in which dark scenes are a problem. Especially when you have movies in which darks scenes are sort of grainy and hazy. For instance, my Madame Bovary DVD is rather poor source material, the movie is from 1991 and it looks washed out. A Bluray would be much better of course. But I only have a DVD as of now. How did I tackle it? I set no-mbtree=1 in the advanced options string box. Then I used 2-pass encoding and restricted the bitrate. Because if you set no-mbtree=1, the bitrate for each frame increases — not only for the dark scenes, but also where no-mbtree=1 is not needed. So with constant quality encoding, you’d end up with a significant bigger file size.… Read more »
Harry

Forgot to add where I found this info:

http://forum.doom9.org/showthread.php?t=159259

Someone wrote:
“[…] I have noted that with mb-tree on the encode at the same bitrate as the no-mbtree one has lower quality in dark grainy areeas, […]”

And another guy:
“[…] MB-tree basically tracks detail through time. Something that “is there” for several frames … is more important than something that’s there for only one frame.
Grain, per quasi-definition, is “detail that changes every frame”. So it’s not difficult to imagine what MB-tree “thinks” about grain. And of course, in a dark scenery every unwanted deviation is much more obvious […]”

Harry
Me again. After spending a whole day with testing various methods of encoding my ‘Madame Bovery’ DVD which has some dark scenes in it that usually get screwed by HandBrake’s x264 default settings, I found a ‘magic setting’ that works for me to retain the faint and almost blurry details in dark scenes, which otherwise would end up in a blocky pixel mush. Something has been implentend in x264 which is called ‘Macroblock Tree Ratecontrol’ (mbtree). This is enabled by default. And if it’s enabled, it screws dark scenes. To switch it off, there is the setting no-mbtree that has to be set to 1: no-mbtree=1 Just add this to the ‘advanced option string’ box. Then it might look something like this, for example: weightp=1:subq=9:rc-lookahead=10:trellis=0:b-adapt=2:deblock=-1,-1:no-mbtree=1 There is no checkbox for the mbtree thingy, so you have to do this via the advanced string. For me, this setting worked wonders for… Read more »
Harry

I noticed that 2-pass encoding sometimes is superior when it comes to sources with very dark scenes, especially when there’s grain involved. With constant QF (constant quality factor) it’s sometimes impossible to tackle those scenes and they become a big pixel mush in the end, with lots of artifacts and blocks. There adaptive quantization, yes — but increasing the value of this slider also increases file size for all other scenes where it’s not necessary. This is what really sucks about the x264 encoder. I wish there would be an option to set some sort of markers to tell the encoder that this or that scene should get extra analyzation and more bitrate. A combination of constant quality + 2-pass encoding would be nice.

Great article, there’s a couple of things though that I thought I’d point out. If you’re using something like “Playon” to stream your movies to a PS3, Google TV or WII (or even your Tablet or Phone), it’s usually not a good idea to “Pass Through” a DTS encoded Audio, since it tends to cause jittering or pausing of the video and other Sync issues with DLNA devices. The same is true with MKV containers. It’s best to stick with MP4. As for the audio, Probably your best bet would be to encode in either AAC or AC3, which leads me to another issue. You need a minimum of 320 to 384Kbits/s in order to preserve the full 5.1 surround sound, so if you’re planning on hearing the woosh of the Millenium Falcon pass first from your left front speaker to your left rear speaker, 160Kbits/s isn’t going to cut… Read more »

hi, nice article there matt. i wanna ask to you, how can i get minimun a half of size from my tv series with your setting above? i’ve tried to change quality in video tab from RF 20 to RF 30 but the size of file bigger than before. i’ve tried to convert from .avi to .mp4 also, and it takes a long time story to waiting it done.
i used handbrake 0.9.8, and i remember in handbrake 0.9.5 it had option to used small (custom file size). any idea matt?
thanks for your reply 🙂

Barry

Everything is great especially visually.
But I forced subtitles into Star Wars III to get any alien speech to come through
However it also burned in the Directors name at the top of the screen every time someone new in the Directors Cut spoke
The audio didn’t contain the commentary, as I didn’t want it, but i now have a copy with Directors names coming up every couple of minutes or so

Any way to get the alien subtitles I want without the commentary names?

I figure this would happen with most DVDs that have a commentary track

KlarcC

Wow, thanks a lot for all those details! Handbrake advanced settings are now definitely more readable for me.

Jamie

Superb article. I’ve always wanted to dabble in the advanced settings in HandBrake – and while the help files are certainly very thorough, this article was the best place i’ve yet found to really break them down into layman’s terms.

wpDiscuz