How to set up a simple multithreaded QTGMC template for AviSynth - staxrip/staxrip GitHub Wiki
By default, AviSynth+ is single-threaded. This how-to document shows how to set up a simple StaxRip template that enables multi-threading for QTGMC and can be used for later QTGMC jobs.
MT_MULTI_INSTANCE
Step 1: Set filter MT mode to This step makes all filters that don't have an MT(multi-thread) mode explicitly use mode 2(MT_MULTI_INSTANCE
) by default - via SetFilterMTMode
filter.
(For reference, read this document.)
Since StaxRip does not allow users to put a filter before the source filter, we need to put SetFilterMTMode
in Options
> Filters
as follows:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
QTGMC
Step 2: Activate Toggle on the QTGMC
item in the filter list.
Prefetch
Step 3: Add Add Prefetch
filter at the end.
Enter the number of threads to use. (Default: (number of logical cores in the system) + 1)
QTGMC
for multi-threading
Step 4: Customize Click Edit Code...
and customize QTGMC
for multi-threading.
EdiThreads=Y
, where Y
is about half number of cores. Tweak upwards or downwards but don't choose 0
.
At this stage, it is strongly recommended to refer to the QTGMC
manual in AviSynth Wiki for other customizable options.
Step 5: Preview script code for double check (optional)
You will see all the prerequisite plug-ins are automatically loaded by StaxRip.
This is the actual script that will be used by AviSynth+ (with the source filter replaced by the one set in Settings
after a source file is loaded) for serving the video stream data to the encoder.
Step 6: Save as a template for later use
(For example, Multi-threaded QTGMC
)
Now whenever you need to do a QTGMC
job, you can load this template and work based on it.