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 Development

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 8th March 2015, 12:44   #881  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by jmac698 View Post
This is something I've always wondered about. Where is it documented? Can you give an example of these new script commands? Is it something like gscript?
It is mostly like GScript. In fact, GScript has been used as the starting point for the implementation in Avs+, and changes compared to GScript are not visible to the user (e.g. only important for Avs+ core developers). Two notable differences are between GScript and Avs+:
  • In Avs+ there is no need to use GScript(""" and """) to encompass your GScript-specific code parts. The language extensions became native to Avs+ and can be used transparently like classic Avisynth syntax.
  • The "return" statement has been slightly changed to not only exit the inner-most code block, but to terminate the whole function (or script), as anybody with even the slightest scripting experience would expect. This is one of the very few incompatible changes compared to classic Avisynth.

Quote:
Originally Posted by jmac698 View Post
Also, is there any need to use official avisynth now?
Even though the many changes, Avisynth+ is still highly compatible to classic Avisynth, with respect to both scripts and plugins - with only very few exceptions. Unless you find a bug in Avisynth+ that isn't there in Ianb's version, you should be able to use Avs+ as a complete replacement for Avs. If you do find a bug in Avs+ that is unique to it, I'd be happy if you reported it so that we can fix it, instead of just silently switching back to the old Avs.

Quote:
Originally Posted by jmac698 View Post
If not, have the two authors considered a merge?
A proposed merge was the first thing Avs+ has started out as. Only after it failed did Avs+ become a separate project. Communication with "upstream" went south early in the beginning, and I am to blame too. Nevertheless, upstream has been unresponsive since then even while we were trying to contribute, so I guess a full-blown merge is pretty much out of the question as things are right now.
__________________
AviSynth+

Last edited by ultim; 8th March 2015 at 13:13.
ultim is offline  
Old 8th March 2015, 12:53   #882  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by ryrynz View Post
What are the options? Not professing to know anything about the issue but can you just do whatever AvisynthMT does? Or use a compatibility list and address specific requirements for the filters based on that?

My thoughts are as long as the solution provides at least the same performance as AvisynthMT it's a win regardless of how hacky it may seem.
Various options are being considered of course, each with their own advantages. MT is not forgotten, but I do admit I am currently focusing on the single-threaded scenario for the next release. MT will have to wait until then. Due to all the historic baggage Avisynth has, it is very hard to introduce invasive changes like MT correctly without breaking old stuff.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 13:02   #883  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
I feel sorry to ask this question here, since from quick reading the thread, it becomes clear that there was (and hopefully is) put much effort in this creditable modernization.

That said, my question is: where is the documentation of the cited new features? I may be too stupid to find it. After Avisynth+ install, I compared the doc folder trees with BeyondCompare and can only find same docs, or files where AviSynth 2.6 is more up to date (even if Avisynth+ file date is newer!). The folder 'german' should be renamed 'french', or better removed, if it is neither complete nor updated. Also, I found nothing on the homepage and at most hints in this thread.
Nah, it's really not your fault. There is no centralized documentation so far. All features have been documented in this thread as they were released (some from the start might also be in the classic Avisynth thread), but people are - very unfortunately - left to find these posts on their own. So it is not your fault. At one point we will have to collect all these scraps of information, make proper html of it, and ship it as part of the documentation in the installer. That would be ideal, but nobody yet took the time for it. Me too, I'd rather code, fix bugs and introduce new features, than spend hours on documenting - bad habit for most programmers.

This is an area where non-programmers among you could help out (writing docs), and these contributions too would be more than welcome.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 13:09   #884  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by ultim View Post
[...]documentation[...]is an area where non-programmers among you could help out (writing docs), and these contributions too would be more than welcome.
Your response overlapped with my edit. Could you please post a guide what to install and how to merge the edits - probably with git, like the sources itself?
martin53 is offline  
Old 8th March 2015, 13:29   #885  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
Unfortunately, the file does no longer exist. Can it please be published again?
I now updated the link in the original post. Please try again and thanks for letting me know.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 13:32   #886  |  Link
chainik_svp
Registered User
 
Join Date: Mar 2012
Location: Saint-Petersburg
Posts: 239
ultim
The .avs script that is leaking memory and a part of the source video (some frames of it but with same compression and video format) should help a lot to reproduce. With simple scripts I tested, there are no leaks ATM, so I will probably need to use the same filters as you do to see it.

