Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
15th December 2011, 01:39 | #1 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
speeding up
How to speed up script, which is basically one line:
directshowsource(file.grf) Graph has just source file put through some DMO (very slow, not multithreaded) filter- that's it. It's dithering filter. Speed is slow due to processing of this DMO filter. Is there a way (except splitting into many scripts) to speed up whole process? I tried setmt and some other ways, but no luck Thanks, Andrew |
2nd January 2012, 12:45 | #2 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
How can I force avisynth to process many source files in one scrpit in seperate threads?
Tried selectevery with setmt but no luck. a=source.. b=source.. c=selecteven() d=selectodd() setmtmode(1) interleave(c,d) Is this forcing to process each source in different thread? Don't see speed boost at all. Thanks Last edited by kolak; 2nd January 2012 at 12:52. |
2nd January 2012, 13:43 | #3 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
One of the first things Avisynth does when you create a new script environment is
Code:
CoInitialize(NULL); |
2nd January 2012, 13:47 | #4 | Link |
Registered User
Join Date: Sep 2008
Posts: 365
|
there is the Threadrequest plugin, not sure if it would work for source filters though: http://forum.doom9.org/showthread.php?t=154886
|
2nd January 2012, 16:12 | #5 | Link |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,843
|
Will try threadrequest.
This seams to be the problem- all sources seams to be processed in one thread update: no luck- all slower than from single source. No sure why it does not work- is there really no way to load each source in seperate thread? Last edited by kolak; 2nd January 2012 at 17:11. |
2nd January 2012, 19:38 | #6 | Link |
Excessively jovial fellow
Join Date: Jun 2004
Location: rude
Posts: 1,100
|
I already told you exactly why it doesn't work. Everything COM-related that is called from Avisynth will run in a single-thread apartment. There is no way to change this short of changing the CoInitialize() line I mentioned and recompiling Avisynth, but changing the COM initialization mode to COINIT_MULTITHREADED is most likely a very bad idea anyway since Avisynth isn't threadsafe and DirectShowSource probably isn't either.
However, I just noticed that MP_Pipeline seems to offer exactly what you need, namely a way to run several Avisynth script environments in separate child processes and delivering all of the results to a single Avisynth script without any lossless intermediates. Most of the time this is useless for selectevery()+interleave() style multithreading since invoking any temporal filter will mean the same frames will have to be processed in all of the child processes anyway, but for your purposes it might actually work since you're not doing any temporal filtering. Try the "branch" directive and see what happens. By the way, it is important to remember that there's a difference between "thread" and "process". |
|
|