[MEncoder-users] Mencoder params

Jan Knutar jknutar at nic.fi
Wed May 21 18:01:57 CEST 2008


On Wednesday 21 May 2008 17:40, John Doe wrote:
> Hi everybody,
>
> After reading the doc and the archives, I chose these command lines:
>
> mencoder "$INPUT" -o /dev/null -really-quiet -demuxer 35
>    -of lavf -lavfopts format=flv
>    -oac mp3lame -lameopts abr:br=64 -srate 44100
>    -ovc lavc -lavcopts
> vcodec=flv:vbitrate=1000:vqscale=5:acodec=mp3:abitrate=64:mbd=0:v4mv:
>keyint=125:trell:autoaspect:turbo:vpass=1 -sws 0 -vf harddup

vbitrate and vqscale at the same time makes no sense. Also, two pass 
makes no sense if you have vqscale.

Here's the simplified explanation: 

vqscale controls how much to compress a frame, the more it is 
compressed, the less size it will use, and the less quality will be 
left. Some frames are complex and have a big size after compression 
even with high vqscale, some frames are simple and have a small size 
after compression even with low vqscale. With vqscale you sort of 
select how much to compress each frame. The resulting filesize is 
unknown, but you have a rough idea of how much quality you lose.

vbitrate does this: it changes vqscale all the time, to make frames take 
roughly the same amount of space, so that over the entire file, it will 
only have used 1000kilobits per second, as in the example of 
vbitrate=1000. This makes it possible to aim for a specific filesize.

two pass improves on this by collecting statistics during first pass, so 
that it can assign more bits to frames that are complex, and keep 
quality more even over the entire file.

So, choose either vbitrate or vqscale, and if you use vqscale then you 
only want to do one pass, with the better options as below...

> mencoder "$INPUT" -o "$OUTPUT" -really-quiet -demuxer 35
>    -of lavf -lavfopts format=flv
>    -oac mp3lame -lameopts abr:br=64 -srate 44100
>    -ovc lavc -lavcopts
> vcodec=flv:vbitrate=1000:vqscale=5:acodec=mp3:abitrate=64:mbd=2:v4mv:
>keyint=125:trell:autoaspect:vpass=2 -sws 2 -vf harddup

...

> bitrate=2000:vqscale=5:me=dia:keyint=125:trellis=1:global_header:turb
>o=1:pass=1 -sws 0 -vf harddup

I think x264 will even refuse to do anything when both bitrate and 
vqscale is specified :)



More information about the MEncoder-users mailing list