You won't see those leaks while running any script.
http://forum.doom9.org/showthread.ph...82#post1697682
Quote:
enter simple script into ffdshow:
Code:
SetFilterMTMode("",2)
SetFilterMTMode("ffdShow_source",3)
ffdShow_source()
BilinearResize(3000,1500)
BilinearResize(1920,1080)
Prefetch(10)
and then just check and uncheck "Avisynth" check box while looking at Task Manager memory graph
__________________
SVPflow motion interpolation
chainik_svp is offline  
Old 8th March 2015, 13:36   #887  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
With both the r1576 and the r1718 build as x86 under a X64 windows 7, this function lister script freezes after debug output 'ImageSeq_ImageWriter', even if call to all ImageSeq_ functions is avoided. Maybe the following function doesn't even like to be checked by RT_PluginFunctions().
With the given set of pre-captured (i.e. not called) functions (line #58 ff), the same script runs fine with Avisynth 2.6 ST and MT.
Created ticket, and will look at it soon:
https://github.com/AviSynth/AviSynthPlus/issues/55

Quote:
Originally Posted by martin53 View Post
Supplement: Avisynth 2.6 MT shows GetMTMode and SetMTMode as internal functions. With Avisynth+ I don't see them in the list.
That is normal. GetMTMode() ans SetMTMode() are not part of Avisynth+, as Avisynth+ uses other functions to achieve multithreading.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 13:38   #888  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
Your response overlapped with my edit. Could you please post a guide what to install and how to merge the edits - probably with git, like the sources itself?
I will try to today, give me some time.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 13:49   #889  |  Link
jmac698
Registered User
 
Join Date: Jan 2006
Posts: 1,867
Ultim,
Thanks for your response. It is good news. I remember I hesitated at first to use GScript because it required an extra plugin, but I thought it should be added to Avisynth anyhow. Now my wish has come true
jmac698 is offline  
Old 8th March 2015, 16:23   #890  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by martin53 View Post
After Avisynth+ install, I compared the doc folder trees with BeyondCompare and can only find same docs, or files where AviSynth 2.6 is more up to date (even if Avisynth+ file date is newer!). The folder 'german' should be renamed 'french', or better removed, if it is neither complete nor updated. Also, I found nothing on the homepage and at most hints in this thread.

EDIT: reading my own text, I feel I should maybe offer to contribute. Would that be welcome, even at a low level, and which prerequisites do I need (e.g. I din't have experience with git)?
That would be an installer issue if the French docs are being put in the German folder. In the source tree, the German docs are in the German folder.

There shouldn't be any cases where 2.6's docs are more up-to-date than avsplus'. If you're comparing r1576 to 2.6 RC1, then there's an obvious reason: r1576 is from December 2013. The docs changes that were part of RC1 (7/22 of the commits that comprise the difference between Alpha 5 and RC1) were merged to avsplus' Git repository with the rest of the RC1 integration about a week ago.
qyot27 is offline  
Old 8th March 2015, 17:28   #891  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
With both the r1576 and the r1718 build as x86 under a X64 windows 7, this function lister script freezes after debug output 'ImageSeq_ImageWriter', even if call to all ImageSeq_ functions is avoided. Maybe the following function doesn't even like to be checked by RT_PluginFunctions().
With the given set of pre-captured (i.e. not called) functions (line #58 ff), the same script runs fine with Avisynth 2.6 ST and MT.
I can run the script to the end just fine, both with GScript as well with the native language syntax in Avs+. For reference, here is my output. So I guess it really has to do something with that specific plugin that "doesn't like to be checked", at least not in combination with Avs+. Can you figure out which plugin it is? Then send me the plugin please so that I can investigate further.

Edit: As a side note, your script doesn't work well perfectly if some functions have the same name but different argument list. In that case it will always list the same variant. That is the same though under classic Avisynth too, not specific for Avs+ .
__________________
AviSynth+

Last edited by ultim; 8th March 2015 at 17:30.
ultim is offline  
Old 8th March 2015, 17:32   #892  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by qyot27 View Post
That would be an installer issue if the French docs are being put in the German folder. In the source tree, the German docs are in the German folder.
Actually, I've been meaning to remove non-english docs. They are out of date anyway, and it is unlikely they will ever have the same kind of maintenance as the english docs.
__________________
AviSynth+
ultim is offline  
Old 8th March 2015, 17:50   #893  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by ultim View Post
Actually, I've been meaning to remove non-english docs. They are out of date anyway, and it is unlikely they will ever have the same kind of maintenance as the english docs.
That works too. Users can always consult the avisynth.ru docs mirror, or the Wiki on avisynth.nl (which would also be a reason to slice the externalfilters/ stuff out of the English docs, or at least spin the RST versions of them off into a separate repository).
qyot27 is offline  
Old 8th March 2015, 18:26   #894  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by ultim View Post
I can run the script to the end just fine [...] Can you figure out which plugin it is? [...]
I'll gladly do, just working on it.

Quote:
Edit: As a side note, your script doesn't work well perfectly if some functions have the same name but different argument list. In that case it will always list the same variant. That is the same though under classic Avisynth too, not specific for Avs+ .
Interesting. I always wondered why identical function_parameter lines appeared more than once. If Groucho2004 extended the AVSInfoTool to display the parameter lists, we'd probably know if it's a bug in AviSynth or in RT_Stats. Actually, I re-included a check that prevents similar lines also for internal functions, not only for plugins (updated my post in RT_Stats thread) though I understand it would be better to list the functions with their multiple parameter lists.
martin53 is offline  
Old 8th March 2015, 18:57   #895  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 407
Quote:
Originally Posted by ultim View Post
Can you figure out which plugin it is?
The behavior appears to be non reproducible. List diff here.
I installed Avisynth+ r1576 again (previously had done an uninstall that reactivated 2.6 MT) and ran the script with freeze once in AvsPmod. Then looked into the script to could add another RT_DebugF() output and then noticed that's nonsense because all functions are retrieved at once into a string and the current debug output is just in the right place. After that, I ran the script successfully several times in AvsPmod and once in VDub portable. But freeze after "F2" in VDub. Next time again freeze in AvsPmod, when defreq_DeFreq was called. This was also the freezing plugin in the first run.
An explanation why it differs from my ealier post is that I then listed the plugins in reverse order (so the line 'plugin_function' comes first and I can reject the similar line 'function' without 'plugin_' prefix). Meanwhile I changed the rejection method and can also reject 'function' if it comes before 'plugin_function'.

EDIT: Reproduced freeze during DeFreq call. %PATH% includes AviSynth plugins directory (which is actually a NTFS symbolic link to another partition so I include it in the backup of that partition) and Defreq-required FFTW3.dll with date 06-21-2010 and 1.46MB is there.
But after DeFreq is removed, AvsPmod freezes in DePanEstimate.
I get more and more the feeling that it is a string/memory issue, not a plugin issue. Changed the script accordingly to following code, now always freezes. As it seems, all my FFT plugins trigger it. I remove one, the next one triggers the freeze. My suspicion is they allocate much memory, but why is that not either succesful or fails with an error, but instead enters an endless loop?
Code:
Try {RT_Version()} catch (msg) {assert(false,"This script requires the RT_Stats plugin.")}
Try {GEval("")} catch (msg) {assert(false,"This script requires the GScript plugin.")}

#============================================================================
Filename=RT_FSelSaveAs(title="Save Filter list",dir="",filt="Text files|*.txt",fn="_AllFunctions.txt",debug=true)
Assert(FileName.IsString(), "Please provide a file name to save the filter list")

#============================================================================
RT_WriteFile(Filename, VersionString(), Append=false)
#WriteInternalFunctionsSyntax(RT_InternalFunctions(), Filename)
WritePluginFunctionsSyntax(RT_PluginFunctions(), Filename)
WritePluginFunctionsSyntaxBackward(RT_PluginFunctions(), Filename)
WritePluginFunctionsSyntax(RT_PluginFunctions(), Filename)
WritePluginFunctionsSyntaxBackward(RT_PluginFunctions(), Filename)
BlankClip().subtitle("Function info is complete.",align=5)

#============================================================================
function WriteInternalFunctionsSyntax(string fu_list, string Filename) {
    GScript("""
        done=""
        while(fu_list != "") {
            i = FindStr(fu_list+" ", " ")
            fu_name = LeftStr(fu_list, i-1)
            fu_list = MidStr(fu_list, i+1)
            params = RT_PluginParam(fu_name)
            if (FindStr(done, fu_name+params)==0) {
                done = done + " "+fu_name+params
                RT_WriteFile(Filename, "internal %s ( %s ) -> %s", fu_name, params, GetReturnType(fu_name, params), Append=true)
            }
        }
    """)
}
#============================================================================
function WritePluginFunctionsSyntax(string fu_list, string Filename) {
    GScript("""
        done=""
        while(fu_list != "") {
            i = FindStr(fu_list+" ", " ")
            fu_name = LeftStr(fu_list, i-1)
            fu_list = MidStr(fu_list, i+1)
            i = FindStr(fu_name, "_")
            if (i>0) {
                params = RT_PluginParam(fu_name)
                if (FindStr(fu_list, "_"+fu_name)==0 && FindStr(done, "_"+fu_name+params)==0) {
                    done = done + " _"+fu_name+params
                    RT_WriteFile(Filename, "plugin   %s ( %s ) -> %s", fu_name, params, GetReturnType(fu_name, params), Append=true)
                }
            }
        }
    """)
}
#============================================================================
function WritePluginFunctionsSyntaxBackward(string fu_list, string Filename) {
    GScript("""
        done=""
        fu_list = RevStr(fu_list)
        while(fu_list != "") {
            i = FindStr(fu_list+" ", " ")
            fu_name = RevStr(LeftStr(fu_list, i-1))
            fu_list = MidStr(fu_list, i+1)
            i = FindStr(fu_name, "_")
            if (i>0) {
                params = RT_PluginParam(fu_name)
                if (FindStr(fu_list, "_"+fu_name)==0 && FindStr(done, "_"+fu_name+params)==0) {
                    done = done + " _"+fu_name+params
                    RT_WriteFile(Filename, "plugin   %s ( %s ) -> %s", fu_name, params, GetReturnType(fu_name, params), Append=true)
                }
            }
        }
    """)
}
#============================================================================
#function GetReturnType(string fu, string params) { return "?" }
#============================================================================
function GetReturnType(string fu, string params) {
    GScript("""
        RT_DebugF("Fu=%s %s", fu, params, name="GetReturnType")
        if (MidStr(fu,3,1)=="+") {fu = LeftStr(fu,2)+MidStr(fu,2)}
        if (MidStr(fu,2,1)=="+") {fu = LeftStr(fu,1)+fu}
        else if (fu=="Assert") {return "conditional halt"}
        else if (FindStr(fu, "avss_26_DSS2")>0) {return "clip"}
        else if (FindStr(fu, "ImageSeq_")>0) {return "clip"}
        else if (FindStr(fu, "LoadCPlugin")>0) {return "void"}
        else if (FindStr(fu, "LoadVirtualdubPlugin")>0) {return "void"}
        else if (FindStr(fu, "MDepan")>0) {return "clip"}
        else if (FindStr(fu, "MSCDetection")>0) {return "clip"}
        else if (FindStr(fu, "ResampleAudio")>0) {return "clip"}
        else if (FindStr(fu, "Resize")>0) {return "clip"}
        else if (FindStr(fu, "RT_Debug")>0) {return "clip"}
        else if (FindStr(fu, "RT_FSel")>0) {return "."}
        else if (FindStr(fu, "Source")>0) {return "clip"}
        else {
            bc = BlankClip(width=8,height=8,length=1,pixel_type="YV12")
            fp =   LeftStr(params,2)=="cc" ? "(bc,bc)"
                \ : LeftStr(params,2)=="cf" ? "(bc,0.1)"
                \ : LeftStr(params,3)=="cci" ? "(bc,bc,0)"
                \ : LeftStr(params,5)=="ciiii" ? "(bc,0,0,0,0)"
                \ : LeftStr(params,4)=="ciii" ? "(bc,0,0,0)"
                \ : LeftStr(params,3)=="cii" ? "(bc,0,0)"
                \ : LeftStr(params,2)=="ci" ? "(bc,0)"
                \ : LeftStr(params,1)=="c" ? "(bc)"
                \ : LeftStr(params,2)=="ff" ? "(0.1,0.1)"
                \ : LeftStr(params,1)=="f" ? "(0.1)"
                \ : LeftStr(params,2)=="ii" ? "(0,0)"
                \ : LeftStr(params,1)=="i" ? "(0)"
                \ : LeftStr(params,2)=="ss" ? "("+chr(34)+"1"+chr(34)+","+chr(34)+"1"+chr(34)+")"
                \ : LeftStr(params,2)=="si" ? "("+chr(34)+"1"+chr(34)+",1)"
                \ : LeftStr(params,1)=="s" ? "("+chr(34)+"1"+chr(34)+")"
                \ : "()"
            Try {
                r = Eval("current_frame=0 "+fu+fp)
                r = r.IsBool ? "bool" : r.IsClip ? "clip" : r.IsInt ? "int" : r.IsFloat ? "float" : r.IsString ? "string" : "?"}
                catch (msg) { Try {r = r.IsBool ? "bool" : r.IsClip ? "clip" : r.IsInt ? "int" : r.IsFloat ? "float" : r.IsString ? "string" : "?" } catch(msg) {r = "?"}
            }
            if (r=="?") {
                bc = BlankClip(width=8,height=8,length=1,pixel_type="RGB32")
                fp =   LeftStr(params,2)=="cc" ? "(bc,bc)"
                    \ : LeftStr(params,2)=="cf" ? "(bc,0.1)"
                    \ : LeftStr(params,3)=="cci" ? "(bc,bc,0)"
                    \ : LeftStr(params,5)=="ciiii" ? "(bc,0,0,-0,-0)"
                    \ : LeftStr(params,4)=="ciii" ? "(bc,0,0,0)"
                    \ : LeftStr(params,3)=="cii" ? "(bc,0,0)"
                    \ : LeftStr(params,2)=="ci" ? "(bc,0)"
                    \ : "(bc)"
                Try {
                    r = Eval("current_frame=0 "+fu+fp)
                    r = r.IsBool ? "bool" : r.IsClip ? "clip" : r.IsInt ? "int " : r.IsFloat ? "float" : r.IsString ? "string" : "?"
                } catch (msg) {
                    r = "?"
                }
            }
            if (r=="?" && LeftStr(params,1)=="c") {r="clip?"}
            return r
        }
    """)
}

Last edited by martin53; 8th March 2015 at 19:43.
martin53 is offline  
Old 8th March 2015, 19:15   #896  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
or the Wiki on avisynth.nl (which would also be a reason to slice the externalfilters/ stuff out of the English docs
Will move them out.
Wilbert is offline  
Old 8th March 2015, 19:24   #897  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
Your response overlapped with my edit. Could you please post a guide what to install and how to merge the edits - probably with git, like the sources itself?
Exactly, with Git, just like you would handle the source itself. Actually, Git doesn't (and cannot really) differentiate between sources and docs at all.

First, you'll need a GitHub account. Then get GitHub for Windows, which will be your offline GUI to Git. Then you just follow this process while editing the docs with your text editor/html-viewer. If you will be working on the docs and not on the sources, there aren't any more tools you'll need.
__________________
AviSynth+
ultim is offline  
Old 9th March 2015, 00:00   #898  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by martin53 View Post
Changed the script accordingly to following code, now always freezes.
I checked the new script. True this one "freezes", more exactly it keeps running forever by never stopping to output. It outputs all functions A-Z, then backwards Z-A, then again A-Z, then Z-A, and seems to keep on doing this forever. Judging by this regular output pattern, are you sure it is not a bug in your script? See output here.

Edit: After letting it run loooong enough, it actually finished execution! Is it normal to output everyhting A-Z-A-Z-A a couple of time?
__________________
AviSynth+

Last edited by ultim; 9th March 2015 at 00:13.
ultim is offline  
Old 9th March 2015, 00:28   #899  |  Link
ultim
AVS+ Dev
 
ultim's Avatar
 
Join Date: Aug 2013
Posts: 359
Quote:
Originally Posted by chainik_svp View Post
You won't see those leaks while running any script.
http://forum.doom9.org/showthread.ph...82#post1697682
I tried it now with ffdshow (in MPC-HC) and your script. Only difference is I used 5 instead of 10 threads as I have a 4-core CPU. Toggled the AviSynth-option in ffdshow on and off at least a dozen of times, and memory consumption was always about 330Mbytes in task manager when switched on. Said differently, I see no obvious memory leak.

I looked at the date when you originally reported this, and it was in oct.2014. Given that the last release is from 2013, I think this bug might have been corrected since then. There has been a LOT of fixes since that release, and it would explain why you see this bug and I don't. Anyway, I'll publish a new test binary of Avs+ in a couple of days, and let me know if the problem still pertains.
__________________
AviSynth+

Last edited by ultim; 9th March 2015 at 00:31.
ultim is offline  
Old 9th March 2015, 09:15   #900  |  Link
Octo-puss
Registered User
 
Join Date: Jan 2008
Posts: 571
Oh the development is back. Very nice!
Octo-puss is offline  
Closed Thread

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 15:33.


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