Log in

View Full Version : Avisynth+ MT mode (HELP)


frank_zappa1
13th September 2017, 17:40
Someone could tell me how to write in the script to activate MT mode .

i am not very expert, if you have any comment or correction to the script to do it better thank you very much.

SetFilterMTMode("FFVideoSource", 3)
or
SetFilterMTMode("FFVideoSource", MT_SERIALIZED)..........

FFVideoSource("C:\ENCODE\Cap1.mkv")
LanczosResize(960, 720)

strength = 2
FFT3DFilter(bw=6, bh=6, ow=3, oh=3, plane=0, bt=1, sigma=strength)
FFT3DFilter(bw=216, bh=216, ow=108, oh=108, plane=0, bt=1, sigma=strength/8, sigma2=strength/4, sigma3=strength/2, sigma4=strength)

aWarpSharp(15,2)
Tweak(hue=0.0, sat=1.0, bright=0, cont=1.0, coring=True, sse=False, startHue=0, endHue=360, maxSat=150, minSat=0, interp=16)
ColorYUV(gain_y=0,gain_u=0, gain_v=0, off_y=0, off_u=0,off_v=0, cont_y=30, cont_u=151,cont_v=241,gamma_y=0, gamma_u=0, gamma_v=0, levels="", opt="", showyuv=false, analyze=false, autowhite=false, autogain=false)
mfToon2(ssw=4, ssh=4,xstren=80,xthresh=80,cwarp=true,sharpen=true,strength=50,wdepth=16.0,wblur=1,wthresh=0.5,drange=64,dboost=1.0,dlimit=30,debug=false,doutput=true,dclip="rclip1",scolor=$FF00FF)
f3kdb(range=15, Y=74, Cb=74, Cr=74, grainY=74, grainC=74, sample_mode=2, blur_first=True, dynamic_grain=False, opt=-1, mt=True, dither_algo=3, keep_tv_range=False, input_mode=0, input_depth=8, output_mode=0, output_depth=8)
Flash3kyuu_deband()

Thanks so much

stax76
13th September 2017, 17:42
You miss prefetch()

http://avisynth.nl/index.php/AviSynth%2B#MT_Notes

frank_zappa1
13th September 2017, 18:34
You miss prefetch()

http://avisynth.nl/index.php/AviSynth%2B#MT_Notes

could you put an example please (with the script )

thanks

stax76
13th September 2017, 18:44
Most important part is prefetch(4) as last call.

Uhm, onto the point: You enable MT by placing a single call to Prefetch(X) at the *end* of your script, where X is the number of threads to use.

frank_zappa1
13th September 2017, 23:11
Most important part is prefetch(4) as last call.

i dont understand you .. i just add this at the end ?

Prefetch(16)

Asmodian
13th September 2017, 23:33
Yes, but 16 is probably too many threads for Avisynth, save some for your encoder. Also some filters are internally threaded which multiplies....

Maybe start with 4 and see how it goes. :)

frank_zappa1
15th September 2017, 06:16
Yes, but 16 is probably too many threads for Avisynth, save some for your encoder. Also some filters are internally threaded which multiplies....

Maybe start with 4 and see how it goes. :)

i try to activate MT with this script:


FFVideoSource("C:\Users\Downloads\test1.mkv")
Crop(240, 0, -240, -0)
LanczosResize(960, 720)

vectors = MSuper().MAnalyse(isb = false,blksize=8, overlap=4,search=5)
globalmotion = MDepan(vectors, pixaspect=0.911, thSCD1=500)
DepanStabilize(data=globalmotion,cutoff=0.5,mirror=15, rotmax=5, prev=0, next=0,Blur=50,pixaspect=0.911,subpixel=2,method=1)

Prefetch(12)



MT with Avisynth+ dont work :( any help please

poisondeathray
15th September 2017, 16:00
Seems to be bottleneck or threading issue in depan/depanstabilize. I wonder if there is a special mode you need to use ? , I mean besides mode 2

SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("FFVideoSource", 3)


The equivalent script in vpy seems to multithread ok

pinterf
15th September 2017, 16:27
Unlike other filters from my package (mvtools2 2.7.22 with depans - if you are using that version), neither MDepan nor DepanStabilize autoregisters itself for Avisynth+ MT modes.
It should be MT_SERIALIZED (3) when a log file is involved (e.g. writing a deshaker log file) or you can try MT_MULTI_INSTANCE (2) in other cases.

poisondeathray
15th September 2017, 17:21
Explicitly setting SetFilterMTMode for MDepan and DepanStabilize doesn't seem to make much of a difference for that script between 1 thread, prefetch(4) or (8)

frank_zappa1
16th September 2017, 07:11
thanks for your help , any good script for MDepan and DepanStabilize ?

StainlessS
16th September 2017, 12:08
thanks for your help , any good script for MDepan and DepanStabilize ?

There are examples in the documentation.

tuanden0
16th September 2017, 12:36
Try this script, it auto add setfiltermod for your filter in avs+.
I don't remember where I found it but it's working fine and you should use it with avstp filter.

poisondeathray
16th September 2017, 16:11
Try this script, it auto add setfiltermod for your filter in avs+.
I don't remember where I found it but it's working fine and you should use it with avstp filter.


attachment pending approval ... Can you upload it somewhere else please?


Does "working fine" mean it scales (somewhat) with threads/prefetch ?

I'm not using avstp with avisynth+, I thought that was from the older avisynth mt ? Other scripts multithread fine without it. So under what conditions should avstp be used in avisynth+ ? There is no clear documentation on that

Groucho2004
16th September 2017, 16:48
I'm not using avstp with avisynth+, I thought that was from the older avisynth mt ? Other scripts multithread fine without it. So under what conditions should avstp be used in avisynth+ ? There is no clear documentation on thatAvstp enables internal multi-threading in some versions of mvtools2.dll. We had a discussion about its usefulness in combination with AVS+ multi-threading here (https://forum.doom9.org/showthread.php?p=1789533#post1789533). In my opinion one should use either internal mt via avstp.dll or AVS+ mt. Together they will most likely lead to less efficient frame serving.

poisondeathray
16th September 2017, 17:17
Avstp enables internal multi-threading in some versions of mvtools2.dll. We had a discussion about its usefulness in combination with AVS+ multi-threading here (https://forum.doom9.org/showthread.php?p=1789533#post1789533). In my opinion one should use either internal mt via avstp.dll or AVS+ mt. Together they will most likely lead to less efficient frame serving.

Thanks

Repeated same tests with avstp.dll and it's definitely faster, maybe 30-40% . But still 1/2 as fast as vpy version. I think something else is going on

frank_zappa1
17th September 2017, 10:17
............................

StainlessS
18th September 2017, 12:19
@frank_zappa1,

You can 'Bump' a thread (post 'Bump' or re-ask) if not getting any replies, but no more than once per day.
If someone feels that they can help, they will.
EDIT: Although your post #17 seems to be different question and may best be posted in a new thread.

Or you can use search bar at top of page, or google
https://www.google.co.uk/search?q=stabilize+anime+site:forum.doom9.org&spell=1&sa=X&ved=0ahUKEwjxj-ye0q7WAhVILsAKHbf7B_kQvwUIIygA&biw=1280&bih=872