[MPlayer-DOCS] Re: [PATCH] List container formats and add an example

Guillaume POIRIER poirierg at gmail.com
Wed Oct 12 18:53:12 CEST 2005


Hi,

On 10/12/05, The Wanderer <inverseparadox at comcast.net> wrote:
> Guillaume POIRIER wrote:
>
> > Hi,
> >
> > On 10/12/05, Guillaume POIRIER <poirierg at gmail.com> wrote:
> >
> >> Hi there,
> >> The attached patch documents the different containers supported by
> >> MEncoder, as well as a nice example.
> >> Please review as I'm keyboard disabled :-).
> >
> > Here is an updated patch that features Oded's comment.
>
> ...I didn't see any such comment... but oh well, I'll review this patch
> anyway.

Oded commented on IRC :)


> > +<para>
> > +  Output container formats are selected with the <option>-of</option>
> > +  option.
> > +  Type:
> > +  <screen>mencoder -of help</screen> to list all containers supported
> > +  by the <application>MEncoder</application> on your machine.
>
> Depending on exactly how the <screen> tag is rendered (I haven't
> checked, partly because I have no way of knowing whether or not it's
> going to be the same on all machines), it may or may not be desirable to
> insert a linebreak (for display purposes) after the literal command.
> Admittely it would take an *exceptional* idiot to not realize that the
> "to list all containers" etc. part is not part of the intended command
> line, but there is always a bigger idiot...

the tag <screen> introduces a line break. I'd indeed prefer if it
wouldn't in this precise case, but I can't think of any other tag that
would mean "type this".

I added a line break to the XML source as well.

[..]


> > +  <row>
> > +    <entry>avi</entry>
> > +    <entry>Audio Video Interleave file</entry>
>
> I've been long since overruled on most hyphenation issues, but I really
> do think that this should be "Audio-Video Interleave". I'll note, also,
> that V.E.R.A. lists it as "Audio Video Interleaved" - which I would
> disagree with, but I'm not in a position to say much about it.
>
> Also, you say "file" here, but omit the word in almost all other cases.
> This should be brought into agreement. The same discrepancy occurs
> below, in the list of valid libavformat container types.
>
> > +  <row>
> > +    <entry>mpeg</entry>
> > +    <entry>MPEG-1 systems and MPEG-2 PS</entry>
>
> Okay, this isn't even parallel within the one entry. Do I correctly
> interpret this as meaning that in some cases the resulting container
> will be an MPEG-1 system stream and in other cases it will be an MPEG-2
> program stream? If so, what determines which? If not, then what the heck
> *does* it mean - the "MPEG-1 systems" part especially?


Okay, I zapped "file" and "systems" as they were unneeded.


[..]
> > +<screen>
> > +mencoder <replaceable>input.avi</replaceable> -o <replaceable>ouput.flv</replaceable> -of lavf -oac mp3lame -lameopts abr:br=56:q=1 -ovc lavc \
>
> Why mp3lame, rather than lavc? Is lavc's MP3 encoder really that bad?

if I'm not mistaken, lavc do not feature any mp3 encoder and uses
'lame' instead, this it's unnecessary IMHO to make ppl think the
contrary.


> > +-lavcopts vcodec=flv:vbitrate=250:autoaspect:mbd=2:mv0:trell:v4mv:cbp:last_pred=3:predia=2:dia=2:precmp=2:cmp=2:subcmp=2:preme=2 \
>
> Are all of these "dia" and "cmp" options really necessary?

no :)


> (And, yow! That bitrate! I can see how it might be considered
> appropriate for Flash, since the files involved tend to be low-quality
> and tiny, but for anything else...)
>
> > +-vf scale=320:240 -srate 22050 -af lavcresample=22050
>
> I don't think that the scaling (and, perhaps, rate constraints, and so
> forth) is necessarily appropriate for an example as generic as this one
> is described as being; unless the resolution, the sample rate, the
> bitrate, and the various other things are in fact needed to remain
> within the limits of the container format, I'd probably prefer that
> either the example be described more concretely or the extraneous
> options be omitted. (Or, at the least, marked as [optional] or
> <replaceable>.)

I have not played too much with flash video to tell you what are the
constrains of that format. I dug my archives to get a simpler yet
usable example.

