MKVToolNix -- Cross-platform tools for Matroska

Source code and compilation

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.


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:

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

libmatroska and libebml

Start with the two libraries. Either get libebml 1.2.2 and libmatroska 1.3.0 or a fresh copy from the Subversion repository.

svn co
svn co

Change to libebml/make/linux and run make staticlib. If you have root-access then run make install_staticlib install_headers as root in order to install the files. Change to libmatroska/make/linux. Once more run make staticlib. If you have root-access then run make install_staticlib install_headers as root in order to install the files.


Either download the release 5.9.0 and unpack it or get a fresh copy from my Git source code repository by running the following command:

git clone git://

You can also browse the Git repository online.

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

Additional step if you're using the development version: change to the mkvtoolnix directory and run ./ which will generate the configure script. The autoconf needs to be installed for this step.

If you have run make install_staticlib for both libraries then configure should automatically find the libraries' position. Otherwise you need to tell configure where the libmatroska and libebml sources are:

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

Now run ./drake. You can create a Matroska file with mkvmerge -o output.mkv input1.avi input2.ac3 input3.ogg ...

At the moment the following sources are supported (this list is OUTDATED):

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 debhelper \
  libogg-dev libvorbis-dev libwxgtk2.8-dev libexpat1-dev zlib1g-dev \
  liblzo2-dev libbz2-dev libflac-dev libmagic-dev libboost-dev \
  libboost-regex-dev libboost-filesystem-dev libboost-system-dev \
  libebml-dev libmatroska-dev libcurl4-gnutls-dev autoconf git-core ruby

Next download either the sources from my Git repository or a release tarball, rename one of its sub-directories, call a helper script and lastly build the packages themselves. For Git the steps are the following:

git clone git:// mkvtoolnix-5.9.0
cd mkvtoolnix-5.9.0
git submodule init
git submodule update
rm -rf .git
mv debian-upstream debian
cd ..
tar -c -f - mkvtoolnix-5.9.0 | bzip2 > mkvtoolnix_5.9.0.orig.tar.bz2
cd mkvtoolnix-5.9.0
dpkg-buildpackage -b -rfakeroot

For a release tarball, e.g. v5.9.0, you have to do the following:

     curl -O
tar xjf mkvtoolnix_5.9.0.orig.tar.bz2
cd mkvtoolnix-5.9.0
mv debian-upstream debian
dpkg-buildpackage -b -rfakeroot

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

2002 - 2011 Moritz Bunkus   |   Imprint/Impressum