MKVToolNix logo MKVToolNix – Matroska tools for Linux/Unix and Windows

Source Code

If you want to compile the tools yourself then you must first decide if you want to use a 'proper' release version or the current development version. As both Matroska and MKVToolNix are under heavy development there might be features available in the Git source code repository that are not available in the releases. On the other hand the Git source code repository version might not even compile.

Requirements

In order to compile MKVToolNix you need a couple of libraries and programs. Most of them should be available pre-compiled for your distribution. The libraries you absolutely need are:

  • libEBML v1.3.1 and libMatroska v1.4.2 for low-level access to Matroska files. Instructions on how to compile them are a bit further down on this page. If you don't want to install them seperately then you can skip them as MKVToolNix comes bundled with them already.
  • libOgg and libVorbis for access to Ogg/OGM files and Vorbis support
  • zlib – a compression library
  • Boost v1.46.0 and newer – portable C++ libraries
  • Ruby – a programming language. The build system uses it.

Other libraries are optional and only limit the features that are built. These include:

  • Qt 5.2.0 and newer – a cross-platform GUI toolkit. You need this if you want to use the MKVToolNix GUI or mkvinfo's GUI.
  • libFLAC for FLAC support (Free Lossless Audio Codec)
  • libMagic from the "file" package for automatic content type detection
  • libcurl for online update checks

libEBML and libMatroska

Note that this step is optional as MKVToolNix comes bundled with the required version of both libraries.

Get libEBML 1.3.1 and libMatroska 1.4.2.

Change to libebml-1.3.1 and run ./configure && make. If you have root/sudo access then run sudo make install in order to install the files. Change to libmatroska-1.4.2. Once more run ./configure && make. If you have root/sudo access then run sudo make install in order to install the files.

MKVToolNix

You can download the latest release or get a fresh copy from my Git repository. I sign my released source code tarballs with the same GPG key I use for email and my Debian/Ubuntu APT repositories: sub-key ID 0x74AF00AD F2E32C85 of key ID 0x0F92290A 445B9007. Commits in Git are not signed.

Either download the release 9.6.0 (GPG signature) and unpack it or get a fresh copy from my Git source code repository by running the following command:

git clone git://github.com/mbunkus/mkvtoolnix.git

You can also browse the Git repository online.

The source code for all older releases and all GPG signatures is available from the sources directory.

Additional step if you're using the development version/a git checkout: change to the mkvtoolnix directory and run the following three commands:

./autogen.sh
git submodule init
git submodule update

./autogen.sh will generate the configure script. The autoconf tool needs to be installed for this step.

The other two commands will cause libEBML and libMatroska to be downloaded into the source tree. You don't need to do that if you have the libraries installed system-wide.

If you have installed the libraries in a standard location then configure should automatically them automatically. Otherwise you may need to tell configure where libEBML and libMatroska have been installed into:

./configure \
  --with-extra-includes=/where/i/put/libebml/include\;/where/i/put/libmatroska/include \
  --with-extra-libs=/where/i/put/libebml/lib\;/where/i/put/libmatroska/lib

If all else fails configure will fall back to the versions of libEBML and libMatroska bundled with MKVToolNix.

Now run ./drake.

Debian/Ubuntu package

Building binary packages for Debian and Ubuntu either from my Git sources or from a release tarball is pretty easy. The following steps assume that you're not root but may use sudo.

First install a couple of packages needed for building MKVToolNix:

sudo apt-get install build-essential fakeroot debhelper ruby \
  libbz2-dev liblzo2-dev zlib1g-dev libmagic-dev \
  libflac-dev libogg-dev libvorbis-dev libcurl4-gnutls-dev \
  libboost-dev  libboost-filesystem-dev \
  libboost-regex-dev  libboost-date-time-dev libboost-system-dev \
  qt5-default pkg-config

Next download either a release tarball or get a development snapshot from my git repository, rename one of its sub-directories, call a helper script and lastly build the packages themselves. For a release tarball, e.g. v9.6.0, you have to do the following:

curl -O https://mkvtoolnix.download/sources/mkvtoolnix-9.6.0.tar.xz
tar xJf mkvtoolnix-9.6.0.tar.xz
cd mkvtoolnix-9.6.0
mv debian-upstream debian
dpkg-buildpackage -b -rfakeroot -uc -us

For a development snapshot from my git repository the steps are the following:

sudo apt-get install autoconf automake git
git clone git://github.com/mbunkus/mkvtoolnix.git mkvtoolnix-9.6.0
cd mkvtoolnix-9.6.0
git submodule init
git submodule update
rm -rf .git
mv debian-upstream debian
./autogen.sh
cd ..
tar -c -f - mkvtoolnix-9.6.0 | xz > mkvtoolnix_9.6.0.orig.tar.xz
cd mkvtoolnix-9.6.0
dpkg-buildpackage -b -rfakeroot -uc -us

Afterwards the two new packages mkvtoolnix and mkvtoolnix-gui will have been built in the same directory the source code directory (mkvtoolnix-9.6.0) is in.

© 2002 - 2015 Moritz Bunkus   |   Imprint/Impressum