Best Practices For Using Handbrake to Encode Films on DVD

I’m planning to batch-encode a few series I ripped from DVD. Each of them were filmed, mostly widescreen. I’m planning to encode the episodes to HEVC MP4’s via Handbrake. I want to make sure I nail the proper frame rate at the best quality. I’d rather do this once, so I wanted to bounce a few questions off the community. Here are the settings I’m planning:

Detelecine: Default
Deinterlace: Decomb | Preset: Default | Interlace Detection: Default

Video: x265
FPS: 23.976, Constant (I’ve run into issues in the past with variable frame rates, and I see no reason not to use Constant)
Encoder preset: Medium
Encoder tune: None (none of my content contains much grain)
Constant Quality: 20

Audio: Auto-Passthru AC3

A couple questions here:

  1. Is there any reason to consider Deinterlace mode of Yadif/Default instead of Decomb/Default? Any advantages? (Yadif/Bob is out because it keeps the pulldown)
  2. Is it really worth re-encoding AC3 to 5.1 AAC? The size savings are not hugely significant. Are there Plex-related advantages I should consider? In terms of later transcoding, it seems to be a wash, because many of my clients need AAC, but my receiver requires AC3. So either way, it’ll have to transcode audio at times.
  3. Anything else that I haven’t thought about, but should?

Thank you!

if your client supports it and you’ve got sufficient storage… why transcode it?

@tom80H said:
if your client supports it and you’ve got sufficient storage… why transcode it?

My clients don’t support MPEG2 (well, not all of them!). I’ll adjust the verbiage above so it reads better!

Personally I’d stick with one of the default templates. Those are mostly quite well balanced and compatible.
From what I’ve seen, 6-channel AAC is more problematic than AC3 in most cases.

If I may add?

H.264 is mainstream and much easier to decode. Almost all players accept H.264 natively meaning DirectPlay is much more likely to happen. The same is not true of H.265 / HEVC. It’s a much more complex encoding (why it takes so long to encode and reduce the file sizes)

@ChuckPA said:
If I may add?

H.264 is mainstream and much easier to decode. Almost all players accept H.264 natively meaning DirectPlay is much more likely to happen. The same is not true of H.265 / HEVC. It’s a much more complex encoding (why it takes so long to encode and reduce the file sizes)

Absolutely, I appreciate your thoughts!

I might be an edge case here: I know that all the clients in my house (including the phones) can direct-play HEVC, so it’s relatively safe to use as a codec. For the rare cases where I’m streaming via mobile network, I’ll likely be using hardware transcoding with Kaby Lake, so that shouldn’t be too taxing on the CPU either. I switched from AVC to HEVC as my primary codec six months ago and it’s been a big success.

My main machine is a 6-core Ryzen, so encoding SD material is relatively swift. When decombing or deinterlacing, Handbrake can only use 3 cores, but you can run two simultaneous processes to load the CPU. I’ve used the technique with much success, it’s very handy.

I definitely still considered AVC here for compatibility reasons (I don’t do much friends/family sharing right now, but who knows later?), but the file size savings admittedly came into play: I’m encoding the series of “Bones”, which has 246 episodes alone! Remove 50-100MB per episode (rough guess!) and it adds up quickly. I made the call to take longer encoding HEVC now, and have the extra space over the long term. But it’s also why I’m being so careful to nail the encode settings the first time.

I use Handbrake also.
I’m with ChuckPA on this one - for DVD/SD ~480p source content, I’d stick with h264.
My logic is that storage is a much cheaper investment in the long run than having to worry about more CPU power of either the server or the client later. Because most of my main viewing in my home theater and home office/bedrooms use Rokus, I aim for the heavily custome tweaked profile for Rokues. Before Handbrake released 1.0 with Roku profiles, I followed guides on this site http://www.rokoding.com/ . I use the guide settings from that site even now, but with some tweaked QSV advanced settings (that wouldn’t assist you to include here). Though most I share with don’t have Roku’s, they’re able to direct play or stream most of my content. (according to my Plexpy graphs)
From what I’ve seen around the forums, Plex and/or perhaps ffmpeg, and/or perhaps it’s profiles aren’t optimized for H265 yet, even if the player can direct play.
Just because your devices may be capable of playback directly doesn’t necessarily mean PMS knows that. PMS often seems to use a player profile aiming for the lowest most compatible denominator of all of a device platform type, understandably so with such a diverse range of hardware for the platforms Plex supports.

But to answer your original questions
My recs if you just must use 265

