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 8th June 2019, 09:08   #1  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
RunTime Functions in AVS+

Problem with RunTime functions in AVS+.
I use in MT with Prefetch(4).
If I use ScriptClip or FrameEvaluate or a function like "filldrops" by John Meyer, I have a message that appears:
"Plane Difference: This filter can only be used within run time filters" "([ScriptClip], line 1)"

If I delete Prefetch, the error message disappears.
These functions work well in AVS-MT

Thank you for your suggestions
GillesH is offline   Reply With Quote
Old 8th June 2019, 10:12   #2  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
Does adding Grunt to plugins make the problem go away ?
__________________
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 8th June 2019, 10:14   #3  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,078
You have run into an existing bug.
pinterf is offline   Reply With Quote
Old 8th June 2019, 10:22   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
Quote:
Originally Posted by pinterf View Post
You have run into an existing bug.
This works OK in v2.60 standard with Grunt in Plugins [EDIT: shows current_frame=True]

Code:
Colorbars
Function Fn1(clip c) {
    EX=VarExist("current_frame")
    return c.Subtitle("current_Frame Exist = " + string(EX))
}

SSS="""Fn1"""

Last.Scriptclip(SSS)

return last
but not in avs+,

But if change Scriptclip to GScriptClip, then works also in AVS+

EDIT: Above without any of that Prefetch thingy stuff.
__________________
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; 8th June 2019 at 19:59.
StainlessS is offline   Reply With Quote
Old 8th June 2019, 13:47   #5  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
I redid many tests.

With the script of StainlessS, I get the same result WITH and WITHOUT GRunT.
There is no longer the same error message mentioned in the previous post. Here is the result on the image:
https://forum.doom9.org/attachment.p...1&d=1559997625

On the other hand, if I use GRunT with FrameEvaluate or filldrops, there is a crash.
Without GRunt, no crash, but always the same error message with Prefetch enabled.
https://forum.doom9.org/attachment.p...1&d=1559997697

Please, just try John Meyer's "filldrops" to see this flaw.
https://forum.doom9.org/showpost.php...84&postcount=5
Attached Images
  
GillesH is offline   Reply With Quote
Old 8th June 2019, 13:48   #6  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,359
Quote:
Originally Posted by pinterf View Post
You have run into an existing bug.
and it will never fixed?

don't know how things work in avs-mt/avs+ mt but if making all things in single Thread but when the filter is MT_MULTI_INSTANCE or MT_NICE_FILTER will work in wrapper (I think this what vs do), will fix the problem?
__________________
See My Avisynth Stuff

Last edited by real.finder; 8th June 2019 at 13:58.
real.finder is offline   Reply With Quote
Old 8th June 2019, 14:04   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
First and second links in post #5 bring up an page saying "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
__________________
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 8th June 2019, 14:39   #8  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
The links work for me. I do not understand where is this problem "Invalid Attachment" ...
This being so, it is not too important. These are just pictures of the messages created by the RunTime problem.
Here is the text of the photos:

With the StainlessS script: "current_Frame Exist = false"
With the filldrops function: "Plane Difference: This filter can only be used within run-time filters / ([Conditional Filter, Expression 1], line 1)"
GillesH is offline   Reply With Quote
Old 8th June 2019, 15:03   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
The links have not yet been approved, so only you can see them, and when approved, then your links are unnecessary as everyone can then see them without your additional links.
__________________
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 8th June 2019, 16:49   #10  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
If John Meyer goes through Doom9.
Did you try your "filldrops" function with Prefetch in your new script AVS+ ?
GillesH is offline   Reply With Quote
Old 8th June 2019, 17:39   #11  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,078
Quote:
Originally Posted by real.finder View Post
and it will never fixed?

don't know how things work in avs-mt/avs+ mt but if making all things in single Thread but when the filter is MT_MULTI_INSTANCE or MT_NICE_FILTER will work in wrapper (I think this what vs do), will fix the problem?
Filters instantiated inside scriptclip should not appear in an other thread. If current_frame is set in one thread, an MT_MULTI_INSTANCE filter or function will not see it. The error message "... can only be used..." means that there is no "current_frame" variable is seen there. Same applies on "last" which is also a sensitive variable.
pinterf is offline   Reply With Quote
Old 8th June 2019, 20:00   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
I knew that there must be a reason that I dont use multithreading, now I know why
__________________
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 8th June 2019, 20:55   #13  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,078
MT makes programmers' sleep uneasy, especially when it was coded by others but one still has to reverse engineer and fix things. I already spent weeks on this very topic, source is full with by debug lines - I'm not proud of it , but it was a couple of years ago, at that time I even had difficulties with elementary school-level c++ stuff - and abandonded the search for the solution for some days which became "forever".
As I remember, fixing the thread visibility was not enough, there was another problem: deadlocking occured sooner or later and I couldn't solve that in the given free time.
pinterf is offline   Reply With Quote
Old 8th June 2019, 21:37   #14  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,535
Quote:
Originally Posted by GillesH View Post
If John Meyer goes through Doom9.
Did you try your "filldrops" function with Prefetch in your new script AVS+ ?
I posted a version of my film restoration script that is written for AVISynth+. I am using r2508 MT, i386, by Ben Rudiak-Gould.

