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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th December 2011, 01:39   #1  |  Link
kolak
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
kolak is offline   Reply With Quote
Old 2nd January 2012, 12:45   #2  |  Link
kolak
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.
kolak is offline   Reply With Quote
Old 2nd January 2012, 13:43   #3  |  Link
TheFluff
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);
which I'm pretty sure ends up meaning that all COM stuff (such as various DirectShow things) will run in a single-threaded apartment. You'll have to use more than one Avisynth process to do what you want.
TheFluff is offline   Reply With Quote
Old 2nd January 2012, 13:47   #4  |  Link
mastrboy
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
mastrboy is offline   Reply With Quote
Old 2nd January 2012, 16:12   #5  |  Link
kolak
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.
kolak is offline   Reply With Quote
Old 2nd January 2012, 19:38   #6  |  Link
TheFluff
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".
TheFluff is offline   Reply With Quote
Old 2nd January 2012, 19:40   #7  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
Playing with MP pipeline now
kolak is offline   Reply With Quote
Old 3rd January 2012, 17:00   #8  |  Link
kolak
Registered User
 
Join Date: Nov 2004
Location: Poland
Posts: 2,843
No luck- all methods are slower than simple one core converting.
kolak is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.