Friday, December 30, 2016

Backup your DVD and Blu-ray Libraries with HandBrake on Windows

I've been using Plex for several years now and love it! If you haven't heard of Plex, you must go check it out (https://www.plex.tv/) as it basically allows you to create your own personal Netflix with all your own content. However, my biggest issue with Plex was not having an easy way to "backup" my physical DVD/Blu-ray library for use in Plex... A hurdle I only recently overcame. In my research I never found an article/tutorial/walk-through that fully covered the use of Handbrake on Windows for both DVD and Blu-ray. Thus the reason I thought this would be an excellent walk-through to share. I believe the following process can also be done on Mac and Linux, but my instructions are assuming you're running 64-bit Windows 7, 8.1, or 10. So here goes...

1) Download and Install HandBrake
Download HandBrake from https://handbrake.fr/downloads.php and install.
HandBrake will be the utility used to create the "backups" of your physical DVD and Blu-ray library. HandBrake is an open source application that can transcode (convert) almost any video file into a more openly supported file, using "a selection of modern, widely supported codecs." -excerpt from https://handbrake.fr/. I've used a few different transcoder apps, but HandBrake has been my favorite by far.  HandBrake on it's own cannot "backup" a DVD or Blu-ray.
2) Download and setup VideoLAN's libdvdcss
Download libdvdcss from http://download.videolan.org/pub/libdvdcss/1.2.12/win64/libdvdcss-2.dll and copy "libdvdcss-2.dll" to C:\Program Files\Handbrake\ (HandBrake default installation directory).
VideoLAN's libdvdcss is an open source software library that has the ability to decyrpt DVDs encrypted with the Content Scramble System (CSS). At the time of writing, version 1.2.12 was the newest version available for Windows. Placing "libdvdcss-2.dll" in HandBrake's installation directory, allows HandBrake to decrypt the DVD's CSS on the fly. At this point, you can now skip down to step 5 to create the "backup" of your physical DVDs. If you have a Blu-ray drive, continue on to add support for Blu-rays as-well.
3) Download and Install MakeMKV
Download MakeMKV from http://www.makemkv.com/download/ and install. Use the monthly beta key made available here https://www.makemkv.com/forum2/viewtopic.php?f=5&t=1053 to register the beta software.
MakeMKV is another transcoder application (like HandBrake) but has the ability to "backup" Blu-rays. Please note that MakeMKV is a beta application and currently includes a 30-day trial when installed. If you like the application, I would recommend purchasing a license, but monthly updated beta keys are made available on the forums (see link above) which can be used to keep the free beta application registered. At this point, you could use MakeMKV to "backup" a Blu-ray into an undegraded MKV file (mine have been around 40GB in size) and then use HandBrake to re-encode that MKV into a new smaller file, but then we're doing two encode processes which each takes time. Continue on to give HandBrake the ability to use MakeMKV on the fly.
4) Enable MakeMKV's Blu-ray support in HandBrake
Open a Windows CMD prompt as Administrator and run the following commands:
cd "\Program Files\Handbrake"
mklink libaacs.dll "C:\Program Files (x86)\MakeMKV\libmmbd64.dll"
mklink libbdplus.dll "C:\Program Files (x86)\MakeMKV\libmmbd64.dll"
The first command above changes the working directory to HandBrake's default installation directory on 64bit Windows. The second and third commands create a symbolic link to MakeMKV's "libmmdb.dll" file in HandBrake's installation directory. This allows HandBrake to "backup" Blu-rays just as MakeMKV is able to on it's own. Even though MakeMKV also has the ability to decrypt DVDs, I've found that VideoLAN's libdvdcss seems to work on more DVDs than MakeMKV.
5) Backup DVD or Blu-ray with HandBrake
- Launch HandBrake
- Insert DVD/Blu-ray media
- Click "Open Source"
- Click DVD/Blu-ray drive > HandBrake scans the disc for all available titles
- In the "Presets" pane on the right, scroll down to the section titled "Matroska" and click "H.264 MKV 480p30" (I just prefer MKV. Also, this would be a good time to right click "H.264 MKV 480p30" and click "Set Default" so this is the option HandBrake uses by default moving forward. Note that the 480p30 option is similar to DVD quality. If backing up a Blu-ray, you can optionally choose the "H.264 MKV 720p30" or even the "H.264 MKV 1080p30" option if you want a higher quality file; of-course the file size will be much larger and require more bandwidth for the stream.)
- The dropdowns under "Source" are almost always set perfectly by default. Every once in a while you may have to change the "Title" on discs with multiple versions of the movie (full screen and wide screen for example) or the start and end chapters (some DVDs have the first chapter of the movie as trailers for other movies).
- Under "Destination," click the "Browse" button to tell HandBrake where to save the file and it's name. See Plex's naming standards for Movies and TV Shows. I recommend saving the file to a temp location and testing the video file before moving it to your Plex library directory.
- Once all the output settings are to your liking, click "Start Encode"
- Once complete, test the video file.
- Copy video file to Plex library directory.

2 comments:

  1. First of all, thanks for posting this, it helped me to get through a BD2Digital conversion I am going through (don't like to be carrying with me all those discs everywhere...)

    Second, I would like to point that the symbolic links have a typo, the correct target is "libmmbd.dll", the fixed commands are:

    mklink libaacs.dll "C:\Program Files (x86)\MakeMKV\libmmbd.dll"
    mklink libbdplus.dll "C:\Program Files (x86)\MakeMKV\libmmbd.dll"


    And that is for 32-bit systems, for 64-bit you need to use:

    mklink libaacs.dll "C:\Program Files (x86)\MakeMKV\libmmbd64.dll"
    mklink libbdplus.dll "C:\Program Files (x86)\MakeMKV\libmmbd64.dll"

    Thanks!

    ReplyDelete
    Replies
    1. You are correct on my typos. Thank you for catching those!
      I have updated "libmmdb" to "libmmbd64" in my post. Also updated which presets I use in HandBrake as they changed in a recent HandBrake update.

      Delete