[MEncoder-users] Performance on multi core machines - a specific enquiry re avisynth mt input

infernix infernix at infernix.net
Tue Nov 13 15:52:54 CET 2007


Michael Rozdoba wrote:
> I'm using mencoder under Windows XP as part of Megui. This is to encode 
> to x264 2 pass, however as the input is an avisynth script which is very 
> slow I'm performing a pre-render step where mencoder is used to 
> transform the source via avisynth into an ffvhuff avi, which is itself 
> subsequently passed into the 2 pass x264 encode.
> 
> As the avisynth script is slow & avisynth natively doesn't make use of 
> multi core cpus I'm using the mt (0.7) extension, which enables 
> multithreading & exploitation of all cores.

I'm sorry if I'm jumping a bit late into this thread, but here's what I do.

I run avs2yuv on the avisynth script. This eats one core (my source 
material is HD) of my 3ghz q6600 with ease. I then output this to 
mencoder (or you could go straight to x264 if you want) by using fifos 
on linux.

On windows you can use stdin/stdout redirection. This way you can 
separate the avisynth processing from the encoding processing. Google 
for avs2yuv; a sample script looks like this:


BITRATE=8000
DEBLOCK=-3,-3

avs2yuv source.avs -o - | mencoder -vf scale -passlogfile temp.stats 
-oac pcm -nosound -x264encopts 
bitrate=$BITRATE:threads=6:cqm=prestige_cqm.cfg:deblock=$DEBLOCK:bframes=3:me=umh:frameref=1:subq=1:nodct_decimate:partitions=none:nopsnr:nossim:direct_pred=auto:pass=1 
-ovc x264 -of rawvideo -o /dev/null -

avs2yuv source.avs -o - | mencoder -vf scale -passlogfile temp.stats 
-oac pcm -nosound -x264encopts 
bitrate=$BITRATE:threads=6:cqm=prestige_cqm.cfg:deblock=$DEBLOCK:bframes=3:b_pyramid:bime:weight_b:brdo:me=umh:frameref=5:mixed_refs:subq=7:trellis=1:8x8dct:nofast_pskip:nopsnr:nossim:direct_pred=auto:pass=2 
-ovc x264 -of rawvideo -o encode.264 -

I guess you can figure out how to do a huff after the 1stpass yourself.

Now for the disclaimer: I do not know whether avs2yuv will solve your 
threading issue; I myself am running linux and when you use WINE with 
avs2yuv you lose multithreading instantly anyway. But if you're in luck, 
avs2yuv threads just fine. If not, its a really small C program, maybe 
you can fix it.

A sidenote for the people unfamiliar with avisynth, there's stuff you 
can do in avisynth that mencoder can still only dream of. Hopefully with 
libavfilter around the corner we'll have some more processing power there.




More information about the MEncoder-users mailing list