MKVToolNix logo 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.

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:

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

libEBML and libMatroska

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

Get libEBML 1.3.0 and libMatroska 1.4.0.

Change to libebml-1.3.0/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-1.4.0/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.

MKVToolNix

Either download the release 6.9.1 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 is available from the sources directory.

Additional step if you're using the development version: change to the mkvtoolnix directory and run ./autogen.sh 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 \
  --with-extra-libs=/where/i/put/libebml/make/linux\;/where/i/put/libmatroska/make/linux
  

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

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 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. v6.9.1, you have to do the following:

curl -O http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-6.9.1.tar.xz
tar xJf mkvtoolnix-6.9.1.tar.xz
cd mkvtoolnix-6.9.1
mv debian-upstream debian
dpkg-buildpackage -b -rfakeroot

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

git clone git://github.com/mbunkus/mkvtoolnix.git mkvtoolnix-6.9.1
cd mkvtoolnix-6.9.1
git submodule init
git submodule update
rm -rf .git
mv debian-upstream debian
./autogen.sh
cd ..
tar -c -f - mkvtoolnix-6.9.1 | xz > mkvtoolnix_6.9.1.orig.tar.xz
cd mkvtoolnix-6.9.1
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-6.9.1) is in.

© 2002 - 2014 Moritz Bunkus   |   Imprint/Impressum