Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th September 2017, 17:40   #1  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
Avisynth+ MT mode (HELP)

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)..........

Code:
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
frank_zappa1 is offline   Reply With Quote
Old 13th September 2017, 17:42   #2  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
You miss prefetch()

http://avisynth.nl/index.php/AviSynth%2B#MT_Notes
stax76 is offline   Reply With Quote
Old 13th September 2017, 18:34   #3  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
Quote:
Originally Posted by stax76 View Post
could you put an example please (with the script )

thanks
frank_zappa1 is offline   Reply With Quote
Old 13th September 2017, 18:44   #4  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Most important part is prefetch(4) as last call.

Quote:
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.
stax76 is offline   Reply With Quote
Old 13th September 2017, 23:11   #5  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
Quote:
Originally Posted by stax76 View Post
Most important part is prefetch(4) as last call.
i dont understand you .. i just add this at the end ?

Prefetch(16)
frank_zappa1 is offline   Reply With Quote
Old 13th September 2017, 23:33   #6  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,407
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.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 15th September 2017, 06:16   #7  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
MT with Avisynth+ dont work :( any help please

Quote:
Originally Posted by Asmodian View Post
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:
Code:
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

Last edited by frank_zappa1; 15th September 2017 at 06:18.
frank_zappa1 is offline   Reply With Quote
Old 15th September 2017, 16:00   #8  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
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
Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("FFVideoSource", 3)
The equivalent script in vpy seems to multithread ok

Last edited by poisondeathray; 15th September 2017 at 16:03.
poisondeathray is offline   Reply With Quote
Old 15th September 2017, 16:27   #9  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,314
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.
pinterf is offline   Reply With Quote
Old 15th September 2017, 17:21   #10  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
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)
poisondeathray is offline   Reply With Quote
Old 16th September 2017, 07:11   #11  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
thanks for your help , any good script for MDepan and DepanStabilize ?
frank_zappa1 is offline   Reply With Quote
Old 16th September 2017, 12:08   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Originally Posted by frank_zappa1 View Post
thanks for your help , any good script for MDepan and DepanStabilize ?
There are examples in the documentation.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 16th September 2017, 12:36   #13  |  Link
tuanden0
Registered User
 
Join Date: Oct 2016
Posts: 111
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.
Attached Files
File Type: rar setmt.rar (4.1 KB, 210 views)
tuanden0 is offline   Reply With Quote
Old 16th September 2017, 16:11   #14  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by tuanden0 View Post
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
poisondeathray is offline   Reply With Quote
Old 16th September 2017, 16:48   #15  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by poisondeathray View Post
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
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. 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.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 16th September 2017, 17:17   #16  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,377
Quote:
Originally Posted by Groucho2004 View Post
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. 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
poisondeathray is offline   Reply With Quote
Old 17th September 2017, 10:17   #17  |  Link
frank_zappa1
Registered User
 
Join Date: Sep 2017
Posts: 26
............................

Last edited by frank_zappa1; 23rd September 2017 at 07:56. Reason: stainlesss
frank_zappa1 is offline   Reply With Quote
Old 18th September 2017, 12:19   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@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=st...w=1280&bih=872
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 18th September 2017 at 12:39.
StainlessS is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.