Otherwise for example with 8-thread system MT mode will spawn 8 threads with once instance of such filter per thread (in MT mode 2), each filter instance will spawn 8 threads. When using MT mode with filters that have ability to spawn several internal processing threads - be sure to set such filters to use only 1 thread. ( Mode 5 will do for them too, but is overkill and should be avoided.)Ģ - each call in script produces N (number of threads) instances of filter. Without it MT Avisynth works like the usual one.ġ - one filter instance per call in script, no guarding from Avisynth, only for filters that are designed for this mode, like distributor().ģ - one filter instance per call in script, Avisynth guards requests for output. SetMTMode is the command that switches Avisynth into MT mode. If you are sure mentioned above 3 cases don't apply to your crash/wrong result - post here a way to reproduce it. Not really MT problem, as they also won't work correctly in non-MT mode when frame requests from next filter are not sequential. Plugins/scripts that depend on sequential frame requests are not going to work correctly with current MT mode. Try increasing or decreasing SetMemoryMax, fewer number of threads (second parameter in first SetMTMode). If you see (in Task Manager) that application crashes with memory usage near 2/3/4 GB (depending on your environment) - you are facing cache inefficiency of MT Avisynth. Not an avisynth or its plugins problem, but worth noting. Note: exe file of application must be correctly compiled to use mentioned above 3GB or 4GB. On 64-bit OS: it's 4GB per 32-bit application, so there are benefits of using 64-bit OS even if 32-bit applications are all you need.
#Avisynth 2.5.8 mt windows
With /3GB windows boot option it can be increased to 3GB but it's not problem free. On 32-bit OS: you are likely limited to 2GB per process. Being 32-bit Avisynth has certain memory limits. That means if you experience crashes first of all you should check that all used plugins are built with recent headers as old ones are not compatible with multithreading. In case something crashes or works wrongĪvisynth is desinged in such a way that part of it is compiled into each plugin. Note: current ffdshow has bug in interaction with avisynth that results in often crashes on stop of MT scripts. Use 1-2 more than it sets with "Use Current" button while playback is running. GetMTMode(false) > 0 ? distributor() : lastand ensure you have "Buffer back/ahead" enabled with enough number for "ahead" ("back" usually can be 0 with no problems). Understanding different MT modes would help a lot, but most things are going to work ok with script like this one:
Replace avisynth.dll in your system32 (on 32-bit OS) or syswow64 (on 64-bit OS) folder with the one from this thread.
#Avisynth 2.5.8 mt install
Install any recent official version of Avisynth. MT mode stability is way better than Avisynth 2.5.8, general stability - the same as official Avisynth 2.6 (which is again better than 2.5.8 due to many bugfixes since then). Here is my builds of Avisynth 2.6 with several (mostly MT) fixes. You can now move some things from system32 folder to plugins folder, but check that there are no unexpected old dll versions in plugins folder in case you see strange errors. Note: Starting from version 2012.04.03 plugin's folder is searched first for its dll dependences.