[MEncoder-users] (work-in-progress) XviD encoding guide
Guillaume POIRIER
poirierg at gmail.com
Tue Jun 21 15:54:18 CEST 2005
Hello,
Here's a work-in-progress encoding guide for XviD MPEG4-ASP codec that
should one day make its way to our documentation.
As the world of video encoding is one of those areas where using this
or that set of options is often a matter of choice, I'd like to hear
what you may have to say about that document.
It still lacks some option, and says almost nothing about the PSNR
(in/de)crease to expect from using each option. If you have those
figures on hand, please feel free to send them to me.
It also lack encoding examples, and information about custom
quantization matrices, though it seems to me this subject is too
controversial to get engraved in stone in an official documentation.
All feedbacks are welcome, either technical, or about my louzy English
that you wish to improve.
Regards,
Guillaume
------------------------
<sect1 id="menc-feat-xvid">
<title>Encoding with the <systemitem class="library">XviD</systemitem>
codec</title>
<para>
<systemitem class="library">XviD</systemitem> is a free library for
encoding MPEG-4 ASP video streams.
Before starting to encode, you need to <link linkend="xvid">
set up <application>MEncoder</application> to support it</link>.
</para>
<para>
This guide mainly aims at featuring the same kind of information
as x264's encoding guide.
Therefore, please begin by reading
<link linkend="menc-feat-x264-intro">the first part</link> of that
guide.
</para>
<sect2 id="menc-feat-xvid-intro">
<title>What options should I use to get the best results?</title>
<para>
Please begin by reviewing the
<systemitem class="library">XviD</systemitem> section of
<application>MPlayer</application>'s man page.
This section is intended to be a supplement to the man page.
</para>
<para>
The XviD's default settings are already a good trade off speed vs.
quality, therefore, if you can safely stick to them if the
following section puzzles you.
</para>
</sect2>
<sect2 id="menc-feat-xvid-encoding-options">
<title>Encoding options of <systemitem class="library">XviD</systemitem></title>
<itemizedlist>
<listitem><para>
<emphasis role="bold">vhq</emphasis>
Default setting may safely be used on every encode, when higher
settings always help quality, but are significantly slower.
Turning it off will noticeably speed-up encode if you need speed.
</para></listitem>
<listitem><para>
<emphasis role="bold">bvhq</emphasis>
This does the same job as vhq, but does it on B-frames.
It has a negligible impact on speed, and slightly improves quality
(around +0.1dB PSNR).
</para></listitem>
<listitem><para>
<emphasis role="bold">max_bframes</emphasis>
A higher number of consecutive allowed B-frames usually improves
compressibility while this may lead to more blocking artifacts.
Default setting is a good trade-off of compressability vs. quality,
but you may increase it up to 3 if you're bitrate-shorted, while
you may also decrease it to 1 or 0 if you're aiming at perfect
quality though this might waste more bits than the increased of
subjective quality is worth.
</para></listitem>
<listitem><para>
<emphasis role="bold">bf_threshold</emphasis>
This controls the B-frame sensibility of the encoder, where a higher
value leads to more b-frames being used (and vice versa).
This setting is to be used together with <option>max_bframes</option>,
so that if you are bitrate-shorted, you should increase both
<option>max_bframes</option> and <option>bf_threshold</option>,
while you may <option>max_bframes</option> and reduce
<option>bf_threshold</option> so that the encoder may use more
B-frames in places that only really need them.
A low number of <option>max_bframes</option> and a high value of
<option>bf_threshold</option> is probably not a wise choice as it
will force the encoder to put B-frames in places that would not
benefit from them, therefore reducing visual quality.
However, if you need to be compatible with standalone players that
only supports DivX profiles (which only supports up to 1 consecutive
B-frame), this would be you only possibility to increase
compressibility through using B-frames.
</para></listitem>
<listitem><para>
<emphasis role="bold">trellis</emphasis>
Optimizes the motion estimation and allows significant bit saving
which would be spent elsewhere on the video, raising overall visual
quality.
You can safely leave it on as its impact on quality is very sensible,
but if you're looking for speed, only disable it if you have turn
down <option>vhq</option> to the minimum.
</para></listitem>
<listitem><para>
<emphasis role="bold">cartoon</emphasis>
Designed to better encode cartoon content, and has no impact on
speed.
</para></listitem>
<listitem><para>
<emphasis role="bold">me_quality</emphasis>
This setting is to control the precision of the motion estimation.
The higher <option>me_quality</option>, the more
precise the estimation of the original motion will be, and the
better the resulting clip will capture the original motion.
</para>
<para>
Default setting is best in pretty much all cases, and it's not
recommended to turn it down unless you're really looking for speed,
as all the bits saved by a good motion estimation would be spend
elsewhere, raising overall quality.
Therefore, only go as low as 5, and only as a last resort.
</para></listitem>
<listitem><para>
<emphasis role="bold">chroma_me</emphasis>
Improves motion estimation by taking the chroma (the color)
information into account, when <option>me_quality</option> alone
only uses luma (greyscale).
This slows down encoding by 5-10% but improves quite a bit visual
quality by reducing blocking effect.
If you're looking for speed, you should disable this option before
starting to consider reducing <option>me_quality</option>.
</para></listitem>
</itemizedlist>
</sect2>
<sect2 id="menc-feat-xvid-example">
<title>Encoding examples</title>
</sect2>
</sect1>
--
A woman isn't complete without a man.
But where do you find a man - a real man - these
days?
-- Lauren Bacall
My answer: Only at #mplayerdev on the freenode IRC network.
More information about the MEncoder-users
mailing list