[MPlayer-DOCS] [PATCH] new section: muxing

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Wed Apr 13 01:07:59 CEST 2005


On Tuesday, 12 April 2005 at 23:39, Guillaume Poirier wrote:
> Hi,
> Here's a new an improved patch that features Diego's suggestions and
> Nico's tips.
> In fact, not all of them as some (for instance -audio-demuxer 20
> -rawaudio format=0xyyyy:channels=n:bitrate=m:rate=w) seem for the time
> being a little to "hackist" for this document.
> Maybe they should land in the FAQ...
> 
> Please comment and review for inclusion in -pre7.

I'm sure The Wanderer will add his 3 cents, too, but let's give it a try.

> Index: en/mencoder.xml
> ===================================================================
> RCS file: /cvsroot/mplayer/main/DOCS/xml/en/mencoder.xml,v
> retrieving revision 1.49
> diff -u -r1.49 mencoder.xml
> --- en/mencoder.xml	12 Apr 2005 19:51:31 -0000	1.49
> +++ en/mencoder.xml	12 Apr 2005 21:32:50 -0000
> @@ -1290,6 +1290,144 @@
>  </para>
>  </sect2>
>  
> +<sect2 id="menc-feat-dvd-mpeg4-muxing">
> +<title>Muxing</title>
> +<para>
> +  Now that you have your encoded video, you will more than likely want

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.
> +  <application>MEncoder</application> is currently only able to output
> +  audio and video into MPEG and AVI container formats.
> +  for example:
> +  <screen>mencoder -oac copy -ovc copy  -o <replaceable>output_movie.avi</replaceable> -audiofile <replaceable>input_audio.mp2</replaceable> <replaceable>input_video.avi</replaceable></screen>
> +  This would merge the video file <replaceable>input_video.avi</replaceable>
> +  and the audio file <replaceable>input_audio.mp2</replaceable>
> +  the AVI file <replaceable>output_movie.avi</replaceable>.

Missing "into" at the beginning.

> +  This command works with MPEG-1 layer I and II audio, WAV and few other
> +  audio formats too.

Not layer III (more commonly known as mp3)? If it does (and I think so), it
is worth mentioning, as it is a major format.

> +</para>
> +
> +<para>
> +  MEncoder features an experimental support of
> +  <systemitem class="library">libavformat</systemitem> which is a
> +  library from the FFmpeg project that supports muxing and demuxing
> +  a large variety of containers.

Hm, "large" seems excessive. I'd skip it.

> +  For example:
> +  <screen>mencoder -oac copy -ovc copy  -o <replaceable>output_movie.asf</replaceable> -audiofile <replaceable>input_audio.mp2</replaceable> <replaceable>input_video.avi</replaceable> -of lavf -lavfopts format=asf</screen>
> +  This will do the same thing as the previous example, except that
> +  the output container whould be ASF.

... the output container will be. Keep the same tense.

> +  Please note that this support is highly experimental (but getting
> +  better every day), and will only work if you compiled
> +  <application>MPlayer</application> with the support of
> +  <systemitem class="library">libavformat</systemitem> enabled (which
> +  means that a pre-packaged binary version won't work most of the
> +  time.

Not "most of the time", as it suggests that sometimes they may work at
some point of time. I'd say "in most cases".

> +</para>
> +
> +<sect3 id="menc-feat-dvd-mpeg4-muxing-avi-limitations">
> +<title>Limitations of the AVI container</title>
> +<para>
> +  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.
> +</para>
> +
> +<para>
> +  In addition to gross inefficiency, AVI also has the following major

... to this gross inefficiency, AVI has the ...

> +  limitations:
> +</para>
> +
> +<orderedlist>
> +<listitem>
> +<para>
> +  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 so they are not practical.
> +</para>
> +</listitem>
> +<listitem>
> +<para>
> +  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.
> +</para>
> +</listitem>
> +</orderedlist>
> +
> +<para>
> +  With all of that said, <application>MEncoder</application> does not

"Having said all that, MEncoder does not even support"

> +  support variable-fps output or Vorbis encoding.
> +  Therefore, you may not see these as limitations if
> +  <application>MEncoder</application> is the
> +  only tool you will be using to produce your encodes.
> +  However, it is possible to use <application>MEncoder</application>
> +  only for the video encoding, and then use external tools to encode

"only for video encoding", without "the".

> +  the audio and mux it into another container format.

"encode audio".

> +</para>
> +</sect3>
> +
> +<sect3 id="menc-feat-dvd-mpeg4-muxing-matroska">
> +<title>Muxing into the Matroska container</title>
> +<para>
> +  The Matroska project is a free, open standard container format,
> +  aiming to be able to offer a lot of advanced features, which

"to be able" seems unnecessary, skip it.

> +  older containers like AVI can not handle, on an extensible basis.
> +  Matroska supports for example the storage of Variable Bitrate audio

Too elaborate and too complex.
"For example, Matroska supports Variable..."

> +  content (VBR) without any hassles, Variable Framerates (VFR),

"hassles" seem too informal. I'd skip "without any hassles" altogether.

> +  Chapters, attachment of files, Error Detection (EDC) and modern

"file attachments" to make the enumeration elements more compatible.

> +  A/V Codecs like "Advanced Audio Coding" (AAC), "Vorbis" or
> +  "MPEG-4 AVC" (H.264), next to nothing handled by AVI.
> +</para>
> +
> +<para>
> +  The tools required to create Matroska files are called
> +  <application>mkvtoolnix</application>, and are available on most

"... for most Unix platforms" (?)

> +  Unix platforms as well as <application>Windows</application>.
> +  Matroska being an open standard, you may find other tools that suit

And here, too concise and - I think - ungrammatical.
"Considering that Matroska is an open standard, you..."

> +  you better, but since mkvtoolnix is the most common, and is supported
> +  by the Matroska team itself, we will only conver its usage.
> +</para>
> +
> +<para>
> +  Probably the easiest way to get started with Matroska is to use the
> +  graphical frontend shipped with <application>mkvtoolnix</application>,
> +  <application>MMG</application> and follow the

... is to use MMG, the graphical frontend...

> +  <ulink url="http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge-gui.html">
> +  guide to mkvmerge GUI (mmg)</ulink>
> +</para>
> +
> +<para>
> +  You may also merge using the command line:

Merge what? "You may also merge source streams/files/whatever". And it'd be
technically correct to say "multiplex" or "mux" instead.

> +  <screen>mkvmerge -o <replaceable>output.mkv</replaceable> <replaceable>input_video.avi</replaceable> <replaceable>input_audio1.mp3</replaceable> <replaceable>input_audio2.ac3</replaceable></screen>
> +  This would merge the video file <replaceable>input_video.avi</replaceable>
> +  and the two audio files <replaceable>input_audio1.mp3</replaceable>
> +  and <replaceable>input_audio2.ac3</replaceable> into the Matroska
> +  file <replaceable>output.mkv</replaceable>.
> +  Matroska, as stated earlier, is able to do much more than that, like

I like "as mentioned before/earlier" better.

> +  multiple audio tracks (with a fine-tune of audio/video synchronization),

(including fine-tuning of...)

> +  chapters, subtitles, spliting, etc...
> +  Please have a look at the documentation of those applications for
> +  more details.
> +</para>
> +
> +</sect3>
> +
> +</sect2>
> +
>  </sect1>
>  
>  <sect1 id="menc-feat-telecine">

Phew. The Wanderer, your turn. ;)

Regards,
R.

-- 
MPlayer RPMs maintainer: http://rpm.greysector.net/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"




More information about the MPlayer-DOCS mailing list