Log in

View Full Version : Where to put SetMTmode or MT in this script?


Serbianboss
14th July 2006, 15:12
I am using this script for VHS-DVD:

LoadPlugin("VagueDenoiser.dll")
LoadPlugin("PeachSmoother.dll")
LoadPlugin("LeakKernelDeint.dll")
LoadPlugin("MaskTools.dll")
import("C:\Program Files\AviSynth 2.5\plugins\limitedsharpen.avs")
avisource("C:\My Documents\Video 1.avi")
crop(8,4,-8,-12)
AssumeBFF()
LeakKernelBob(Order=0,threshold=3)
PeachSmoother(NoiseReduction = 80, Stability = 25, Spatial = 200)
VagueDenoiser(threshold=4, method=1, nsteps=6)
limitedsharpen()
AssumeBFF()
SeparateFields()
SelectEvery(4,0,3)
Weave()
AddBorders(8,8,8,8)
ConvertToYuY2(interlaced=true)


Just to mention my source is interlaced and want to keep interlaced.

I have good result with this script, but its very slow on my dual amd 0,33 in CCE. And if i using with limited sharpen i got 0.10 speed in CCE.
So my question is: how can i speed this script? I know for multithread filter but i dont know where to put MT.

I tryed to put SetMTMode(2) on begining of script but CCE than crash.

thanx

Revgen
14th July 2006, 15:43
SetMTmode should come right before the avisource line.

Serbianboss
14th July 2006, 15:51
CCE again crash if i put SetMTmode before avisource or if i put in first line.

So any suggestion where to put MT.

Zep
14th July 2006, 16:36
CCE again crash if i put SetMTmode before avisource or if i put in first line.

So any suggestion where to put MT.

Did you install Avisynth-MT correctly? (just making sure)

if so then odds are one of the filters does not like being run threaded/window splitted. Comment everything and run if it runs ok then start uncommenting each filter/func until it crashes. then use SetMTmode(5) before that filter then set it back to SetMTmode(2) right after.


good luck

unskinnyboy
14th July 2006, 16:42
@Serbianboss, Which mode did you try when it crashed? Did you try other modes? Did you read the documentation?

From the documentation:
mode - there are 6 modes 1 to 6. Default value 2.

Mode 1 is the fastest but only works with a few filter
Mode 2 should work with most filters but uses more memory
Mode 3 should work with some of the filters that doesn't work with mode 2 but is slower
Mode 4 is a combination of mode 2 and 3 and should work with even more filter but is both slower and uses more memory
Mode 5 is slowest but should work with all filters that doesn't require linear frameserving (that is the frames come in order (frame 0,1,2 ... last)
Mode 6 is a modified mode 5 that might be slightly faster

That said, I don't think you are taking the advice you are given here very seriously. Remember this (http://forum.doom9.org/showthread.php?t=112343) thread where you were asking where to place LimitedSharpen()? We did answer you and looking at where you have placed LimitedSharpen() now, does that make any sense? If you want to keep your output interlaced, why use LeakKernelBob()? Why AssumeBFF() twice?

Serbianboss
14th July 2006, 17:58
@ZEP

Yes, i am intall MT correctly. When using simple script with convolution its everything OK(i have 100% cpu usage). But when
using with this little complex script its crash.I know modes,but i am wondering does be better when using MT not SetMT.

@unskinnyboy
Its crash when using SetMTMode(2)

I am using limited sharpen after denoising. Thats you said in the post:
http://forum.doom9.org/showpost.php?p=839802&postcount=2

I am using LeakKernelBob and assumeBFF because i want to deinterlance sourse for applying filters(denoising and sharpening) and than i back to interlaced. Here is disscusion about that:
http://forum.doom9.org/showthread.php?t=112551

unskinnyboy
14th July 2006, 18:32
After reading that thread, I understand what you are trying to do (bob+filter+reinterlace). Sorry for misreading earlier.

Did you try what Zep suggested? Which is to knock off filters one by one to see where the problem point is? That is the best way to troubleshoot any problem script. I hope you have an HT PC (?). Mode 2 needs more memory, so hope you have that too. I can only say try modes 3, 4, 6 and 5, in that order.

Boulder
14th July 2006, 19:25
PeachSmoother probably won't work - you shouldn't use it twice in a script due to it's inner workings. Using SetMTMode causes the filter to run twice so it'll blow up. If you want to use it, you should try adding SetMTMode(5) right before it and then SetMTMode(2) after it. It might work.

Serbianboss
14th July 2006, 22:54
How i use peachsmoother twice in script? I have just one line peachsmoother and vague denoiser.

Boulder
15th July 2006, 06:53
Read my post carefully.

"Using SetMTMode causes the filter to run twice so it'll blow up."

SetMTMode(2) requests two frames simultaneously. That means two instances of PeachSmoother are also called, and that's a no-no.

Serbianboss
15th July 2006, 12:06
So,whay you suggest? Does to start with SetMTMode (2) at begining and SetMTMode(5) when applying peachsmoother?

Didée
15th July 2006, 13:49
In this case, I would suggest:

1) Replace LimitedSharpen with LimitedSharpenFaster

2a) Forget about that MT thingy, and

2b) Assign Avisynth / CCE each to one core

Serbianboss
17th July 2006, 22:23
1. Which version of Mask tool to use with LimitedSharpenFaster?

2b) What you mean when you said "Assign Avisynth / CCE each to one core?"

Zep
17th July 2006, 23:12
@ZEP

Yes, i am intall MT correctly. When using simple script with convolution its everything OK(i have 100% cpu usage). But when
using with this little complex script its crash.I know modes,but i am wondering does be better when using MT not SetMT.

@unskinnyboy
Its crash when using SetMTMode(2)



Well if you have 100% CPU usage without MT then using MT is not gonna help much and may slow you down even. Testing of course is the best way to find out.

That being said you still need to do what i menyioned in my first post. ( I see boulder says peachsmoother is probably not window/thread)

You also say it crashes when using SetMTMode(2). Huge clue there and why i said once you are sure which filter/func is the problem. (Odds are it is peachsmoother since boulder already mentioned it) surround the crashing filter/func with

SetMTMode(5)
crashing Filter/Func
SetMTMode(2)