[MPlayer-users] lavc-Options for *BEST* quality?

D Richard Felker III dalias at aerifal.cx
Mon Feb 3 19:07:17 CET 2003


On Mon, Feb 03, 2003 at 02:27:21PM +0100, Albino wrote:
> [Automatic answer: RTFM (read DOCS, FAQ), also read DOCS/bugreports.html]
> Sven Over ha scritto:
> 
> >I"m affraid I'm not up-to-date with all that lavc-options. (E.g. what is 
> >qpel?)
> >
> dont ask, use it ;)

No. qpel is very slow and gains are minimal (or even loss on some
material!) if you're using the other better options for improving
quality. Also (IIRC) it takes a good bit more cpu time to decode
movies encoded with qpel.

> >So, my question to the experts in this list: what are the options to use 
> >with lavc if I want to get highest possible quality for a given bitrate. 
> >CPU-time (almost) does not matter.
> > 
> >
> try this options:
> 
> -nosound  
> as you must create an ogm file with ogg audio (64kbit/s or even less  
> will be enough)
> to save some space from your CDs

NO, NEVER USE -NOSOUND!!! It will turn off all A/V sync code, which is
very likely to result in broken A/V sync in the final movie. Just use
-oac copy or -oac pcm if you have plenty disk space.

Also, vorbis audio is a very good way to save space, but ogm container
format is horrible. It wastes lots of space on the page headers (about
twice as much space as an AVI index for the same file) and it's not
easily seekable. I was using ogm enthusiastically for a while, but now
I'm using avi, with mp3 :( audio until someone finds a way to put
vorbis inside avi or else makes a good a/v format.

> -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=<here your bitrate>  
> you can set the bitrate of 750 or more for an overburned 80min CD with a 
> film of 2h.
> but you need to choose the bitrate accordingly to the film length and 
> the size of your media.

Both this and the nosound/ogm stuff above have nothing to do with
Sven's question, which is about options for improving quality, not
selecting bitrate and audio codec.

> and now the *quality* options:
> :vqmin=2:vlelim=-4:vcelim=9:lumi_mask=0.05:dark_mask=0.01:psnr:vhq:v4mv:trell:qpel:vpass=1
> it's sloooow but you get almost the maximum PSNR value you can play with 
> more paramaters and change the above values but you get only few or no 
> better results

vcelim is a very bad idea for what Sven asked for -- maximal quality
encoding! It will save you a good many bits (for improving quality at
low bitrate), but at the cost of messing up color quite a bit. A more
conservative value like -5 or -6 would probably be ok though. Also
vlelim should be -2 or -3 for high quality.

And as for vqmin, default has been 2 for half a year now!

> and don't forget vpass=2 for the second pass encoding ;)
> 
> if you are in hurry you can remove qpel, trell, v4mv and even vhq but don't 
> go without second pass encoding.

Umm, vhq is more important than anything. One pass with vhq is better
than 2pass without, IMHO. Of course it can vary with your source
material. One should really read Rémi's test results on these options,
BTW.

> you can encode 2h or longer film at a reasonable resolution of 640x360 
> (even more or sometimes less)
> even if you get 0,1 bit per pixel with the above parameters some (almost 
> all) film are not so bad, but some need even 0,2 or much more (you must 
> try). 
> and don't forget cropping (use -vop cropdetect)

This is the most important part! Read encoding-tips.txt for info.

Rich



More information about the MPlayer-users mailing list