FPS: Same As Source, Constant
Encoder preset: HIGH
FILM
Constant Quality: Might try even 22-23 - gets me a 1500-2000kbps vid stream, good for SD (at least using h264

  • I’ve no clue about h265
    Audio: 2 streams - how many audio devices will you actually use that have surround -
    First - use 2 channel AAC - 160kbps - Dolby Pro Logic II - 2 channel AAC is compatible on a lot, AAC+, not much.
    2nd stream - AC3 passthrough

@“Cafe Diem” said:
A couple questions here:

  1. Is there any reason to consider Deinterlace mode of Yadif/Default instead of Decomb/Default? Any advantages? (Yadif/Bob is out because it keeps the pulldown)

No - most sites, I think even handbrake.fr docs, recommend decomb over deinterlace

  1. Is it really worth re-encoding AC3 to 5.1 AAC? The size savings are not hugely significant. Are there Plex-related advantages I should consider? In terms of later transcoding, it seems to be a wash, because many of my clients need AAC, but my receiver requires AC3. So either way, it’ll have to transcode audio at times.

See my two streams recommendation - 1st/default = 2 channel AAC 2nd = AC3. Plex will then send what the device has configured to play by default, often requiring no transcode

  1. Anything else that I haven’t thought about, but should?

See my storage room/compatibility versus transcode/multiple devices

Few comments:

I use Same As Source / Variable Framerate instead of constant. I’ve never had issues (Shield TV, Amazon Fire TV, Amazon tablet), but understand you may need to avoid for some clients.
See https://handbrake.fr/docs/en/1.0.0/technical/frame-rates.html and https://handbrake.fr/docs/en/1.0.0/technical/video-cq-vs-abr.html

I set RF=18 for DVDs and 20 for blu-rays. Just what I started with & works for me. Adjusting +/- a few either way shouldn’t make much difference. Definitely avoid going to something like 15 or smaller (higher quality). You won’t see the difference and the file size will increase logarithmically.

For interlaced source material, I go with decomb/default/default. I’ve experimented with other settings and can’t see any difference.

For audio I generally go with:
1st/default: AAC/320kbps/Dolby Pro Logic II
2nd: AC3 passthru

Reasoning:
In addition to Plex, a family member has a iPad/AppleTVv3/iTunes setup. The AppleTV supports AAC up to 320 kbps, which is noticeably better quality than 160kbps (not w/ ear buds, but if fed to home theater system).

AC3 audio on most DVDs is 5.1 channels at 448kbps. I just pass it through. The receiver picks up the stream w/o issue.

Of course, above is only a guide. Adjust as needed and to what best fits your needs.

Some DVDs, especially for older movies, may just have stereo audio, generally AC3 2.0 @ 192kbps. Oversampling to 320kbps doesn’t buy you anything.

Also, some DVDs may have 5.1 dts audio at 768kbps or higher rates. Since that isn’t supported in iTunes, I go with AC3/640kbps/5.1 channels. It is subjective, and not a blind test, but to my ears dts 5.1@1500kbps converted to AC3 5.1@640kbps sounds better than AC3 5.1 passthrough at 448kbps (better dynamic range & clarity).

One more comment. If you’re really focusing on file size, and don’t care about encoding time, look at using the VerySlow preset. It seems to produce the smallest video sizes.

You can tweak some settings on the Advanced tab as well.

  • Pyramidal B-Frames = strict
  • Trellis = always
  • You can try increasing reference frames, but the Handbrake pop-up says it may cause problems w/ some clients (I’ve never had problems).

Experiment with encoding a few minutes of video (no audio) with different settings and look at resulting file size. You’ll find the right tradeoff between fize size and encoding speed.

Quick follow-up.

Be careful increasing reference frames on HD material (blu-ray rips, etc). If you go above 4 or 5, it may cause problems with old or lower end clients.

I recently ran into an issue where some movies played on a Fire TV Stick gen 1 were transcoding. I had increased the reference frames when encoding some movies. As such, Plex (correctly) saw them as High@5.0 or High@5.1. The Fire TV Stick Gen 1 can handle High@4.0 max. Hence, the transcode.

I re-ran the source blu-ray rips through Handbrake, leaving the reference frames at their default value. The movies now play on the Fire TV Stick w/o forcing a transcode.

So, lesson learned. Don’t muck w/ the reference frame settings… :slight_smile:

I found a H264 Maximum References Frames calculator online. You can pop in the video dimensions and find the max reference frames for a given H264 level. For 1080p blu-ray rips it will probably be either 4 (1920x1080) or 5 (1920x800). But there’s no real need to manually set the value. Just use Handbrake defaults and everything should be fine.

I appreciated everyone’s feedback, and your detailed info was perfect @FordGuy61 so thank you! I’m suddenly glad I’ve never adjusted Handbrake’s defaults for reference frames.