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 and libMatroska 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.
- expat -- a light-weight XML parser library
- 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:
- wxWidgets 2.8.0 and newer -- a cross-platform GUI toolkit. You need this if you want to use mmg (the mkvmerge GUI) or mkvinfo's GUI.
- libFLAC for FLAC support (Free Lossless Audio Codec)
- lzo and bzip2 are compression libraries. These are the least important libraries as almost no application supports Matroska content that is compressed with either of these libs. The aforementioned zlib is what every program supports.
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.2.0 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):
- AVI files with MPEG4 video and MP3, AC3 or PCM audio
- external AC3, MP3, WAV, DTS and AAC/MP4 files
- Ogg/OGM files with all the stuff mentioned above AND Vorbis audio :)
- Subtitle Ripper text subtitle (e.g. those created with Subtitle Ripper)
- SSA/ASS files (a bit limited at the moment)
- Matroska files themselves
- RealMedia files (both RealVideo and RealAudio)
- Chapters, tags, attachments
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.2.0, you have to do the following:
curl -O http://www.bunkus.org/videotools/mkvtoolnix/sources/mkvtoolnix-6.2.0.tar.xz tar xJf mkvtoolnix-6.2.0.tar.xz cd mkvtoolnix-6.2.0 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.2.0 cd mkvtoolnix-6.2.0 git submodule init git submodule update rm -rf .git mv debian-upstream debian ./autogen.sh cd .. tar -c -f - mkvtoolnix-6.2.0 | xz > mkvtoolnix_6.2.0.orig.tar.xz cd mkvtoolnix-6.2.0 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.2.0)
is in.
RSS