--- DOCS/xml/en/mencoder.xml 2005-04-13 13:22:48.000000000 +0000
+++ ../mencoder.xml 2005-04-13 13:14:27.000000000 +0000
@@ -1290,6 +1290,144 @@
+
+Muxing
+
+ Now that you have encoded your video, you will most likely want
+ to mux it with one or more audio tracks into a movie container, such
+ as AVI, OGM, Matroska or NUT.
+ MEncoder is currently only able to output
+ audio and video into MPEG and AVI container formats.
+ for example:
+ mencoder -oac copy -ovc copy -o output_movie.avi -audiofile input_audio.mp2 input_video.avi
+ This would merge the video file input_video.avi
+ and the audio file input_audio.mp2
+ into the AVI file output_movie.avi.
+ This command works with MPEG-1 layer I, II and III (more commonly known
+ as mp3) audio, WAV and a few other audio formats too.
+
+
+
+ MEncoder features experimental support of
+ libavformat, which is a
+ library from the FFmpeg project that supports muxing and demuxing
+ a variety of containers.
+ For example:
+ mencoder -oac copy -ovc copy -o output_movie.asf -audiofile input_audio.mp2 input_video.avi -of lavf -lavfopts format=asf
+ This will do the same thing as the previous example, except that
+ the output container will be ASF.
+ Please note that this support is highly experimental (but getting
+ better every day), and will only work if you compiled
+ MPlayer with the support of
+ libavformat enabled (which
+ means that a pre-packaged binary version won't work in most cases).
+
+
+
+Limitations of the AVI container
+
+ Although it is the most widely-supported container format after MPEG-1,
+ AVI also has some major drawbacks.
+ Perhaps the most obvious is the overhead.
+ For each chunk of the AVI file, 24 bytes are wasted on headers and
+ index.
+ This translates into a little over 5 MB per hour, or 1-2.5%
+ overhead for a 700 MB movie. This may not seem like much, but it could
+ mean the difference between being able to use 700 kbit/sec video or
+ 714 kbit/sec, and every bit of quality counts.
+
+
+
+ In addition this gross inefficiency, AVI also has the following major
+ limitations:
+
+
+
+
+
+ Only fixed-fps content can be stored. This is particularly limiting
+ if the original material you want to encode is mixed content, for
+ example a mix of NTSC video and film material.
+ Actually there are hacks that can be used to store mixed-framerate
+ content in AVI, but they increase the (already huge) overhead
+ fivefold or more and so are not practical.
+
+
+
+
+ Audio in AVI files must be either constant-bitrate (CBR) or
+ constant-framesize (i.e. all frames decode to the same number of
+ samples).
+ Unfortunately, the most efficient codec, Vorbis, does not meet
+ either of these requirements.
+ Therefore, if you plan to store your movie in AVI, you'll have to
+ use a less efficient codec such
+ as MP3 or AC3.
+
+
+
+
+
+ Having said all that, MEncoder does not
+ currently even support variable-fps output or Vorbis encoding.
+ Therefore, you may not see these as limitations if
+ MEncoder is the
+ only tool you will be using to produce your encodes.
+ However, it is possible to use MEncoder
+ only for video encoding, and then use external tools to encode
+ audio and mux it into another container format.
+
+
+
+
+Muxing into the Matroska container
+
+ The Matroska project is a free, open standard container format,
+ aiming to offer a lot of advanced features, which older containers
+ like AVI can not handle, on an extensible basis.
+ For example, Matroska supports Variable Bitrate audio content
+ (VBR), Variable Framerates (VFR), chapters, file attachments,
+ Error Detection (EDC) and modern A/V Codecs like "Advanced Audio
+ Coding" (AAC), "Vorbis" or "MPEG-4 AVC" (H.264), next to nothing
+ handled by AVI.
+
+
+
+ The tools required to create Matroska files are collectively called
+ mkvtoolnix, and are available for most
+ Unix platforms as well as Windows.
+ Given that Matroska is an open standard, you may find other
+ tools that suit you better, but since mkvtoolnix is the most
+ common, and is supported by the Matroska team itself, we will
+ only cover its usage.
+
+
+
+ Probably the easiest way to get started with Matroska is to use
+ MMG, the graphical frontend shipped with
+ mkvtoolnix, and follow the
+
+ guide to mkvmerge GUI (mmg)
+
+
+
+ You may also mux audio and video files using the command line:
+ mkvmerge -o output.mkv input_video.avi input_audio1.mp3 input_audio2.ac3
+ This would merge the video file input_video.avi
+ and the two audio files input_audio1.mp3
+ and input_audio2.ac3 into the Matroska
+ file output.mkv.
+ Matroska, as mentioned earlier, is able to do much more than that, like
+ multiple audio tracks (including fine-tuning of audio/video
+ synchronization), chapters, subtitles, splitting, etc...
+ Please refer to the documentation of those applications for
+ more details.
+
+
+
+
+
+
@@ -1878,3 +2016,4 @@
+