Handbrake Compile

Compiling HandBrake on Linux

These instructions are for building the *released* version of HandBrake. If you are building SVN, see the instructions in the source tree doc/BUILD-Linux.

Install Dependencies

What you need depends on your distribution.

The GTK UI introduces some significant extra build requirements. If you intend to disable building the GUI with `configure –disable-gtk’ you will not need many of these packages installed.

For Ubuntu you need:

  • subversion (cli/gui)
  • yasm (cli/gui)
  • build-essential (cli/gui)
  • autoconf (cli/gui)
  • libtool (cli/gui)
  • zlib1g-dev (cli/gui)
  • libbz2-dev (cli/gui)
  • libxml2-dev (cli/gui)
  • libogg-dev (cli/gui)
  • libtheora-dev (cli/gui)
  • libvorbis-dev (cli/gui)
  • libsamplerate-dev (cli/gui)
  • libfribidi-dev (cli/gui)
  • libfreetype6-dev (cli/gui)
  • libfontconfig1-dev (cli/gui)
  • libass-dev (cli/gui)
  • intltool (gui)
  • libglib2.0-dev (gui)
  • libdbus-glib-1-dev (gui)
  • libgtk2.0-dev (gui)
  • libgudev-1.0-dev (gui)
  • libwebkit-dev (gui)
  • libnotify-dev (gui)
  • libgstreamer0.10-dev (gui)
  • libgstreamer-plugins-base0.10-dev (gui)
  • libappindicator-dev (gui)

To install these packages:

sudo apt-get install subversion yasm build-essential autoconf libtool \
zlib1g-dev libbz2-dev libogg-dev libtheora-dev libvorbis-dev \
libsamplerate-dev libxml2-dev libfribidi-dev libfreetype6-dev \
libfontconfig1-dev libass-dev intltool libglib2.0-dev libdbus-glib-1-dev \
libgtk2.0-dev libgudev-1.0-dev libwebkit-dev libnotify-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libappindicator-dev

For Fedora you need the following package groups:

  • Development Tools
  • Development Libraries
  • X Software Development (gui)
  • GNOME Software Development (gui)

To install these package groups:

sudo yum groupinstall "Development Tools" "Development Libraries" \
"X Software Development" "GNOME Software Development"

Also for Fedora you need the following additional packages:

  • yasm (cli/gui)
  • zlib-devel (cli/gui)
  • bzip2-devel (cli/gui)
  • libogg-devel (cli/gui)
  • libtheora-devel (cli/gui)
  • libvorbis-devel (cli/gui)
  • libsamplerate-devel (cli/gui)
  • libxml2-devel (cli/gui)
  • fribidi-devel (cli/gui)
  • freetype-devel (cli/gui)
  • fontconfig-devel (cli/gui)
  • libass-devel (cli/gui)
  • dbus-glib-devel (gui)
  • libgudev1-devel (gui)
  • webkitgtk-devel (gui)
  • libnotify-devel (gui)
  • gstreamer-devel (gui)
  • gstreamer-plugins-base-devel (gui)

To install these packages:

sudo yum install yasm zlib-devel bzip2-devel libogg-devel libtheora-devel \
libvorbis-devel libsamplerate-devel libxml2-devel fribidi-devel \
freetype-devel fontconfig-devel libass-devel dbus-glib-devel \
libgudev1-devel webkitgtk-devel libnotify-devel \
gstreamer-devel gstreamer-plugins-base-devel

QuickStart Build Instructions

  • apt-get -y install libmp3lame-dev lame libjansson4 libjansson-dev x264 libx264-142 libx264-dev libgtk-3-dev
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch

Or if you want HandBrakeCLI only:

svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
cd hb-trunk
./configure --launch --disable-gtk

If there are errors at this stage, you’re missing some prerequisite.

Assuming that all goes well, you should now have a HandBrakeCLI binary in the build directory and a ghb binary in the build/gtk/src directory. You can execute it in place or copy it wherever you like.

You may also want to install, run:

cd build
sudo make install

This will install the binary and add a HandBrake option to your “Applications->Sound & Video” menu.

Full Compiling Guide

This is just a simple quick-start guide. For the real meat and potatoes, see the latest Linux build documentation. Topics covered there include:

  • Running configuration and build commands on subsequent compiles (hint, do it from the build/ directory, not the trunk)
  • Configuring options like 64-bit builds and cross-compilation
  • Cleaning build files
  • Tweaking contrib libraries