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. 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.0.0 and libmatroska 1.0.0 or a fresh copy from the Subversion repository.

svn co https://svn.matroska.org/svn/matroska/trunk/libebml
svn co https://svn.matroska.org/svn/matroska/trunk/libmatroska

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.

MKVtoolNix

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

git clone git://git.bunkus.org/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
  

Now run make. 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 from my Git sources 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 libebml-dev libmatroska-dev \
  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 \
  autoconf automake git-core
   

Next download the sources from my Git repository, rename one of its sub-directories, call a helper script and lastly build the packages themselves:

git archive --format=tar --prefix=mkvtoolnix-git/ \
  --remote=git://git.bunkus.org/mkvtoolnix.git master | \
  tar xf -
cd mkvtoolnix-git
mv debian-upstream debian
./autogen.sh
dpkg-buildpackage -b -rfakeroot
   

Afterwards the two new packages mkvtoolnix and mkvtoolnix-gui will have been built in the same directory mkvtoolnix-git is in.