Log in

View Full Version : SMP idea: split avs + encoding in 2 processes to help using dualcore cpus


Malcolm
4th May 2007, 14:17
hi,
i just had an idea that might help using more than one cpu core for video encoding in case mt() doesnt work (well) and your encoder is not smp capable.
my scenario: avisynth with medium or heavy filter processing and hcenc (or quenc, ...) as the mpeg2 encoder.
since hcenc isn't smp enabled you have the problem that your processing chain is completely running inside one thread/process. Wouldn't it be possible to put the avisynth processing in one process (vdub, ...) and hcenc in another process and connect the 2 via frameserving or ipcsource or something similar? This way you should automatically benefit from 2 cpu cores because your OS should use them for the 2 processes.
Since i've never used framserving or ipcsource my knowledge in this area is practically zero. Correct me if these aren't the right tools to accomplish this.
However: if it's possible then how exactly?

tsp
4th May 2007, 15:55
you can use TCPserver/TCPsource (http://avisynth.org/mediawiki/TCPSource) on a local machine and archive what you want but i'm not sure it would be faster as the encoder still needs to wait until the frame is ready in the other process

Blue_MiSfit
5th May 2007, 00:20
I was always under the impression that the encoder and AviSynth operated in separate processes. I guess not..

That would explain why on a heavy script, x264.exe or hc.exe can gobble up 800 megs of ram!!! So tasty and sweet like marshmallow chocolates :D :D

~MiSfit

Revgen
5th May 2007, 04:43
I do this all the time with mvbob since it can't use dual-core with TSP's filter. I encode to lagarith (lossless) using this method. Just process each .avs separately with both halves of the video and assign each process to each CPU in Task Manager. IMHO avs2avi is the best for this. It's simpler, and takes up less memory. Then I proceed to encode to xvid or h264 which also use dual-core.

It saves a whole lot more time than just doing mvbob alone.

Note to MVBOB users: Make sure you have plenty of RAM before trying the above method.

Pookie
5th May 2007, 07:22
Download Runprocess.zip to give your scripts proc affinity from the command line.

http://www.jsifaq.com/docs/files/79015/runprocess.zip

runprocess.exe /m:1 avs2avi.exe ...... = run on processor 1

runprocess.exe /m:10 avs2avi.exe ..... = run on processor 2


other cool switches in the documentation