[MPlayer-users] insane compulsive maniacal mencoder settings

D Richard Felker III dalias at aerifal.cx
Fri Nov 22 05:36:01 CET 2002


On Thu, Nov 21, 2002 at 07:13:25PM +0100, Louis-David Mitterrand wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> 
> I am slowing starting out with mencoder (took me 6 months to parse the
> option system ;-).
> 
> If CPU and time were not factors what would be the very best quality
> settings one could enable in mencoder, notably in -lavcopts and
> -lameopts, to get the best-looking DVD rip into a 700M CDR?

My first recommendation would be to ignore the audio to begin with
(just use -oac copy so there's some audio to sync with) and transcode
it to ogg and make an ogm file later on. That way you can get high
quality audio at only about 64-72 kbit/sec average, leaving plenty of
room for video.

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

If things look too muddy, making the numbers closer to 0. For anime
and other animation, the above recommendations may not be so good.

Another option that may be useful is allowing four motion vectors per
macroblock (v4mv). This will increase encoding time quite a bit, and
last I checked it wasn't compatible with B frames. AFAIK, specifying
v4mv should never reduce quality, but it may prevent some old junky
versions of DivX from decoding it (can anyone conform?). Another issue
might be increased cpu time needed for decoding (again, can anyone
confirm?).

To get more fair distribution of bits between low-detail and
high-detail scenes, you should probably try increasing vqcomp from the
default (0.5) to something in the range 0.6-0.8.

Of course you also want to make sure you crop ALL of the black border
and any half-black pixels at the edge of the image, and make sure the
final image dimensions after cropping and scaling are multiples of 16.
Failing to do so will drastically reduce quality.

Finally, if you can't seem to get good results, you can try scaling
the movie down a bit smaller or applying a weak gaussian blur to
reduce the amount of detail.

Now, my personal success story! I just recently managed to fit a
beautiful encode of Kundun (well over 2 hours long, but not too many
high-motion scenes) on one cd at 640x304, with 66 kbit/sec abr ogg
audio, using the options I described above. So, IMHO it's definitely
possible to get very good results with libavcodec (certainly MUCH
better than all the idiot "release groups" using DivX3 make), as long
as you take some time to play around with the options.

Rich




More information about the MPlayer-users mailing list