Here is a link to that script:

https://forum.doom9.org/showthread.p...34#post1861734

I just ran this (with GamMac enabled) and enabled filldrops(). I set the filldrops comparison variable absurdly high so filldrops would be activated on almost every frame. I had threads=3. I let the script run for a few minutes and on 720x480 16 fps progressive standard 8mm film, I got 4.68 fps.

I then did the same test, but with threads=1. After a minute (to let any caching clear out), I measured the fps and was getting 1.73. So the MT was definitely doing something.

I then set threads=8 (equal to the number of cores on my computer). This caused the render to "start and stop," with long pauses with no screen refresh. It finally froze.

Threads = 6 also froze. Also, I got an error I had never seen before: "Something appears to be stuck while trying to stop (thread deadlock)." This is exactly how it felt while the script was running, so I was not surprised.

While keeping threads at 6 I commented out the filldrops() call. This time it kept running, but there were long pauses where it didn't seem to be doing anything, and I got only about 2.2 fps.

I dropped threads to 5 and, without any calls to filldrops(), VD and AVISynth+ seemed to now be very happy, and I got 6.65 fps, a 50% increase from threads=3. I ran the script for over two minutes, and it seemed to be perfectly stable.

Since threads=5 seemed to be some sort of threshold, I kept it at 5 and then re-enabled the filldrops() call to see if the extra instance of MVTools2 (which is what this causes, since I'm not re-using any of the MVTools2 vectors, unless it is cleverly doing that behind my back) would cause a problem.

Well, performance plummeted to about 2.5 fps, and the script eventually hung. The extra invocation of MVTools2 definitely caused a problem (BTW, I'm not sure what version of MVTools2 I'm using, but I'm sure it is not very recent).

As the last test, I went back to threads=3, which is where I started, but with filldrops() enabled and with the filldrops() parameter set to cause it to execute on almost every frame. I got about 4.64 fps, but no screen refresh in VD, which made me wonder whether anything was really happening. I let it crunch for two minutes, closed VD, and then looked at the video it created. Despite not having any screen refresh in VD, the video produced by the script looked just fine.

I hope this helps!

P.S. If you need to know DLL versions, remind me what tool I use to get that (AVSMeter?) and I'll post that info.

Last edited by johnmeyer; 9th June 2019 at 01:52. Reason: add p.s.
johnmeyer is offline   Reply With Quote
Old 9th June 2019, 00:38   #15  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
Recomendation (bit pissed, you may choose to ignore or whatever),
have several machines at your disposal,
run em' all single thread,
set em off'

go to sleep, when done, sorted, easy peasy. no nonsense about how I get my CPU to run full tilt, really dont matter,
you will spend more time trying to fill up you brand spanking new 64 core machine with something to do , than if you just let em' do their own thing.

Life it too short to spend your time, tilting at wilndmills,
go get some sleep, it will sooner or later complete without lots of anxiety on your part. (EDIT: and probably a better un-messed up version will be in your in-box).
__________________
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; 11th June 2019 at 16:29.
StainlessS is offline   Reply With Quote
Old 9th June 2019, 09:10   #16  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
John,
I no longer have the version AVS+ r2508 (like you). But I tried with an older version r2455 and I still have the same error message.
For now, I'm using the latest r2772 and the latest version of MVtools2 (2.7.39).
But I'm interested in the versions you use to compare.

To minimize interference, I put ONLY "filldrops" in a mini-script and with a simple SD AVI.
Whatever the number of threads in Prefetch, I still have the error message.

This message disappears only when I delete Prefetch.

I do not doubt, for a moment, that pinterf will find the solution because these RunTime functions are important for Avisynth.
Thank you in advance.
GillesH is offline   Reply With Quote
Old 9th June 2019, 14:21   #17  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
I just did a quick test with the new AVSNEO_x86 and the problem is gone. It works with Prefetch.
I discover this Avisynth ...

Of course, this is worth a lot of time to perform multiple tests on other plugins.
And, there are, perhaps, other problems with this AVSNEO...

I can not conclude for this simple test and I remain convinced that Pinterf will find the right formula for AVS+.
Probably the "new poll" of Groucho2004 will give me reason ...
GillesH is offline   Reply With Quote
Old 9th June 2019, 15:59   #18  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 9,748
Quote:
And, there are, perhaps, other problems with this AVSNEO...
Yes, a number of problems with NEO, they dont take too long to find.
It needs quite a bit of development work done to it, before it could be properley usable.
__________________
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 10th June 2019, 08:00   #19  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,078
Latest mvtools2 is .41
I'm seeing how the problem was fixed in neo, but that source is way too different now for just cherry pick those commits. It won't be a simple merge.
pinterf is offline   Reply With Quote
Old 10th June 2019, 12:03   #20  |  Link
GillesH
Registered User
 
Join Date: Dec 2013
Location: France
Posts: 64
Thanks for the latest mvtools2 .41
Concerning the RunTime problem, it is already important to have identified the solution in NEO.
We do not doubt that you will find how to do it. All our encouragement !
GillesH 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 16:47.


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