mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
121 lines
3.4 KiB
Plaintext
121 lines
3.4 KiB
Plaintext
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
|
|
|
|
If you're low on disk space and can invest a bit more time then you
|
|
tell mencoder to encode to MP3 instead:
|
|
|
|
mencoder -dvd 1 -ovc frameno -oac mp3lame -lameopts br=32 -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.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
|
|
|
|
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.
|