Creating and working with Matroska files
Go to file
2005-02-01 08:45:03 +00:00
avilib-0.6.10 Big API change from "char *" to "string". 2004-11-21 22:26:09 +00:00
contrib Not needed anymore. 2004-02-10 18:51:32 +00:00
debian Added files for making the mkvmerge-gui.html file into a HTML help book. Added code for showing that help file when the user presses F1 or selects "Help" from the "Help" menu. Updates for the build process which generates the .hhk index file from the .hhc contents file. 2005-01-08 15:26:12 +00:00
doc Changed the picture for adding files to include the new "append" button. Added a few sentences about appending to the guide. Reformatted the guide so that pictures are enclosed by text. This should make it more readable with not that wide resolutions -- e.g. everything else than my 1200 pixels ;) 2005-01-10 20:35:11 +00:00
examples Merged 2091 2004-08-28 16:09:13 +00:00
librmff I don't like trailing whitespace either. 2005-01-12 15:03:47 +00:00
po Makefile/configure: cached the libebml and libmatroska checks; added checks for gettext. Rest: Added some support for translations (way incomplete, but it's a start). 2004-07-18 15:06:33 +00:00
src Added a new function for finding the MPEG-4 part 2 configuration data. Some more preparations for native MPEG-4 part 2. 2005-01-31 20:15:05 +00:00
tests Added two test cases for WavPack with and without correction data. 2005-02-01 08:45:03 +00:00
AUTHORS Changed the copyright for the Windows implementation of vsscanf: Steve Matsnev did it. Also: Check the Windows version instead of relying on CreateFileW not being present. It IS present on 98 but not working correctly. 2005-01-01 22:35:06 +00:00
autogen.sh Removal of the old mingw build system. 2004-11-14 12:47:07 +00:00
ChangeLog Added couple of checks for invalid or empty chapter language entries. 2005-01-30 19:19:03 +00:00
common.vcproj First patch for supporting XML files with segment info elements in them. Patch by Steve Lhomme (steve ! lhomme () free ! fr) with modifications by myself. 2005-01-19 19:00:42 +00:00
config.msvc.h Fixes for compilation with MSVC. Added vsscanf because MSVC doesn't provide one. Patch by Steve Lhomee <steve.lhomme@free.fr>, modifications by Moritz Bunkus <moritz@bunkus.org>. 2004-10-11 20:16:16 +00:00
configure.in Added a resource file for Windows. This is needed because wxWidgets's HTML help needs the wxSTD_BITMAP_COLOURS resource. 2005-01-08 18:32:52 +00:00
COPYING standard GPL 2003-04-11 13:44:04 +00:00
INSTALL Directory reorganization 2003-07-09 18:53:25 +00:00
install-sh Removed whitespaces at the end of the line. 2003-05-20 06:30:25 +00:00
libmtxcommon.vcproj Merged 2100:2102 2004-08-29 11:55:57 +00:00
Makefile.in Added a resource file for Windows. This is needed because wxWidgets's HTML help needs the wxSTD_BITMAP_COLOURS resource. 2005-01-08 18:32:52 +00:00
mkinstalldirs
mkvextract.vcproj Added WAVPACK4 extraction. Patch by Steve Lhomme (see AUTHORS). Fixes for compiling mkvextract with MS VisualC++. Patch by Steve Lhomme as well. 2004-12-27 17:17:16 +00:00
mkvinfo.vcproj Support for "silent tracks" elements. Added project file for mkvinfo for MSVC. Patch by Steve Lhomme <steve ! lhomme () free ! fr> 2004-12-28 18:50:54 +00:00
mkvmerge.vcproj Added WAVPACK4 extraction. Patch by Steve Lhomme (see AUTHORS). Fixes for compiling mkvextract with MS VisualC++. Patch by Steve Lhomme as well. 2004-12-27 17:17:16 +00:00
mkvtoolnix.nsi Bumped the version number for the installer. 2004-12-26 15:06:12 +00:00
mkvtoolnix.sln Support for "silent tracks" elements. Added project file for mkvinfo for MSVC. Patch by Steve Lhomme <steve ! lhomme () free ! fr> 2004-12-28 18:50:54 +00:00
NEWS Directory reorganization 2003-07-09 18:53:25 +00:00
README Set the version number to 1.2.0 and changed the release codename. 2004-08-21 15:50:22 +00:00
README.Windows.txt Set the version number to 1.2.0 and changed the release codename. 2004-08-21 15:50:22 +00:00
TODO Moved TODO list to the BTS. 2004-08-01 18:29:23 +00:00

MKVToolNix 1.2.0
================

With these tools one can get information about (mkvinfo) Matroska
files, extract tracks/data from (mkvextract) Matroska files and create
(mkvmerge) Matroska files from other media files. Matroska is a new
multimedia file format aiming to become THE new container format for
the future. You can find more information about it and its underlying
technology, the Extensible Binary Meta Language (EBML), at

http://www.matroska.org/

The full documentation for each command is now maintained in its
man page only. Type 'mkvmerge -h' to get you started.

This code comes under the GPL (see www.gnu.org or the file COPYING).
Modify as needed.

The newest version can always be found at
http://www.bunkus.org/videotools/mkvtoolnix/

Moritz Bunkus <moritz@bunkus.org>

Installation
------------

Installation is not trivial but not impossible either. You first need
libebml and libmatroska.

If you run Debian/unstable on a x86 then you can get binary
packages from my apt repository. Just add the following lines to
/etc/apt/sources.lst:

deb http://www.bunkus.org/debian/unstable/ ./
deb-src http://www.bunkus.org/debian/unstable/ ./

Run 'apt-get update' and 'apt-get install libebml-dev
libmatroska-dev mkvtoolnix'.

If you want to compile from source then get the newest versions of
libebml and libmatroska. Normally the 'latest official release' will
work with the latest release of mkvtoolnix. At the time of writing
these versions where:
- libebml 0.6.2:
http://matroska.free.fr/downloads/libebml/libebml-0.6.2.tar.gz
- libmatroska 0.6.1:
http://matroska.free.fr/downloads/libmatroska/libmatroska-0.5.1.tar.gz

Alternatively you can get the two libraries via CVS:

cvs -d:pserver:anonymous@cvs.corecodec.org:/cvsroot/matroska login

Just hit the enter key if you're prompted for a password. Now check out
the sources themselves:

cvs -z3 -d:pserver:anonymous@cvs.corecodec.org:/cvsroot/matroska \
  co libmatroska
cvs -z3 -d:pserver:anonymous@cvs.corecodec.org:/cvsroot/matroska \
  co libebml

Change to libebml/make/linux and run 'make'. Change to
libmatroska/make/linux. Once more run 'make'. As root run 'make
install' in both directories. This will install the libraries into
/usr/local/lib and the header files into /usr/local/include/ebml and
/usr/local/include/matroska respectively.

After you've compiled the two libraries you can now compile MkvToolNix
itself. If you want to use the GUI for mkvinfo then you also need
wxWindows v2.4.0 or later (http://www.wxwindows.org/). If configure
finds the wx-config script then support for the GUI will be enabled.

bunzip2 < mkvtoolnix-...tar.bz2 | tar xvf -
cd mkvtoolnix-...
./configure
make
make install

The last step must be run as root and is optional.

If the configure script cannot find the EBML and Matroska headers,
then you'll have to manually point it to their locations:

./configure --with-matroska-include=/where/i/put/libmatroska \
  --with-matroska-lib=/where/i/put/libmatroska/make/linux \
  --with-ebml-include=/where/i/put/libebml \
  --with-ebml-lib=/where/i/put/libebml/make/linux

Now run 'make' and 'make install'.

Example
-------

Here's a *very* brief example of how you could use mkvmerge
with mencoder in order to rip a DVD:

a) Extract the audio to PCM audio:

mplayer -ao pcm -aofile audio.wav -vo null -vc dummy dvd://1

b) Normalize the sound (optional)

