Linux Multimedia: Using Handbrake for Media Conversions

Multimedia on Linux has gone from being a giant pain to being more powerful than any other operating system, including the vaunted Multimedia powerhouse Apple OSX. One of the most valuable tools in your Linux Multimedia arsenal is a great conversion utility called Handbrake – and like all the best Linux utilities, it’s free! Let’s take a look at getting it set up for our use.

Download and Installation
Normally I would gloss over the download portion of our article, but if you just do a Google search looking for Handbrake, the first couple of pages are littered with fakes, download managers and other places that are at best redistributing Handbrake and at worst installing who knows what on your PC. The only OFFICIAL place (other than your distribution repositories, which tend to run a bit behind the latest stable version) to get this utility is at the Handbrake website. Make sure you pick up your copy from here.

In our case, we are going to be installing this on Ubuntu. For other distributions, you may be able to get a pre-built package (Redhat/CentOS) in the “other” downloads section, but for us, we can use a PPA from this link. Currently, Raring (or 13.04) is the latest available package, but fortunately it installs just fine for us with that PPA. Add the following line to your “sources.list” file and then run a ‘sudo apt-get update’ command:
deb http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu raring main
deb-src http://ppa.launchpad.net/stebbins/handbrake-releases/ubuntu raring main

Once you have that noted and have run your update, you will want to install a couple of packages depending on your desktop environment. In order to get everything you will need, execute the following command:
sudo apt-get install handbrake*

You will get all the handbrake packages (GTK, Command line and Debug) you need. I include the debug package in case we have any conversion issues, we can help out the application author by sending them a full debug dump and they can make a fix (that is how open source works after all). Once you have it installed, you should see something like this:

Handbrake Start

Video Conversion and Compression
Handbrake has a lot of options for compression, picture settings, cropping and selecting, working with subtitles and on and on. The primary things you need to know are that:

 

    • Handbrake converts to a couple of different high definition formats: MP4 (the de facto standard web high definition video) or MKV (the de facto high definition container). You will find that if you are posting your content online, you will get the best compression and widest compatibility with MP4. Local system play in the highest (i.e. less “noisy”) quality, will be MKV.

 

    • You have full control over what format and where your videos are saved. Additionally, there are several handy presets on the right side so that if, for example, you are ripping a DVD video to a format for playback on your iPhone, you have that immediately available

 

In our case, we are taking a RAW movie we created using Screencast software. We need to compress and convert that video to something that we can post online in a compressed format playable by browser plugins. In our case, we take our 645mb file covering over 15 minutes of content and choose the following options:

Handbrake High Definition Web Movies

This conversion, on a pretty high end machine, takes about 33 seconds to compress, convert and save a 31mb file that looks identical to the high definition 640mb+ file we started with. It is in a compressed format that is optimized for web playback (MP4). All we did was install this application and choose a couple of check boxes and our video content is ready to be served up online.

Final Thoughts
This quick setup and demonstration is a terrific example of how far Linux has come in the multimedia space. Not that long ago, just getting a DVD to play a movie on your desktop was a chore that involved working in some legal grey areas. Now, we have fully integrated packages that make our online lives easier than anywhere else. Hit us up in the comments below and share your Linux Multimedia success story!

Terrence T. Cox

A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics.

Leave a Reply

Your email address will not be published. Required fields are marked *