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

Reply
 
Thread Tools Search this Thread Display Modes
Old 20th March 2020, 00:13   #1  |  Link
benzio
Registered User
 
Join Date: Oct 2018
Posts: 6
How to make it work Multi Threading in Avisynth+ with TweakHist?

Hi!

I have this script:

Code:
SetFilterMTMode("DEFAULT_MT_MODE", 2)
A1 = avisource("JVC1.avi")
A2 = avisource("JVC2.avi")
B2 = ScriptClip(A2, "A2.TweakHist(type=2,mclip=A1.Trim(current_frame,-1))")
B2
Prefetch(4)
I followed the guides... I've put SetFilterMTMode() at the beginning and prefetch() at the end, but...
if I don't try to use MT (and I comment SetFilterMTModeand prefetch), everything works, but if use those commands on the video appears this error:

Script error: Invalid arguments to function 'TweakHist'. ([ScriptClip], line 1)

What he don't likes is to read A1 from the runtime environment.
If I put there a dummy clip everything works.

I've also tried to set the filters-MT-modes singolarly for avisource, tweakhist and whatever. Same result.
What's going on here?

Thanks to everyone will answer!
benzio is offline   Reply With Quote
Old 20th March 2020, 10:31   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,010
Dont know reason for problem, same with Avs+ r2772 and v3.4

Code:
LoadPlugin(".\x86\Modplus.dll")

#SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("TweakHist", MT_NICE_FILTER)

#A1 = avisource("d:\Parade.avi")
Global A1 = avisource("d:\Parade.avi")
A2 = avisource("d:\Parade.avi")
SSS="""                                     # Scriptclip line 1
   n=current_frame                          # Scriptclip line 2
#   TweakHist(mclip=A1)                     # Scriptclip line 3   # Uncomment this and comment out below line, no error
  Last.TweakHist(type=2,mclip=A1,mf=n)      # Scriptclip line 4     # Script error: Invalid arguments to function 'TweakHist'. ([Scriptclip Line 4])
"""

ScriptClip(A2,SSS)

Prefetch(4)
Return Last
Prob disappears if mclip=A1, removed from Scriptclip line 4.
I've made A1 Global, still problem.
Addfunction Call
Code:
	env->AddFunction("TweakHist", "ci*[type]i[mclip]c[mf]i[limit]i[rgb]i", Create_TweakHist, 0);
Remove Prefetch(4) works ok, else not.
Not a clue why this is happening.

EDIT: Below does not produce error

Code:
LoadPlugin(".\x86\Modplus.dll")

#SetFilterMTMode("DEFAULT_MT_MODE", 2)
SetFilterMTMode("TweakHist", MT_NICE_FILTER)

#A1 = avisource("d:\Parade.avi")
Global A1 = avisource("d:\Parade.avi")
A2 = avisource("d:\Parade.avi")
SSS="""                                     # Scriptclip line 1
   n=current_frame                          # Scriptclip line 2
#   TweakHist(mclip=A1)                     # Scriptclip line 3
#  Last.TweakHist(type=2,mclip=A1,mf=n)      # Scriptclip line 4     # Script error: Invalid arguments to function 'TweakHist'. ([Scriptclip Line 4])
   return A1
"""

ScriptClip(A2,SSS)

Prefetch(4)
Return Last
EDIT: "ci*[type]i[mclip]c[mf]i[limit]i[rgb]i"
Perhaps down to the "Array of Zero Or More vars of type int (i*), followed by "type" arg ALSO of type int ([type]i), dont know if avs+ borked, or TweakHist borked [less likely],
probably better if Type arg (of var type int) did not immediately follow a variable length array of type int.

EDIT:
Quote:
Prob disappears if mclip=A1, removed from Scriptclip line 4."
Above is a bit puzzling if prob down to array of int followed by 'type' int.

EDIT: The error message is produced by Avisynth, not TweakHist (so would seem to be an avs+ prob).
__________________
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; 20th March 2020 at 15:52.
StainlessS is online now   Reply With Quote
Old 20th March 2020, 14:36   #3  |  Link
benzio
Registered User
 
Join Date: Oct 2018
Posts: 6
Quote:
Originally Posted by StainlessS View Post

EDIT: "ci*[type]i[mclip]c[mf]i[limit]i[rgb]i"
Perhaps down to the "Array of Zero Or More vars of type int, followed by "type" arg ALSO of type int, dont know if avs+ borked, or TweakHist borked,
probably better if Type arg (of var type int) did not immediately follow a variable length array of type int.

EDIT:

Above is a bit puzzling if prob down to array of int followed by 'type' int.

I'm afraid I'm not Pro enough to understand this...
benzio is offline   Reply With Quote
Old 20th March 2020, 15:23   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,010
I think Pinterf needs to take a look at this thread, he should happen by at some point,
but there are recently things happening in the world external to D9 that demand serious attention [ie he could be busy].

EDIT: Because of the Prefetch() thing, I dont think it can be tested on v2.60 standard [dont think Prefetch is available in v2.60 std].
__________________
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; 20th March 2020 at 16:19.
StainlessS is online now   Reply With Quote
Old 20th March 2020, 17:08   #5  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,552
I'm here, I'm there. Well, this is a known bug (if it has the same root as the code below) which is hard fix (for me), probably was fixed in Neo but then there came other side-effects.
I'll check it later in my life, I have bookmarked those commits but since they were applied on an already very different code, it was hard to backport (hard = took more time to understand than I had at those times)

Code:
BlankClip(width=320,height=200,length=100000,pixel_type="YV24")
ScriptClip(last, "Subtitle(String(UDifferenceFromPrevious()))") # UDifferenceFromPrevious() cannot see "current frame"
Prefetch(2)

Last edited by pinterf; 20th March 2020 at 20:39. Reason: fix script
pinterf is offline   Reply With Quote
Old 20th March 2020, 18:34   #6  |  Link
benzio
Registered User
 
Join Date: Oct 2018
Posts: 6
Even if this bug cannot be fixed quickly thank you for all the work you are doing to develop this wonderful tool :-)
benzio is offline   Reply With Quote
Old 20th March 2020, 18:48   #7  |  Link
wonkey_monkey
Formerly davidh*****
 
wonkey_monkey's Avatar
 
Join Date: Jan 2004
Posts: 1,956
Yup, a great job is being done maintaining Avisynth. Thanks to all who do.
__________________
My AviSynth filters / I'm the Doctor
wonkey_monkey is offline   Reply With Quote
Old 22nd March 2020, 10:46   #8  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 1,552
Quote:
Originally Posted by benzio View Post
Even if this bug cannot be fixed quickly thank you for all the work you are doing to develop this wonderful tool :-)
I have a new build, see Avisynth+ forum for changes and download link. Please test it if it works.
pinterf is offline   Reply With Quote
Old 22nd March 2020, 16:40   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 8,010
Quote:
Originally Posted by pinterf View Post
see Avisynth+ forum for changes and download link.
Well wadya know, Avisynth+ is gonna get its own forum, not available just yet, gotta get it from the Avisynth+ thread in Avs Devs forum:- https://forum.doom9.org/showthread.p...72#post1904672


EDIT: New Avs+ works fine, above prob is no prob.
__________________
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; 22nd March 2020 at 17:29.
StainlessS is online now   Reply With Quote
Old 25th March 2020, 00:36   #10  |  Link
benzio
Registered User
 
Join Date: Oct 2018
Posts: 6
Thanks a lot! :-D
benzio is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 00:10.


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