normalize audio.wav

c) Encode the audio to Vorbis:

oggenc -q3 -oaudio-q3.ogg audio.wav

d) Somehow calculate the bitrate for your video. Use something like...

video_size = (target_size - audio-size) / 1.005
video_bitrate = video_size / length / 1024 * 8

target_size, audio_size in bytes
length in seconds
1.005 is the overhead caused by putting the streams into an Matroska file
  (about 0.5%, that's correct ;)).
video_bitrate will be in kbit/s

e) Use the two-pass encoding for the video:

mencoder -dvd 1 -oac copy -ovc lavc \
  -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vqmin=2:vpass=1 \
  -vop scale=....,crop=..... \
  -o /dev/null

mencoder -dvd 1 -oac copy -ovc lavc \
  -lavcopts vcodec=mpeg4:vbitrate=1000:vhq:vqmin=2:vpass=2 \
  -vop scale=....,crop=..... \
  -o movie.avi

f) Merge:

mkvmerge -o movie.mkv -A movie.avi audio-q3.ogg

-A is necessary in order to avoid copying the raw PCM (or MP3) audio as well.

Bug reports
-----------

If you're sure you've found a bug - e.g. if one of my programs crashes
with an obscur error message, or if the resulting file is missing part
of the original data, then by all means submit a bug report.

I use Anthill (http://www.bunkus.org/anthill/index.php) as my bug
database. You can submit your bug reports there. Please be as verbose
as possible - e.g. include the command line, if you use Windows or
Linux etc.pp. If at all possible please include sample files as well
so that I can reproduce the issue. If they are larger than 1M then
please upload them somewhere and post a link in the Anthill bug
report.