mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-25 04:11:44 +00:00
Creating and working with Matroska files
avilib | ||
.cvsignore | ||
ac3_common.cpp | ||
ac3_common.h | ||
acinclude.m4 | ||
autogen.sh | ||
ChangeLog | ||
common.cpp | ||
common.h | ||
configure.in | ||
depcomp | ||
error.h | ||
install-sh | ||
Makefile.am | ||
missing | ||
mkinstalldirs | ||
mkvinfo.cpp | ||
mkvmerge.cpp | ||
mkvmerge.mak | ||
mp3_common.cpp | ||
mp3_common.h | ||
ogmstreams.h | ||
p_ac3.cpp | ||
p_ac3.h | ||
p_mp3.cpp | ||
p_mp3.h | ||
p_pcm.cpp | ||
p_pcm.h | ||
p_textsubs.cpp | ||
p_textsubs.h | ||
p_video.cpp | ||
p_video.h | ||
p_vorbis.cpp | ||
p_vorbis.h | ||
pr_generic.cpp | ||
pr_generic.h | ||
queue.cpp | ||
queue.h | ||
r_ac3.cpp | ||
r_ac3.h | ||
r_avi.cpp | ||
r_avi.h | ||
r_matroska.cpp | ||
r_matroska.h | ||
r_microdvd.cpp | ||
r_microdvd.h | ||
r_mp3.cpp | ||
r_mp3.h | ||
r_ogm.cpp | ||
r_ogm.h | ||
r_srt.cpp | ||
r_srt.h | ||
r_vobsub.cpp | ||
r_vobsub.h | ||
r_wav.cpp | ||
r_wav.h | ||
README | ||
subtitles.cpp | ||
subtitles.h | ||
TODO |
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.