HandBrake Settings for Converting BluRay Movies

I’m using Plex to watch movies which means I don’t need the physical media. Plex is great but it doesn’t support ISO images, VIDEO_TS (DVD) or BDMV (BluRay) folders:

Simply put, these formats just don’t fit into the idea behind the Plex ecosystem. They hide content behind built-in menu systems….It just isn’t feasible to try and present a DVD menu type interface in some of the devices.

Fortunately we don’t live in the year 1999 and converting is easy. I’m using HandBrake to do it. If you spend few minutes searching for best settings, you quickly realize there is no such thing. The settings are always compromise of the following:

  • Time it takes to encode
  • Quality e.g. Bitrate (watch on 32” tv vs. 120” projector screen)
  • File size (5GB, 10GB etc.)
  • Compatibility (PC plays anything, other devices might not)

This means you need to tweak the settings to fit your requirements. Do you want quality or fast encodes? Do you want to restrict the size so the file can be burned on DVD? Think about what you want and change the settings accordingly. My settings are based on the following:

  • I watch movies from TV (1080p now, 4K in the future)
  • Quality should be good for 65” - 75”
  • I don’t have hard limits on file size. 20GB per movie is fine.
  • I don’t care how long encoding takes
  • Plex should be able to stream the movie
  • No crazy h264 profiles or settings (compatibility)

Picture

Settings for Picture

I don’t really touch these settings. Anamorphic has no effect on BluRays and I’ll leave cropping to Automatic.

Filters

Settings for Filters

Only thing to note is the Decomb setting which should be Decomb. This way you don’t need to check if the source is interlaced or not (for BluRays it usually is not).

Video

Settings for Video

HandBrake itself recommends Using 20-23 for Constant Quality for HD content which should be fine for 1080p content. However, I want higher bitrate so I set this to 18 or even 16. The difference in bitrate depends on the movie but with my limited testing using 16 over 18 gives 25-33% higher bitrate with the cost of larger file size.

Since I don’t care about the encoding speed I’m setting x264 Preset to Very Slow. The general guideline is to use slowest preset that you have patience for. Since I’m using constant quality the Very Slow generates slightly smaller files.

The x264 Tune is usually set to Film, Animation or None depending on the content. Setting it to None is safe option if you are not sure what type of content you are dealing with.

I usually leave the H.264 Profile to Auto and H.264 Level to 4.1 and so far I haven’t had any problems playing files with different devices.

Audio

Settings for Audio

I take the original DTS-HD and DTS audio as is. Just to be sure that I can hear something I’ll convert DTS track to AC3. This is for those rare cases when I want to take couple movies with me and I don’t have time to encode versions for Android.

Subtitles, Chapters & Advanced

Nothing special with these. Just select the subtitles you want and obviously all the chapters since you want the full movie. Advanced tab is empty unless you go to Video tab and check Use Advanced Tab instead.

Conclusion

With these settings I’m able to convert BluRays into .mkv files with good quality.

Using Notepad++ to Write Git Commit Messages

When configuring new machine, I never remember all the small tricks and I end up googling for solutions. The information presented here can be found from the How do I use Notepad++ with msysgit post. You just have to put the different steps together. I decided to document it here so that I don’t have to wade through multiple stackoverflow posts next time.

Problem

After issuing command git commit lot of people find themselves in the following situation:

VIM as editor

Technically you have an editor open and you could just write the commit message and continue. That is if you know your way around vi. As with all things Git there are many ways to do things and end up with the same result. The solution presented here is not the only way to achieve the same result.

Shell script to start Notepad++

Note that I’m using Git Bash so if you are using Command Prompt or PowerShell you need to tweak the script to suit your environment (e.g. write valid .bat file).

Create file called npp.sh with the following content:

#!/bin/sh
"c:\Program Files (x86)\Notepad++\notepad++.exe" -multiInst -notabbar -nosession -noPlugin "$*"

Double check that the path to notepad++.exe is correct.

When you save the file, use Unix type line endings

UNIX Line Endings

PATH

Script is ready. Next I want to be able to just type npp.sh <file> to make quick changes. For that to happen I will put the script into my PATH:

  1. Create folder C:\Tools
  2. Put npp.sh into C:\Tools
  3. Add C:\Tools into your PATH

That last step you can do by opening Control Panel and searching for Environment:

Control Panel

Click Edit environment variables for your account and add C:\Tools into your PATH.

Configure editor in .gitconfig

Technically we are not setting editor for just commit messages but a default editor.

git config --global core.editor npp.sh

If you look into your .gitconfig you can see the editor configured as follows:

[core]
editor = npp.sh

Testing

Open new instance of Git Bash and test it:

$ mkdir npp-test
$ cd npp-test/
$ git init
Initialized empty Git repository in C:/npp-test/.git/
$ echo "testing" > file.txt
$ git add file.txt
$ git commit

Once you execute git commit Notepad++ should start:

Using Notepad++ to write commit message

Write your commit message, save it and close Notepad++.

Problems

If you run into problems, check the following:

  • Is C:\Tools in your path (env|grep Tools)
  • Does npp.sh point to notepad.exe

Why not Notepad

You could use Notepad but writing commit messages will most likely look like this:

Using Notepad to write commit message

As you can see Notepad does not handle the UNIX style line endings correctly. I don’t know if this is related to Git Bash. Maybe you have better luck if you are using Command Prompt/PowerShell with Git.