Categories: Tutorials

Compiling and Running Handbrake in Ubuntu

2 min read

Background

Handbrake has stable builds for Windows, Mac, Ubuntu and Fedora. The developers of Handbrake haven’t made stable release for quite some time, leaving the latest version at 0.9.4. While this generic version is good enough for most people, generally it’s better to build Handbrake yourself, on your computer for best results. The official PPA is only for Karmic Koala (9.10), and though packages are meant to be forward-compatible, the interface doesn’t work in Lucid (10.04) at all. Hunter Kaller’s PPA has a proper Lucid build, but for most installations, the video output is garbled. Where does that leave us? A build from the trunk.

Compiling Handbrake

To compile our own copy of Handbrake, we must obtain the source code from the Subversion repository. If you don’t have Subversion (the default install doesn’t), install it from the Ubuntu repositories:

sudo apt-get install subversion

To download the source code, you must run Subversion in a terminal:

svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk

Before we compile Handbrake, we must install some dependant packages – without knowing and installing these, the compile process will stop again and again until we install all the packages one at a time:

sudo apt-get install yasm build-essential
autoconf libtool zlib1g-dev libbz2-dev intltool libglib2.0-dev
libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev
libwebkit-dev libnotify-dev libgstreamer0.10-dev
libgstreamer-plugins-base0.10-dev

After changing to hb-trunk, run the configure script:

cd hb-trunk
./configure

The configuring process should take less than two seconds (but don’t worry if it takes longer; only worry if there are errors printed). Ignore the message that “lipo” and “xcodebuild” are not found; they are for Mac OS X builds only. Now we can build Handbrake. It is always best to compile using as many concurrent build processes as you have cores, so the make command will now look like:

make -jX

where X is the number of cores you have in your computer. To build Handbrake, change into build and run make:

cd build
make -j4

If you see weird output and you’re using a j value higher than 1, don’t be alarmed; it’s just that the processes are all fighting over stdout so some output gets mixed. This may take five minutes to half an hour, depending on your computer’s processing speed. On my Intel Q9650, it took around five to ten minutes. Unless you see errors at the end of the output (in which case they should be fixed before moving on), you’re ready to install Handbrake! Make sure that any copy of Handbrake from a repository is uninstalled first:

sudo apt-get purge ^handbrake.*$

Finally, run sudo make install to install Handbrake. Congratulations! If all went well, you should be able to run /usr/local/bin/ghb or find Handbrake in Applications > Sound & Video and Handbrake should launch! If all didn’t go well, The build docs may be able to solve your problem. Check it out; it has helped me many times before.

Packt

Share
Published by
Packt

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago