Log in

View Full Version : Mencoder: speed vs quality


Razorblade2000
1st May 2004, 08:57
I want to encode from a DVD source to a MPEG4 avi file. The standard commandline isn't the way to go as there can be achieved way better results using other params.
My problem is the speed I get using my current parameters.
Using this:

cat *.vob|mencoder -mc 0 -noskip -skiplimit 0 -nosoun video.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:trell:vpass=1:mbd=2:vmax_b_frames=1:v4mv:vb_strategy=0:vlelim=0:vcelim=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4 - && cat *.vob|mencoder -mc 0 -noskip -skiplimit 0 -nosound -o video.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:trell:vpass=2:mbd=2:vbitrate=1000:vmax_b_frames=1:v4mv:vb_strategy=0:vlelim=0:vcelim=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4 -

I'll get about 11 fps (just realizing that I forgot to resize :o )
Leaving out trellis would give me a speed boost I think, but also a visible loss of quality (?!) :(

So now my question: Which are your favourite parameters for mencoder?


EDIT:
cat *.vob|mencoder -mc 0 -noskip -skiplimit 0 -vop crop=640:270:0:46,scale -zoom -xy 640 -nosound -o vido.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=1:mbd=2:vbitrate=1000:vmax_b_frames=1:v4mv:vb_strategy=0:vlelim=0:vcelim=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4 - && cat *.vob|mencoder -mc 0 -noskip -skiplimit 0 -vop crop=640:270:0:46,scale -zoom -xy 640 -nosound -o vido.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vpass=2:mbd=2:vbitrate=1000:vmax_b_frames=1:v4mv:vb_strategy=0:vlelim=0:vcelim=0:cmp=2:subcmp=2:precmp=2:predia=1:dia=1:vme=4 -

gives me 20 fps :D


EDIT2:
In case you are wondering where to get you audio from:

cat *.vob|mencoder -o ger.avi -aid 0x80 -ovc frameno -oac mp3lame -lameopts abr:br=128:aq=1:vol=10 -

will give you an ger.avi file containing mp3 audio (can be dumped via mplayer)

echo
1st May 2004, 17:54
Why are you using vhq together with mbd=2? These two settings conflict AFAIK since vhq is just short for mbd=1. Anyway the commandline I usually use is:

mencoder -sws 2 -vf crop=xxx:xxx,scale=xxx:xxx -ovc lavc \
-lavcopts vcodec=mpeg4:v4mv:mbd=1:autoaspect: \
lumi_mask=0.5:scplx_mask=0.1:cmp=256:vqmin=2:vqmax=6: \
mbqmin=2:mbqmax=10:vqdiff=2: -nosound

together with vpass=1:vqscale=2 and vpass=2:vbitrate=xxx depending on which pass I'm doing. I personally don't like b-frames that much. They are slow to encode and give me more artifacts that I would like to have. Masking on the other hand works pretty well IMHO.

edit: I'm on an old Celeron 900MHz and I usually get more than 20fps with this. If I use lavcdeint I go down to ~14-15fps depending on the movie size.

regards
echo

Razorblade2000
2nd May 2004, 01:06
just love it:

cat *.vob|mencoder -nosound -o /dev/null -sws 2 -vf scale -zoom -xy 640 -ovc lavc -lavcopts vcodec=mpeg4:mbd=1:aspect=1.85:lumi_mask=0.5:scplx_mask=0.1:vpass=1:vqscale=2:cmp=256:vqmin=2:vqmax=6:mbqmin=2:mbqmax=10 - && cat *.vob|mencoder -nosound -o video.avi -sws 2 -vf scale -zoom -xy 640 -ovc lavc -lavcopts vcodec=mpeg4:mbd=1:aspect=1.85:lumi_mask=0.5:scplx_mask=0.1:vpass=2:vbitrate=1000:cmp=256:vqmin=2:vqmax=6:mbqmin=2:mbqmax=10 -

gives me 29 fps!!!

unixfs
6th May 2004, 11:14
you shouldn't use cat *.vob|mencoder -
because it may lead to loss of synchrony.
Use mencoder -dvd-device . dvd:// instead.

Razorblade2000
6th May 2004, 11:19
thx... that's what I'll do next time :D
I somehow got the synchrony fixed (using virtualdub in window$) :D

I read this parameter somewhere in the manual yesterday :D
They really should collect useful options in an extra document...