[MEncoder-users] encoding speed

James Hastings-Trew jimht at shaw.ca
Mon May 26 05:28:13 CEST 2008


Philippe MONROUX wrote:
> Hi,
>
> I actually encode with (please excuse the line wrapping) :
>
> -vf crop=$CROP,scale=$SCALE,hqdn3d=2:1:2,harddup -ovc x264 -x264encopts bitrate=$BR:subq=5:partitions=all:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:turbo=1:pass=1
>
> -vf crop=$CROP,scale=$SCALE,hqdn3d=2:1:2,harddup -ovc x264 -x264encopts bitrate=$BR:subq=5:partitions=all:8x8dct:frameref=2:bframes=3:b_pyramid:weight_b:pass=2
>
> but sometimes it's slow (especially with big scale).  Sure I can put turbo=2 etc...But I wonder
> whether if it's not croping and scaling which waste time. 
>
> Is it possible to use  libavcodec x.264 to benefit autoaspect option ?
> And how to use it ? 
>
> Thank you very much.
>
>   
The big time eater here is the use of hqdn3d - I'd get rid of that if 
you don't absolutely need it. Yes, arguably, the scaling takes some 
extra time since you are doing it twice, but the alternative is to crop 
and scale to some intermediate file, probably with a lossless codec, and 
that will take time AND a large amount of hard drive space, so it's hard 
to see any gain there. If you absolutely need to do the noise filtering, 
then the intermediate file starts to make sense and you will see speed 
gains from only having to crop, scale, and filter once. And unless you 
need to hit a specific file target size, use cq instead of bitrate, and 
only do one pass - that'll be the most speed gain of all.

Thats a rather high subq value if you are only going to use 2 reference 
frames. I use subq=6 and frameref=6, but only on the second pass. I 
personally don't use b_pyramid because Quicktime hates it, as does the 
PS3. I also use nofastpskip because I dislike blockiness in flat colored 
areas.

Of course it all depends on your CPU -  with my own settings I get an 
encoding speed of around 40-50 fps on both passes on my 8 core Mac Pro, 
and 24 fps on pass 1, and 6 fps on pass 2 on my 2 core AMD 4600 Athlon 
windows box.



More information about the MEncoder-users mailing list