Log in

View Full Version : When to use SetMTMode and distributor?


Mole
8th October 2012, 13:05
Should I always use Setmtmode(5,0) before loading source files?

I've used Setmtmode(2,0) with mpeg2source and avisource and haven't had any problems, but I read elsewhere that you should always use 5.

It's even mentioned here (http://avisynth.org/mediawiki/MT_support_page) that mpeg2source can be used with Setmtmode(1,0)

DGSource doesn't work with 2, but it works with Setmtmode(3,0).

Why is it recommended to use 5 and what potential problems are there by using faster modes?


When I have a script which I want to send to VirtualDub for further processing with Neat Video, should I add distributor() at the end of the script?

The script will serve
DGSource or mpeg2source
and usually with QTGMC

What about distributor() when I'm serving to MeGUI for x264 compression?

In this case the script will serve avisource and use nnedi3_rpow2 and LimitedSharpenFaster or LFSMod.

Mole
8th October 2012, 13:19
This is a sample script which I send to VirtualDub

Setmtmode(5,0)
DGSource("video.dgi")
Setmtmode(2)
trim(4810,117880)
a=trim(0,111869).crop(22,56,676,464).QTGMC(preset="slow", FPSDivisor=2)
b=trim(111870,0).crop(22,56,676,464).QTGMC(preset="fast", FPSDivisor=2).Greyscale()
a+b
converttorgb32()


This is what I typically send to MeGUI

Setmtmode(5,0)
avisource("video.avi", audio=no)
Import("LimitedSharpenFaster.avs")
Setmtmode(2)
a=trim(0,111869).nnedi3_rpow2(rfactor=2,threads=1).LimitedSharpenFaster(special=true).Spline36Resize(1280, 720)
b=trim(111870,0).grayscale().nnedi3_rpow2(rfactor=2, cshift="spline36resize", fwidth=1280, fheight=720, threads=1)
a+b

Or sometimes it's just like this:

Setmtmode(5,0)
avisource("video.avi", audio=no)
Setmtmode(2)
a=trim(0,111869).crop(8,0,704,576).LSFmod(defaults="fast").Spline36Resize(704,400)
b=trim(111870,0).crop(8,0,704,576).Spline36Resize(704,400).grayscale()
a+b

SamKook
11th October 2012, 06:26
It's pretty much only about compatibility. 5 is recommended because it will work with anything, but if something lower works, then there's no downside about using it. 3 works with everything I load so I always use that.

It usually doesn't matter much though since loading the scripts isn't very demanding.

Distributor should only be used when the application doesn't manage it itself or it will create more threads than needed and you will most likely run into memory problems.

If you see that you don't get 100% of your CPU or close, then it needs distributor at the end and if you see 100% CPU usage without it, then it doesn't need it.
I know x264 doesn't need it and I think virtualdub doesn't either, but I'm not 100% sure.