Log in

View Full Version : SETMTMODE + Vdub filters


Mounir
6th August 2024, 15:11
I'm having trouble encoding a script with AVSPmod (script encoder VFW) into avi

Seems related to the colormill filter i believe
my observations:
- if i remove Cmill from the chain, all work fine and i use setmtmode(3,2).
- If i don't use setMTmode /setmemorymax at all it work with cmill (~25fps)


SetMemoryMax(900)
SetMTMode(3,2)
AVISource("MyVideo.avi").assumetff()
SetMTMode(3,2) #
converttorgb32(interlaced=true)
LoadVirtualDubPlugin("C:\Program Files (x86)\Virtualdub\plugins32\RGBEQ\rgbeq.vdf", "rgbeq", 0)
rgbeq("20G2020G2020G2020G2020G2020G200fG2020G1s20G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G200gG2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G1220G2020G2020G2020G2020G2020G2020G2020G2000G0100G4100G4100G4100G4100G4100G4100G4100H4H00G4100H4H00G0J000a0")
LoadVirtualDubPlugin("C:\Program Files (x86)\Virtualdub\plugins32\ColorMill.vdf", "cmill", 0)
cmill(25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 27236, 25739, 25700, 1124, 5)
converttoyv12(interlaced=true)

hello_hello
7th August 2024, 01:26
Are you using an ancient MT version of Avisynth?

Not that it'll necessarily fix the problem, but MT mode for Avisynth+ works differently, and I assume it's more stable than the old AvisynthMT.
http://avisynth.nl/index.php/SetFilterMTMode

Mounir
7th August 2024, 09:42
i'm using avisynth 2.6 MT

hello_hello
8th August 2024, 04:21
It looks like it doesn't matter anyway, as I tried your script with Avisynth+ and MT mode 3 was the only mode that worked with cmill,
but as it's the serialized MT mode the difference is very minor.
Admittedly I was running your script on a 1080p video as that's what I had open in AvsPmod, but when I ran a FPS test over 1000 frames
with MT enabled it took 52 seconds and without MT it took 53 (both ~19fps).
For Avisynth+ the default MT mode is 2.

I should mention I'm running Avisynth+ in Wine on Linux so multi-threading is probably a bit more fragile.

# Lines in blue are for Avisynth+ multithreading
converttorgb32(interlaced=true)
LoadVirtualDubPlugin("C:\Program Files\VirtualDub2\plugins32\RGBEQ\rgbeq.vdf", "rgbeq", 0)
rgbeq("20G2020G2020G2020G2020G2020G200fG2020G1s20G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G200gG2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G2020G1220G2020G2020G2020G2020G2020G2020G2020G2000G0100G4100G4100G4100G4100G4100G4100G4100H4H00G4100H4H00G0J000a0")
LoadVirtualDubPlugin("C:\Program Files\VirtualDub2\plugins32\ColorMill\ColorMill.vdf", "cmill", 0)
# Set MT mode for cmill (only mode 3 would work for me)
SetFilterMTMode("cmill", 3)
cmill(25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 25700, 27236, 25739, 25700, 1124, 5)
converttoyv12(interlaced=true)
Trim(1000, 1999)
# Comment out Prefetch line to disable multithreading
Prefetch(8)