Creating and working with Matroska files
Go to file
2003-04-11 12:50:19 +00:00
avilib Makefile for Microsoft Developer Studio by Shelly 2003-04-09 13:27:33 +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 New parameters --with-ebml-* that reflect the separation of libebml from libmatroska. 2003-04-11 09:56:47 +00:00
autogen.sh switched to auto* 2003-02-16 12:09:37 +00:00
ChangeLog Automatic ChangeLog update. 2003-04-11 12:31:46 +00:00
common.cpp Renamed all variables with "streams" to "*tracks" as "track" is the correct Matroska term. 2003-04-11 10:05:11 +00:00
common.h Renamed all variables with "streams" to "*tracks" as "track" is the correct Matroska term. 2003-04-11 10:05:11 +00:00
configure.in New parameters --with-ebml-* that reflect the separation of libebml from libmatroska. 2003-04-11 09:56:47 +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 #include fixes for compilation under Win32. Preliminary support for KaxBlockAdditional. 2003-04-09 13:30:23 +00:00
mkvmerge.cpp Fixed indentation. 2003-04-11 12:50:19 +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 Renamed 'stream' to 'track'. Removed the useless function 'set_parameters'. process now either uses the supplied timecode or calculates it on its own if timecode == -1. 2003-04-11 10:32:31 +00:00
p_ac3.h Renamed 'stream' to 'track'. Removed the useless 'set_parameters' function. 2003-04-11 10:36:55 +00:00
p_mp3.cpp Renamed "stream" to "track". process can either use the supplied timecode or calculate the timecode itself. 2003-04-11 11:19:30 +00:00
p_mp3.h Renamed "stream" to "track". 2003-04-11 11:19:49 +00:00
p_pcm.cpp New style "process" function support. 2003-04-11 11:23:54 +00:00
p_pcm.h New style "process" function support. 2003-04-11 11:23:54 +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 New style "process" function support. New frame type flags (I, P, B) introduced, although only I and P frames are handled at the moment. 2003-04-11 11:27:14 +00:00
p_video.h New style "process" function support. New frame type flags (I, P, B) introduced. 2003-04-11 11:27:32 +00:00
p_vorbis.cpp New style "process" function support. Lacing now reports two packets laced, the third one is stored implicitly. 2003-04-11 11:29:01 +00:00
p_vorbis.h New style "process" function support. 2003-04-11 11:29:28 +00:00
pr_generic.cpp Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
pr_generic.h New style "process" function support. 2003-04-11 11:29:28 +00:00
queue.cpp Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
queue.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_ac3.cpp Removed the bitrate from the AC3 packetizer arguments. 2003-04-11 11:30:18 +00:00
r_ac3.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_avi.cpp Renamed "stream" to "track". Removed the bitrate argument from the AC3 packetizer. Introduced frame type flags (I, P). New style process support. Unified audio reading and processing (PCM, MP3, AC3). 2003-04-11 11:36:18 +00:00
r_avi.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_matroska.cpp Very, very early support for Matroska files. General looping is implemented, the packetizers are created, but the data is not being read and processed. Just a commit to make the whole thing compile. 2003-04-11 10:03:16 +00:00
r_matroska.h Very, very early support for Matroska files. General looping is implemented, the packetizers are created, but the data is not being read and processed. Just a commit to make the whole thing compile. 2003-04-11 10:03:16 +00:00
r_microdvd.cpp Removed range processing. This is a left-over from the days when there was no ogmsplit. 2003-03-04 09:27:05 +00:00
r_microdvd.h Removed range processing. This is a left-over from the days when there was no ogmsplit. 2003-03-04 09:27:05 +00:00
r_mp3.cpp Removed deprecated parameters from MP3 packetizers. 2003-04-11 11:37:41 +00:00
r_mp3.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_ogm.cpp Stream selection based on the serial number, not the stream number. Removed deprecated parameters from various packetizers. Renamed "stream" to "track" where appropriate. Unified and simplified demuxing and handling of the different stream types. 2003-04-11 11:52:57 +00:00
r_ogm.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_srt.cpp Added support for SRT reading. Added support for outputting the preliminary simple text subtitle format. 2003-03-06 23:39:40 +00:00
r_srt.h Added support for SRT reading. Added support for outputting the preliminary simple text subtitle format. 2003-03-06 23:39:40 +00:00
r_vobsub.cpp Removed range processing. This is a left-over from the days when there was no ogmsplit. 2003-03-04 09:27:05 +00:00
r_vobsub.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_wav.cpp Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
r_wav.h Put all track relevant variables into a struct that is passed down from mkvmerge to the readers and from them to the packetizers. 2003-03-05 13:51:20 +00:00
README First version based on ogmtool's README. 2003-03-04 19:09:59 +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.0.2
================

These tools allow information about (mkvinfo) and creation of
(mkverge) Matroska 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/

Installation is simple. First make sure that you have a recent version
of libmatroska installed on your computer. Refere to libmatroska's
documentation for installation instructions.

Now run './configure'. If, for some reason, there is no 'configure'
script then run './autogen.sh' which will recreate it. If configure
can not find the Matroska libraries then you'll have to explicitely
state where they are, e.g.

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

After configure has finished simply run 'make' followed by 'make
install'. If you want a system wide installation then you'll have to
run 'make install' as root.

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/index.html

Moritz Bunkus <moritz@bunkus.org>

------------------

Example
=======

Here's a *very* brief example of how you could use mkvmerge with
mencoder in order to rip a DVD to a Matroska file with MPEG4 video and
Vorbis audio:

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

If you're low on disk space then you can save a lot of space by
encoding the sound to MP3 with a very low bitrate. Using PCM is super
fast and uses a lot of space. MP3 is super small and takes rather
long. It's your choice. For MP3 use

mencoder -dvd 1 -ovc frameno -oac mp3lame -lameopts cbr:br=64 \
  -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

If you're low on disk space then you can now remove the temporary
WAV file.

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

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

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

Remember. If you calculated a video_bitrate for ONE CD and want to
switch to TWO CDs later on you cannot simply use twice the
video_bitrate as before - simply because the audio does not get bigger
as well. Re-caculate the values above with your new target_size
instead.

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 (or MP3) audio
as well.