[MPlayer-users] insane compulsive maniacal mencoder settings

D Richard Felker III dalias at aerifal.cx
Sat Nov 23 09:37:02 CET 2002


On Sat, Nov 23, 2002 at 04:23:21AM -0300, Martin Pavon wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> On Thu, Nov 21, 2002 at 11:11:23PM -0500, D Richard Felker III wrote:
> > That being said, with video you have some tradeoffs you can make. Most
> > people seem to encode with really basic options, but if you play with
> > single coefficient elimination and luma masking settings, you can save
> > lots of bits, resulting in lower quantizers, which means less
> > blockiness and less ugly noise (ringing) around sharp borders. The
> > tradeoff, however, is that you'll get some "muddiness" in some parts
> > of the image. Play around with the settings and see for yourself. The
> > options I typically use for (non-animated) movies are:
> > 
> > vlelim=-4
> > vcelim=9
> > lumi_mask=0.05
> > dark_mask=0.01
> 
> Hi !!!
> 
> Can you tell me where can I find info about what are luma, chroma, single 
> coeff. elimination? I find your comments are very interesting, and other
> people told me about this options in the past too; but I don't know what
> they are. I look for it in the docs; I found suggested values but nothing
> more (I understand that docs are about mplayer/mencoder not about codecs
> in general, of course)

OK, basic explanation.

The l/c in vlelim and vcelim stands for luma (brightness plane) and
chroma (color planes). These are encoded separately in all mpeg-like
algorithms. Anyway, the idea behind these options is (at least from
what I understand) to use some good heuristics to determine when the
change in a block is less than the threshold you specify, and in such
a case, to just encode the block as "no change". This saves bits and
perhaps speeds up encoding. Using a negative value for either one
means the same thing as the corresponding positive value, but the DC
coefficient is also considered. Unfortunately I'm not familiar enough
with the mpeg terminology to know what this means (my first guess
would be that it's the constant term from the DCT), but it probably
makes the encoder less likely to apply single coefficient elimination
in cases where it would look bad. It's presumably recommended to use
negative values for luma (which is more noticable) and positive for
chroma.

The other options -- lumi_mask and dark_mask -- control how the
quantizer is adjusted for really dark or bright regions of the
picture. You're probably already at least a bit familiar with the
concept of quantizers (qscale, lower = more precision, higher quality,
but more bits needed to encode). What not everyone seems to know is
that the quantizer you see (e.g. in the 2pass logs) is just an average
for the whole frame, and lower or higher quantizers may in fact be
used in parts of the picture with more or less detail. Increasing the
values of lumi_mask and dark_mask will cause lavc to aggressively
increase the quantizer in very dark or very bright regions of the
picture (which are presumably not as noticable to the human eye) in
order to save bits for use elsewhere.

I hope that helps. If anyone else knows better on these topics, feel
free to correct me.

Rich




More information about the MPlayer-users mailing list