Please refer to the attached patch (that also feature a note about the
fact that the container format of lavf is selected depending on the
file extension of the output file.

Is it okay now?

Guillaume
--
Reading doesn't hurt, really!
  -- Dominik 'Rathann' Mierzejewski
-------------- next part --------------
Index: en/mencoder.xml
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/en/mencoder.xml,v
retrieving revision 1.94
diff -u -r1.94 mencoder.xml
--- en/mencoder.xml	23 Sep 2005 07:30:25 -0000	1.94
+++ en/mencoder.xml	12 Oct 2005 16:50:57 -0000
@@ -20,8 +20,11 @@
 <para>
   Audio and video codecs for encoding are selected with the
   <option>-oac</option> and <option>-ovc</option> options, respectively.
-  The following choices are available, although some may not have been
-  enabled at compiletime:
+  Type:
+  <screen>mencoder -ovc help</screen>
+  for instance to list all video codec supported by the
+  <application>MEncoder</application> on your machine.
+  The following choices are available:
 </para>
 <para>
 Audio Codecs:
@@ -107,6 +110,148 @@
 </tgroup>
 </informaltable>
 </para>
+<para>
+  Output container formats are selected with the <option>-of</option>
+  option.
+  Type:
+  <screen>mencoder -of help</screen>
+  to list all containers supported by the <application>MEncoder</application>
+  on your machine.
+  The following choices are available:
+</para>
+<para>
+Container formats:
+<informaltable frame="all">
+<tgroup cols="2">
+<thead>
+<row><entry>Container format name</entry><entry>Description</entry></row>
+</thead>
+<tbody>
+  <row>
+    <entry>lavf</entry>
+    <entry>One of the containers supported by
+    <systemitem class="library">libavformat</systemitem></entry>
+  </row>
+  <row>
+    <entry>avi</entry>
+    <entry>Audio-Video Interleave</entry>
+  </row>
+  <row>
+    <entry>mpeg</entry>
+    <entry>MPEG-1 and MPEG-2 PS</entry>
+  </row>
+  <row>
+    <entry>rawvideo</entry>
+    <entry>raw video stream (no muxing - one video stream only)</entry>
+  </row>
+  <row>
+    <entry>rawaudio</entry>
+    <entry>raw audio stream (no muxing - one audio stream only)</entry>
+  </row>
+</tbody>
+</tgroup>
+</informaltable>
+  AVI container is the native container format for
+  <application>MEncoder</application>, which means that it's the one that
+  is best handled, and the one for which <application>MEncoder</application>
+  was designed.
+  As noted above, other container formats are usable, but you may
+  experience some problems when using them.
+</para>
+
+<para>
+<systemitem class="library">libavformat</systemitem> containers:
+</para>
+<para>
+  Provided that you selected <systemitem class="library">libavformat</systemitem>
+  to do the muxing of the output file (by using the <option>-of lavf</option>,
+  the appropriate container format is selected depending on the file
+  extension of the output file.
+  You may force a certain container format with
+  <systemitem class="library">libavformat</systemitem>'s
+  <option>format</option> option.
+
+<informaltable frame="all">
+<tgroup cols="2">
+<thead>
+<row><entry><systemitem class="library">libavformat</systemitem> container name</entry><entry>Description</entry></row>
+</thead>
+<tbody>
+  <row>
+    <entry>mpg</entry>
+    <entry>MPEG-1 and MPEG-2 PS</entry>
+  </row>
+  <row>
+    <entry>asf</entry>
+    <entry>Advanced Streaming Format</entry>
+  </row>
+  <row>
+    <entry>avi</entry>
+    <entry>Audio-Video Interleave file</entry>
+  </row>
+  <row>
+    <entry>wav</entry>
+    <entry>Waveform Audio</entry>
+  </row>
+  <row>
+    <entry>swf</entry>
+    <entry>Macromedia Flash</entry>
+  </row>
+  <row>
+    <entry>flv</entry>
+    <entry>Macromedia Flash video files</entry>
+  </row>
+  <row>
+    <entry>rm</entry>
+    <entry>RealAudio and RealVideo</entry>
+  </row>
+  <row>
+    <entry>au</entry>
+    <entry>SUN AU format</entry>
+  </row>
+  <row>
+    <entry>nut</entry>
+    <entry>NUT open container format (experimental and not yet spec-compliant)</entry>
+  </row>
+  <row>
+    <entry>mov</entry>
+    <entry>QuickTime</entry>
+  </row>
+  <row>
+    <entry>mp4</entry>
+    <entry>MPEG-4 format</entry>
+  </row>
+  <row>
+    <entry>dv</entry>
+    <entry>Sony Digital Video container</entry>
+  </row>
+</tbody>
+</tgroup>
+</informaltable>
+  As you can see, <systemitem class="library">libavformat</systemitem>
+  allows <application>MEncoder</application> to mux into a considerable
+  number of containers.
+  Unfortunately, as <application>MEncoder</application> was not designed
+  from the beginning to support other container formats other than AVI,
+  your should really be paranoid about the resulting file.
+  Please check to be sure that the audio/video synchronization is okay
+  and that the file can be played correctly by players other than
+  <application>MPlayer</application>.
+</para>
+
+<informalexample>
+<para>Example:</para>
+<para>
+  Creating a Macromedia Flash video suitable to be played in a web browser
+  with the Macromedia Flash plugin:
+<screen>
+mencoder <replaceable>input.avi</replaceable> -o <replaceable>ouput.flv</replaceable> -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc \
+-lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 \
+-srate 22050
+</screen>
+</para>
+</informalexample>
+
 </sect1>
 
 


More information about the MPlayer-DOCS mailing list