Creating and working with Matroska files
Go to file
2003-04-17 12:23:41 +00:00
avilib Fixed an inavlid access to non-allocated space if there is some private data after the WAVEFORMATEX structure in the AVI. 2003-04-17 12:10:46 +00:00
.cvsignore Added config.h 2003-02-28 21:43:22 +00:00
ac3_common.cpp first working version. yay! 2003-02-16 17:04:39 +00:00
ac3_common.h first working version. yay! 2003-02-16 17:04:39 +00:00
acinclude.m4 Renamed GCC2 to LIBEBML_GCC2 as GCC2 seemed to be too general a term to be used in other programs. 2003-04-13 14:00:54 +00:00
autogen.sh switched to auto* 2003-02-16 12:09:37 +00:00
ChangeLog Automatic ChangeLog update. 2003-04-11 13:45:35 +00:00
common.cpp Added trace() function in order to ease the debugging process. 2003-04-17 12:21:04 +00:00
common.h Added trace() function in order to ease the debugging process. #define for the standard timecode scale added. 2003-04-17 12:21:21 +00:00
configure.in New parameters --with-ebml-* that reflect the separation of libebml from libmatroska. 2003-04-11 09:56:47 +00:00
COPYING standard GPL 2003-04-11 13:44:04 +00:00
depcomp initial addition, compilation fixups 2003-02-16 00:47:53 +00:00
error.h Added a first Vorbis support including the packetizers. 2003-03-03 18:00:30 +00:00
install-sh switched to auto* 2003-02-16 12:09:37 +00:00
Makefile.am New parameters --with-ebml-* that reflect the separation of libebml from libmatroska. 2003-04-11 09:56:47 +00:00
missing switched to auto* 2003-02-16 12:09:37 +00:00
mkinstalldirs switched to auto* 2003-02-16 12:09:37 +00:00
mkvinfo.cpp Necessary changes to the reading process regarding timecodes. 2003-04-16 20:10:08 +00:00
mkvmerge.1 Initial release - copied from ogmmerge.1 ;) 2003-04-11 13:03:56 +00:00
mkvmerge.cpp Added KaxTimecodeScale with its default value (mandatory for the new libmatroska). 2003-04-17 12:22:15 +00:00
mkvmerge.mak Makefile for mkvmerge for Microsoft Developer Studio by Shelly 2003-04-09 13:34:31 +00:00
mp3_common.cpp Changed all pointers to general data to unsigned char * 2003-03-04 10:16:28 +00:00
mp3_common.h Changed all pointers to general data to unsigned char * 2003-03-04 10:16:28 +00:00
ogmstreams.h Copied from ogmtools. OGG media header and type definitions.h 2003-03-01 16:51:29 +00:00
p_ac3.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_ac3.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_mp3.cpp Removed the default value from the function definition. 2003-04-17 12:22:56 +00:00
p_mp3.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_pcm.cpp Explicit type conversion in order to avoid compiler warnings. 2003-04-17 12:23:41 +00:00
p_pcm.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_textsubs.cpp New style "process" function support. Some explicit char* typecasts. 2003-04-11 11:23:40 +00:00
p_textsubs.h New style "process" function support. 2003-04-11 11:23:54 +00:00
p_video.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_video.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_vorbis.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
p_vorbis.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
pr_generic.cpp libebml now takes absolute timecodes for AddFrame. 2003-04-13 15:44:27 +00:00
pr_generic.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
queue.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
queue.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_ac3.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_ac3.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_avi.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_avi.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_matroska.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_matroska.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_microdvd.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_microdvd.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_mp3.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_mp3.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_ogm.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_ogm.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_srt.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_srt.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_vobsub.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_vobsub.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_wav.cpp Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
r_wav.h Changed all u_int64_t to int64_t. Some crappy MS compilers obviously cannot convert u_int64_t to double. And I do not need them that badly. 2003-04-13 15:23:03 +00:00
README Newer info with updated installation instructions which reflect that libebml is now separated from libmatroska. 2003-04-11 13:42:27 +00:00
subtitles.cpp New style process support. 2003-04-11 11:54:36 +00:00
subtitles.h Added support for SRT reading. Added support for outputting the preliminary simple text subtitle format. 2003-03-06 23:39:40 +00:00
TODO Removed two tasks that I have already done or at least a preliminary working version for. 2003-03-13 09:25:56 +00:00

MKVToolNix 0.2
==============

These tools allow information about (mkvinfo) or extraction
from (mkvdemux) or creation of (mkvmerge) or the splitting of
(mkvsplit) Matroska 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/

At the moment only mkvinfo and mkvmerge are available, but the others
will be as well.

MkvToolNix aims to become for Matroska what the OGMTools are for
OGM.

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, which can be obtained 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'.

After you've compiled the two libraries you can now compile MkvToolNix
itself:

bunzip2 < mkvtoolnix-...tar.bz2 | tar xvf -
cd mkvtoolnix-...
./configure --with-matroska-include=/where/i/put/libmatroska/src \
  --with-matroska-lib=/where/i/put/libmatroska/make/linux \
  --with-ebml-include=/where/i/put/libebml/src \
  --with-ebml-lib=/where/i/put/libebml/make/linux
make

And you're done.

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 and let mencoder calculate the
video frame numbers:

mencoder -dvd 1 -ovc frameno -oac pcm -o frameno.avi

b) Extract the audio again, this time to a plain WAV file:

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

At the moment selecting a non-existant video codec with -vc results
in the fastest audio dump.

c) Normalize the sound (optional)

normalize audio.wav

d) Encode the audio to Vorbis:

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

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

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

target_size, audio_size in bytes
length in seconds
1.0115 is the overhead caused by putting the streams into an Matroska file.
video_bitrate will be in kbit/s

f) 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

g) Merge:

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

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