View Full Version : How to create a list of all AviSynth's internal functions and keywords?
Reel.Deel
2nd October 2021, 08:10
I'm looking for a way to create a list of all of avs+'s internal functions and keywords if possible. I know StainlessS has done it before and I've seen it posted but I can't find the complete list. Here for example is what I'm trying to do: https://forum.doom9.org/showthread.php?p=1937520#post1937520 (on the lower half)
The reason I need this list is:
Update the highly outdated list for Notepad3: https://github.com/rizonesoft/Notepad3/blob/e96872f3f0d9dc14b70e9f646403f80605d456a0/src/StyleLexers/styleLexAVS.c
Use it as a reference to go check the wiki with and make sure all is there.
StainlessS
2nd October 2021, 09:06
I'm looking for a way to create a list of all of avs+'s internal functions and keywords if possible.
Not 100% sure what you are asking there when you say keywords.
"if", while", "for", "Global", would [I think] be keywords but not functions.
For function names only, [no args]
RT_PluginFunctions()
Returns String, SPACE separated list of external filter and function names.
Returns "", if cannot find PluginFunctions.
If you like a good read try this:-
S=RT_StrReplace(RT_PluginFunctions," ",Chr(10))
ColorBars.ScriptClip("""RT_Subtitle("%s",S,align=5,y=height+100-current_frame,expx=true,expy=true)""").killaudio
RT_InternalFunctions()
Returns String, SPACE separated list of internal filter and function names.
Returns "", if cannot find InternalFunctions.
If you like a good read try this:-
S=RT_StrReplace(RT_InternalFunctions," ",Chr(10))
ColorBars.ScriptClip("""RT_Subtitle("%s",S,align=5,y=height+100-current_frame,expx=true,expy=true)""").killaudio
Dont think there is a way to get complete list of non function name keywords. [also True/False in your notpad3 list are actually Global Variables]
EDIT:
RT_PluginParam(String FunctionName)
FunctionName, String, name of Avisynth built-in or Plugin filter or function name.
Returns "", if FunctionName Parameter string not found.
Returns String, the Avisynth CPP Interface style argument specifier string used by Avisynth to determine argument types and optional names.
Optional arguments have square brackets surrounding their name as in [name] and are followed by a type specifier character that gives
the type. Unnamed arguments are not optional. eg "cc[arg1]b[arg2]i" would be two compulsory unnamed clip args, followed by optional
'arg1' of type bool and optional 'arg2' of type int.
# Argument type specifier strings.
c - Video Clip
i - Integer number
f - Float number
s - String
b - boolean
. - Any type (dot)
# Array Specifiers
i* - Integer Array, zero or more
i+ - Integer Array, one or more
.* - Any type Array, zero or more
.+ - Any type Array, one or more
# Etc
To show params:-
colorbars().Killaudio()
S=RT_PluginParam("RT_YStats")
S=RT_StrReplace(S,"[",Chr(10)+"[")
RT_Subtitle(s)
EDIT: RT_PluginParam above returns only a single parameter list, only 1 is exposed by AVS [unless it changed recently] even if there are multiple parameter list versions of a function. [eg AssumeFPS]
EDIT: Produced by RT_InternalFunctions example script above [first few funcs]
https://i.postimg.cc/LXFkrHNm/z-00.jpg (https://postimages.cc/)
Reel.Deel
2nd October 2021, 09:28
Thanks StainlessS, but how do I go about saving it to a text file? You did something similar a while back but it was for plugins: http://forum.doom9.net/showthread.php?p=1681523#post1681523
Not 100% sure what you are asking there when you say keywords.
"if", while", "for", "Global", would [I think] be keywords but not functions.
Words that used but are not functions, but I think there aren't that many, if, else, else if are not on that list so I was wondering if there were more of these. And it's not my list, I think it originated in Notepad2-mod by XhmikosR who also used AviSynth. I'm just looking to update it.
Edit: Nice, RT_PluginFunctions() replaced the script I posted above. Much cleaner :)
Edit2: I was able to copy the output of all of the functions just using RT_PluginFunctions(), but what if I want the arguments also and save it to a text file? The function list without args is exactly what I need for the Notepad3 list, but I would like to have args also to check against the wiki and make sure everything is a-ok.
StainlessS
2nd October 2021, 09:39
write text file,
S=RT_StrReplace(RT_InternalFunctions," ",Chr(10))
RT_WriteFile(".\Internal.txt","%s",S)
S=RT_StrReplace(RT_PluginFunctions," ",Chr(10))
RT_WriteFile(".\Plugin.txt","%s",S)
Return MessageClip("DONE")
Totally untested
EDIT: OK, tested, works but will produce duplicates, eg
AssumeFPS
AssumeFPS
AssumeFPS
AssumeFPS
I'll knock up dupe remover.
Reel.Deel
2nd October 2021, 09:50
write text file,
S=RT_StrReplace(RT_InternalFunctions," ",Chr(10))
RT_WriteFile(".\Internal.txt","%s",S)
S=RT_StrReplace(RT_PluginFunctions," ",Chr(10))
RT_WriteFile(".\Plugin.txt","%s",S)
Return MessageClip("DONE")
Totally untested
EDIT: OK, tested, works but will produce duplicates, eg
I'll knock up dupe remover.
Very nice, produces both internal functions and all of the plugins in the autoload directory :thanks:
Is there a parameter in those functions to also return the args?
Earlier I was doing it all manually with your script I posted earlier ... fortunately I only got half way, this will for sure speed up the process.
Edit:
EDIT: OK, tested, works but will produce duplicates, eg
Plugin functions are also duplicated, returns just the function name and another with the plugin name prefix.
StainlessS
2nd October 2021, 10:24
Try this, not much tested.
EDIT: Script removed, see post #18.
Plugins will return both short plugin function name and long version with dll name pre-pended, eg
ApparentFPS c[DupeThresh]f[FrameRate]f[Samples]i[ChromaWeight]f[Prefix]s[Show]b[Verbose]b[Debug]b[Mode]i[Matrix]i[BlkW]i[BlkH[i[oLapX]i[oLapY]i
ApparentFPS_ApparentFPS c[DupeThresh]f[FrameRate]f[Samples]i[ChromaWeight]f[Prefix]s[Show]b[Verbose]b[Debug]b[Mode]i[Matrix]i[BlkW]i[BlkH[i[oLapX]i[oLapY]i
AutoAdjust c[external_clip]c[auto_gain]b[dark_limit]f[bright_limit]f[gamma_limit]f[dark_exclude]f[bright_exclude]f[gain_mode]i[chroma_process]i[avg_safety]f[input_tv]b[output_tv]b[auto_balance]b[chroma_limit]f[balance_str]f[scd_threshold]i[temporal_radius]i[change_status]s[use_interp]b[use_dither]b[high_quality]b[high_bitdepth]b[threads_count]i[asm_opt]i[debug_view]b
AutoAdjust_AutoAdjust c[external_clip]c[auto_gain]b[dark_limit]f[bright_limit]f[gamma_limit]f[dark_exclude]f[bright_exclude]f[gain_mode]i[chroma_process]i[avg_safety]f[input_tv]b[output_tv]b[auto_balance]b[chroma_limit]f[balance_str]f[scd_threshold]i[temporal_radius]i[change_status]s[use_interp]b[use_dither]b[high_quality]b[high_bitdepth]b[threads_count]i[asm_opt]i[debug_view]b
And first few of builtins
DelayAudio cf
AmplifydB cf+
Amplify cf+
AssumeSampleRate ci
Normalize c[volume]f[show]b
MixAudio cc[clip1_factor]f[clip2_factor]f
ResampleAudio ci[]i
ConvertToMono c
EnsureVBRMP3Sync c
MergeChannels c+
MonoToStereo cc
GetLeftChannel c
GetRightChannel c
GetChannel ci+
GetChannels ci+
KillVideo c
KillAudio c
ConvertAudioTo16bit c
ConvertAudioTo8bit c
ConvertAudioTo24bit c
ConvertAudioTo32bit c
ConvertAudioToFloat c
ConvertAudio cii
StackVertical cc+
StackHorizontal cc+
ShowFiveVersions ccccc
Animate ciis.*
ApplyRange ciis.*
ConvertToRGB c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToRGB24 c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToRGB32 c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToRGB48 c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToRGB64 c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToPlanarRGB c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToPlanarRGBA c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s
ConvertToY8 c[matrix]s
Do you want them in sorted order ?
Reel.Deel
2nd October 2021, 10:32
Try this, not much tested.
.....
https://i.ibb.co/prNFx8h/yesawesome.gif (https://imgbb.com/)
Many thanks StainlessS, it does exactly what I need.
I added RT_Stats to the wiki a while back, just never looked at all of the functions it has :o ... definitely will be taking another look at it. Muchas gracias seņor
Do you want them in sorted order ?
If something that is easy for you to do, why not. Right now I'm using word to sort them.
StainlessS
2nd October 2021, 10:42
Ok, added sort anyway,
EDIT: Script removed, see post #18.
Reel.Deel
2nd October 2021, 10:49
Always very helpful! It's bedtime for me, hopefully I will finish this little project tomorrow and push the changes to the Notepad3 repo... and then wait for a new release.
StainlessS
2nd October 2021, 13:26
Coupla mods, again not much testing.
EDIT: Script removed, see post #18.
Can remove short or long names from plugins list. [also can add optional quotes around params]
johnmeyer
2nd October 2021, 16:17
I thought this was a silly request when I read the heading, but having skimmed through the posts, I'm actually going to use this. Thanks StainlessS, and thanks Reel.Deel for asking for it!
StainlessS
2nd October 2021, 17:18
Oh crap, we dont always get rid of dupes, Avisynth builtins slips in at least one instance where dupes are not adjactent eg
AlignedSplice "cci"
UnalignedSplice "cci"
AlignedSplice "cci"
I'll try fix this.
EDIT: I hope to hell plugins shortname longname are always adjacent. [longname produced by Avisynth rather than the plugin]
StainlessS
2nd October 2021, 19:05
This seems to get rid of all dupes.
EDIT: Script removed, see post #18.
Here with DEBUG=True [duplicates output to DebugView]
builtin [duplicate duplicates removed by hand]
00002051 0.22117560 GetFuncNames: Skip = Animate
00002054 0.22269189 GetFuncNames: Skip = AudioTrim
00002055 0.22284620 GetFuncNames: Skip = Trim
00002058 0.22336590 GetFuncNames: Skip = UnalignedSplice
00002059 0.22345090 GetFuncNames: Skip = AlignedSplice
00002060 0.22601490 GetFuncNames: Skip = AssumeFPS
00002063 0.22629890 GetFuncNames: Skip = ChangeFPS
00002066 0.22657870 GetFuncNames: Skip = ConvertFPS
00002069 0.23170970 GetFuncNames: Skip = abs
00002070 0.24058780 GetFuncNames: Skip = Eval
00002071 0.24099210 GetFuncNames: Skip = Assert
00002072 0.24781381 GetFuncNames: Skip = ArrayGet
00002073 0.24880201 GetFuncNames: Skip = BlankClip
00002076 0.24922051 GetFuncNames: Skip = Blackness
00002077 0.25198829 GetFuncNames: Skip = MergeChroma
00002078 0.25222841 GetFuncNames: Skip = MergeLuma
00002079 0.25351790 GetFuncNames: Skip = ConditionalSelect
00002080 0.25375539 GetFuncNames: Skip = ConditionalFilter
00002082 0.25410700 GetFuncNames: Skip = ScriptClip
00002083 0.25501281 GetFuncNames: Skip = WriteFile
00002084 0.25512481 GetFuncNames: Skip = WriteFileIf
00002085 0.25523159 GetFuncNames: Skip = WriteFileStart
00002086 0.25534010 GetFuncNames: Skip = WriteFileEnd
00002087 0.25627831 GetFuncNames: Skip = propSet
00002091 0.26945120 GetFuncNames: Skip = YToUV
00002093 0.27001861 GetFuncNames: Skip = CombinePlanes
00002096 0.27087259 GetFuncNames: Skip = OnCPU
Plugs [just ones I have in plugins dir]
00002313 0.20893860 GetFuncNames: Skip = GConditionalFilter
00002314 0.20943610 GetFuncNames: Skip = ConditionalFilter
StainlessS
2nd October 2021, 21:16
Sorted Internal/builtin funcs only [no long dll name versions] with dupes removed and quoted parameter lists. [AVS+, 3.70 r3382]
abs "f"
acos "f"
AddAlphaPlane "c[mask]."
AddAutoloadDir "s[toFront]b"
AddBorders "ciiiiii"
AlignedSplice "cci"
Amplify "cf+"
AmplifydB "cf+"
Animate "ciis.*"
Apply "s.*"
ApplyRange "ciis.*"
Array ".*"
ArrayGet ".i+"
ArraySize ".*"
asin "f"
Assert "s"
AssumeBFF "c"
AssumeFieldBased "c"
AssumeFPS "cc[sync_audio]b"
AssumeFrameBased "c"
AssumeSampleRate "ci"
AssumeScaledFPS "c[multiplier]i[divisor]i[sync_audio]b"
AssumeTFF "c"
atan "f"
atan2 "ff"
audiobits "c"
audiochannels "c"
AudioDub "cc"
AudioDubEx "cc"
audioduration "c"
audiolength "c"
audiolengthf "c"
audiolengthhi "c[]i"
audiolengthlo "c[]i"
audiolengths "c"
audiorate "c"
AudioTrim "cf[end]f"
AutoloadPlugins ""
AverageA "c[offset]i"
AverageB "c[offset]i"
AverageChromaU "ci"
AverageChromaV "ci"
AverageG "c[offset]i"
AverageLuma "ci"
AverageR "c[offset]i"
AVIFileSource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"
AVISource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"
BDifference "cc"
BDifferenceFromPrevious "c"
BDifferenceToNext "c[offset]i"
BicubicResize "cii[b]f[c]f[src_left]f[src_top]f[src_width]f[src_height]f"
BilinearResize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
bitand "ii"
bitchange "ii"
bitchg "ii"
bitclear "ii"
bitclr "ii"
bitlrotate "ii"
bitlshift "ii"
bitlshifta "ii"
bitlshiftl "ii"
bitlshifts "ii"
bitlshiftu "ii"
bitnot "i"
bitor "ii"
bitrol "ii"
bitror "ii"
bitrrotate "ii"
bitrshifta "ii"
bitrshiftl "ii"
bitrshifts "ii"
bitrshiftu "ii"
bitsal "ii"
bitsar "ii"
bitset "ii"
bitsetcount "i+"
bitshl "ii"
bitshr "ii"
BitsPerComponent "c"
bittest "ii"
bittst "ii"
bitxor "ii"
BlackmanResize "cii[src_left]f[src_top]f[src_width]f[src_height]f[taps]i"
Blackness "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c"
BlankClip "[]c*[length]i[width]i[height]i[pixel_type]s[fps]f[fps_denominator]i[audio_rate]i[channels]i[sample_type]s[color]i[color_yuv]i[clip]c[colors]f+"
Blur "cf[]f[mmx]b"
Bob "c[b]f[c]f[height]i"
BPlaneMax "c[threshold]f[offset]i"
BPlaneMedian "c[offset]i"
BPlaneMin "c[threshold]f[offset]i"
BPlaneMinMaxDifference "c[threshold]f[offset]i"
BuildPixelType "[family]s[bits]i[chroma]i[compat]b[oldnames]b[sample_clip]c"
[COLOR="Blue"]Cache "c"
ceil "f"
ChangeFPS "cc[linear]b"
Chr "i"
ChromaUDifference "cci"
ChromaVDifference "cci"
ClearAutoloadDirs ""
ColorBars "[width]i[height]i[pixel_type]s[staticframes]b"
ColorBarsHD "[width]i[height]i[pixel_type]s[staticframes]b"
ColorKeyMask "ci[]i[]i[]i"
ColorSpaceNameToPixelType "s"
ColorYUV "c[gain_y]f[off_y]f[gamma_y]f[cont_y]f[gain_u]f[off_u]f[gamma_u]f[cont_u]f[gain_v]f[off_v]f[gamma_v]f[cont_v]f[levels]s[opt]s[matrix]s[showyuv]b[analyze]b[autowhite]b[autogain]b[conditional]bi[showyuv_fullrange]b[f2c]b[condvarsuffix]s"
CombinePlanes "cccc[planes]s[source_planes]s[pixel_type]s[sample_clip]c"
Compare "cc[channels]s[logfile]s[show_graph]b"
ComplementParity "c"
ComponentSize "c"
ConditionalFilter "cccs[showx]b[args]s[local]b"
ConditionalReader "css[show]b[condvarsuffix]s[local]b"
ConditionalSelect "cnc+[show]b[local]b"
ContinuedDenominator "f[]i[limit]i"
ContinuedNumerator "f[]i[limit]i"
ConvertAudio "cii"
ConvertAudioTo16bit "c"
ConvertAudioTo24bit "c"
ConvertAudioTo32bit "c"
ConvertAudioTo8bit "c"
ConvertAudioToFloat "c"
ConvertBackToYUY2 "c[matrix]s"
ConvertBits "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertFPS "cc[zone]i[vbi]i"
ConvertTo16bit "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertTo8bit "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertToFloat "c[bits]i[truerange]b[dither]f[dither_bits]i[fulls]b[fulld]b"
ConvertToMono "c"
ConvertToPlanarRGB "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToPlanarRGBA "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB24 "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB32 "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB48 "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToRGB64 "c[matrix]s[interlaced]b[ChromaInPlacement]s[chromaresample]s"
ConvertToY "c[matrix]s"
ConvertToY8 "c[matrix]s"
ConvertToYUV411 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUV420 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s[ChromaOutPlacement]s"
ConvertToYUV422 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUV444 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYUY2 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV12 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s[ChromaOutPlacement]s"
ConvertToYV16 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV24 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
ConvertToYV411 "c[interlaced]b[matrix]s[ChromaInPlacement]s[chromaresample]s"
cos "f"
cosh "f"
Crop "ciiii[align]b"
CropBottom "ci"
Default ".."
Defined "."
DelayAudio "cf"
DeleteFrame "ci+"
Dissolve "cc+i[fps]f"
DoubleWeave "c"
DumpFilterGraph "c[outfile]s[mode]i[nframes]i[repeat]b"
DuplicateFrame "ci+"
Echo "cc+"
EnsureVBRMP3Sync "c"
Eval "cs[name]s"
Exist "s[utf8]b"
exp "f"
Expr "c+s+[format]s[optAvx2]b[optSingleMode]b[optSSE2]b[scale_inputs]s[clamp_float]b[clamp_float_UV]b"
ExtractA "c"
ExtractB "c"
ExtractG "c"
ExtractR "c"
ExtractU "c"
ExtractV "c"
ExtractY "c"
FadeIn "ci[color]i[fps]f"
FadeIn0 "ci[color]i[fps]f"
FadeIn2 "ci[color]i[fps]f"
FadeIO "ci[color]i[fps]f"
FadeIO0 "ci[color]i[fps]f"
FadeIO2 "ci[color]i[fps]f"
FadeOut "ci[color]i[fps]f"
FadeOut0 "ci[color]i[fps]f"
FadeOut2 "ci[color]i[fps]f"
fillstr "i[]s"
findstr "ss"
FixBrokenChromaUpsampling "c"
FixLuminance "cif"
FlipHorizontal "c"
FlipVertical "c"
float "f"
floor "f"
fmod "ff"
Format "s.*"
frac "f"
framecount "c"
FrameEvaluate "cs[showx]b[after_frame]b[args]s[local]b"
framerate "c"
frameratedenominator "c"
frameratenumerator "c"
FreezeFrame "ciii"
Func "n"
FunctionExists "s"
GaussResize "cii[src_left]f[src_top]f[src_width]f[src_height]f[p]f"
GDifference "cc"
GDifferenceFromPrevious "c"
GDifferenceToNext "c[offset]i"
GeneralConvolution "c[bias]f[matrix]s[divisor]f[auto]b[luma]b[chroma]b[alpha]b"
GetChannel "ci+"
GetChannels "ci+"
GetLeftChannel "c"
GetParity "c[n]i"
GetProcessInfo "[type]i"
GetRightChannel "c"
GPlaneMax "c[threshold]f[offset]i"
GPlaneMedian "c[offset]i"
GPlaneMin "c[threshold]f[offset]i"
GPlaneMinMaxDifference "c[threshold]f[offset]i"
Grayscale "c[matrix]s"
Greyscale "c[matrix]s"
HasAlpha "c"
HasAudio "c"
HasVideo "c"
height "c"
Hex "i[width]i"
hexvalue "s[pos]i"
Histogram "c[mode]s[].[bits]i[keepsource]b[markers]b"
HorizontalReduceBy2 "c"
Import "s+[utf8]b"
Info "c[font]s[size]f[text_color]i[halo_color]i"
int "f"
Interleave "c+"
[COLOR="blue"]InternalCache "c"
InternalFunctionExists "s"
Invert "c[channels]s"
Is420 "c"
Is422 "c"
Is444 "c"
IsArray "."
IsAudioFloat "c"
IsAudioInt "c"
IsBool "."
IsClip "."
IsFieldBased "c"
IsFloat "."
IsFloatUvZeroBased ""
IsFrameBased "c"
IsFunction "."
IsInt "."
IsInterleaved "c"
IsPackedRGB "c"
IsPlanar "c"
IsPlanarRGB "c"
IsPlanarRGBA "c"
IsRGB "c"
IsRGB24 "c"
IsRGB32 "c"
IsRGB48 "c"
IsRGB64 "c"
IsString "."
IsVersionOrGreater "[majorversion]i[minorVersion]i[bugfixVersion]i"
IsVideoFloat "c"
IsY "c"
IsY8 "c"
IsYUV "c"
IsYUVA "c"
IsYUY2 "c"
IsYV12 "c"
IsYV16 "c"
IsYV24 "c"
IsYV411 "c"
KillAudio "c"
KillVideo "c"
Lanczos4Resize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
LanczosResize "cii[src_left]f[src_top]f[src_width]f[src_height]f[taps]i"
Layer "cc[op]s[level]i[x]i[y]i[threshold]i[use_chroma]b[opacity]f[placement]s"
lcase "s"
leftstr "si"
Letterbox "cii[x1]i[x2]ii[color_yuv]i"
Levels "cfffff[coring]b[dither]b"
Limiter "c[min_luma]f[max_luma]f[min_chroma]f[max_chroma]f[show]s[paramscale]b"
Load_Stdcall_Plugin "s+"
LoadCPlugin "s+"
LoadPlugin "s+"
log "f"
log10 "f"
LogMsg "si"
Loop "c[times]i[start]i[end]i"
LumaDifference "cci"
Mask "cc"
MaskHS "c[startHue]f[endHue]f[maxSat]f[minSat]f[coring]b[realcalc]b"
Max "f+"
Merge "cc[weight]f"
MergeARGB "cccc"
MergeChannels "c+"
MergeChroma "cc[chromaweight]f"
MergeLuma "cc[lumaweight]f"
MergeRGB "ccc[pixel_type]s"
MessageClip "s[width]i[height]i[shrink]b[text_color]i[halo_color]i[bg_color]i"
midstr "si[length]i"
Min "f+"
MixAudio "cc[clip1_factor]f[clip2_factor]f"
MonoToStereo "cc"
muldiv "iii"
nop ""
Normalize "c[volume]f[show]b"
[COLOR="Red"]Null "c[copy]s"
NumComponents "c"
OnCPU "n"
OpenDMLSource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"
Ord "s"
Overlay "cc[x]i[y]i[mask]c[opacity]f[mode]s[greymask]b[output]s[ignore_conditional]b[PC_Range]b[use444]b[condvarsuffix]s"
PeculiarBlend "ci"
pi ""
PixelType "c"
PlaneToY "c[plane]s"
PointResize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
pow "ff"
Prefetch "c[threads]i[frames]i"
Preroll "c[video]i[audio]f"
propClearAll "c"
propDelete "cs"
propGetAll "c[offset]i"
propGetAny "cs[index]i[offset]i"
propGetAsArray "cs[offset]i"
propGetDataSize "cs[index]i[offset]i"
propGetFloat "cs[index]i[offset]i"
propGetInt "cs[index]i[offset]i"
propGetKeyByIndex "c[index]i[offset]i"
propGetString "cs[index]i[offset]i"
propGetType "cs[offset]i"
propNumElements "cs[offset]i"
propNumKeys "c[offset]i"
propSet "csa"
propSetArray "csn"
propSetFloat "csn[mode]i"
propSetInt "csn[mode]i"
propSetString "csn[mode]i"
propShow "c[size]i[showtype]b"
Pulldown "cii"
rand "[max]i[scale]b[seed]b"
RDifference "cc"
RDifferenceFromPrevious "c"
RDifferenceToNext "c[offset]i"
ReduceBy2 "c"
RemoveAlphaPlane "c"
replacestr "sss[sig]b"
ResampleAudio "ci[]i"
ResetMask "c[mask]f"
Reverse "c"
revstr "s"
RGBAdjust "c[r]f[g]f[b]f[a]f[rb]f[gb]f[bb]f[ab]f[rg]f[gg]f[bg]f[ag]f[analyze]b[dither]b[conditional]b[condvarsuffix]s"
RGBDifference "cci"
RGBDifferenceFromPrevious "ci"
RGBDifferenceToNext "ci"
rightstr "si"
round "f"
RPlaneMax "c[threshold]f[offset]i"
RPlaneMedian "c[offset]i"
RPlaneMin "c[threshold]f[offset]i"
RPlaneMinMaxDifference "c[threshold]f[offset]i"
ScriptClip "cs[showx]b[after_frame]b[args]s[local]b"
ScriptDir ""
ScriptDirUtf8 ""
ScriptFile ""
ScriptFileUtf8 ""
ScriptName ""
ScriptNameUtf8 ""
SegmentedAVISource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"
SegmentedDirectShowSource "s+[fps]f[seek]b[audio]b[video]b[convertfps]b[seekzero]b[timeout]i[pixel_type]s"
Select "i.+"
SelectEven "c"
SelectEvery "cii*"
SelectOdd "c"
SelectRangeEvery "c[every]i[length]i[offset]i[audio]b"
SeparateColumns "ci"
SeparateFields "c"
SeparateRows "ci"
SetCacheMode "[mode]i"
SetDeviceOpt "[opt]i[val]i"
SetFilterMTMode "si[force]b"
SetGraphAnalysis "b"
SetLogParams "[target]s[level]i"
SetMaxCPU "s"
SetMemoryMax "[]i[type]i[index]i"
SetPlanarLegacyAlignment "cb"
SetWorkingDir "s"
Sharpen "cf[]f[mmx]b"
ShowAlpha "c[pixel_type]s"
ShowBlue "c[pixel_type]s"
ShowCRC32 "c[scroll]b[offset]i[x]f[y]f[font]s[size]f[text_color]i[halo_color]i[font_width]f[font_angle]f"
ShowFiveVersions "ccccc"
ShowFrameNumber "c[scroll]b[offset]i[x]f[y]f[font]s[size]f[text_color]i[halo_color]i[font_width]f[font_angle]f"
ShowGreen "c[pixel_type]s"
ShowRed "c[pixel_type]s"
ShowSMPTE "c[fps]f[offset]s[offset_f]i[x]f[y]f[font]s[size]f[text_color]i[halo_color]i[font_width]f[font_angle]f"
ShowTime "c[offset_f]i[x]f[y]f[font]s[size]f[text_color]i[halo_color]i[font_width]f[font_angle]f"
ShowU "c[pixel_type]s"
ShowV "c[pixel_type]s"
ShowY "c[pixel_type]s"
sign "f"
sin "f"
SincResize "cii[src_left]f[src_top]f[src_width]f[src_height]f[taps]i"
sinh "f"
SkewRows "ci"
SpatialSoften "ciii"
Spline "[x]ff+[cubic]b"
Spline16Resize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
Spline36Resize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
Spline64Resize "cii[src_left]f[src_top]f[src_width]f[src_height]f"
sqrt "f"
StackHorizontal "cc+"
StackVertical "cc+"
strcmp "ss"
strcmpi "ss"
StrFromUtf8 "s"
String ".[]s"
strlen "s"
StrToUtf8 "s"
Subtitle "cs[x]f[y]f[first_frame]i[last_frame]i[font]s[size]f[text_color]i[halo_color]i[align]i[spc]i[lsp]i[font_width]f[font_angle]f[interlaced]b[font_filename]s[utf8]b"
Subtract "cc"
SwapFields "c"
SwapUV "c"
tan "f"
tanh "f"
TemporalSoften "ciii[scenechange]i[mode]i"
Text "cs[x]f[y]f[first_frame]i[last_frame]i[font]s[size]f[text_color]i[halo_color]i[align]i[spc]i[lsp]i[font_width]f[font_angle]f[interlaced]b[font_filename]s[utf8]b[bold]b"
Time "s"
Tone "[length]f[frequency]f[samplerate]i[channels]i[type]s[level]f"
Trim "ci[end]i[pad]b"
trimall "s"
trimleft "s"
trimright "s"
Turn180 "c"
TurnLeft "c"
TurnRight "c"
Tweak "c[hue]f[sat]f[bright]f[cont]f[coring]b[sse]b[startHue]f[endHue]f[maxSat]f[minSat]f[interp]f[dither]b[realcalc]b[dither_strength]f"
TypeName "."
ucase "s"
UDifferenceFromPrevious "ci"
UDifferenceToNext "ci"
UnalignedSplice "cci"
undefined ""
UPlaneMax "c[threshold]fi"
UPlaneMedian "ci"
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
UseVar "cs+"
UToY "c"
UToY8 "c"
value "s"
VarExist "s"
VDifferenceFromPrevious "ci"
VDifferenceToNext "ci"
Version ""
VersionNumber ""
VersionString ""
VerticalReduceBy2 "c"
VPlaneMax "c[threshold]fi"
VPlaneMedian "ci"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
VToY "c"
VToY8 "c"
WAVSource "s+[utf8]b"
Weave "c"
WeaveColumns "ci"
WeaveRows "ci"
width "c"
WriteFile "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
WriteFileEnd "c[filename]sn+[append]b[local]b"
WriteFileIf "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
WriteFileStart "c[filename]sn+[append]b[local]b"
YDifferenceFromPrevious "ci"
YDifferenceToNext "ci"
YPlaneMax "c[threshold]fi"
YPlaneMedian "ci"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"
YToUV "cccc"
Just to labour the point, the dupes are where there are alternate parameter list versions of a function, but we can only extract a single parameter list instance
of the functions as alternate lists are not exposed via avisynth [yet, if we whine about it enough, maybe they will be one day].
EDIT: I see the new atan2() func in there :)
EDIT: @ R.D., this one Null "c[copy]s" is [I think] some kind of avs devs debug thingy, maybe exclude from your lists. [or maybe I should exclude]
[think its supposed to produce a deliberate Access Violation, or something like that]
EDIT: Cache "c" is another peculiar one, not sure if you should include or not.
EDIT: Another peculiar one [B]InternalCache "c"
StainlessS
2nd October 2021, 22:12
Post #13 updated, removed AVS Devs debug Null "c[copy]s" from internal builtin lists,
EDIT: Post #13 Script removed, see post #18.
Change this line to FALSE to not remove Null().
EXCLUDE_NULL = True # TRUE will exclude AVS Devs Null function from builtin list
Above post internal func list has not had Null() removed.
EDIT:
Because there is a minimum value, you cannot disable the cache completely using SetMemoryMax().
However, in v2.60, you can effectively disable it by redefining the Cache() function (in your script) as follows:
function Cache(clip c) { return c }
Above thread has some other stuff about Cache() and InternalCache().
Cache, & internalcache seem to be the same & undocumented built-in func.
EDIT:
Gavino gave this to disable cache in v2.6.
function Cache(clip c) { return c }
http://forum.doom9.org/showthread.php?p=1684143#post1684143
Script functions override built-ins.
Reel.Deel
2nd October 2021, 23:07
StainlessS, you've been a busy bee ... I'll check out your updated scripts shortly.
StainlessS
3rd October 2021, 00:51
Renamed Post #13 function to GetFunctionNamesList(). [Removed other post scripts]
(also renamed output files, InternalFunctionsList.txt, and PluginFunctionsList.txt)
EDIT: With the calling code removed, the function [alone] can go in an avsi file.
EDIT: post #13 Script removed, see post #18.
StainlessS
3rd October 2021, 04:55
Current script, GetDllNamesList() will likely need more work and may not work with v2.60 std (even with GScript installed).
[I'll test v2.60 and v2.58 tomorrow]
GetFunctionNamesList.avsi
# GetFunctionNamesList.avsi
Function GetFunctionNamesList(bool "Plugin", bool "RemDup",Int "PlugMode",Bool "Args",Bool "Quotes",Bool "Sort",Bool "DEBUG") {
myName = "GetFunctionNamesList: "
Plugin = Default(Plugin,False) # Default builtin
RemDup = Default(RemDup,true) # Default remove duplicates
PlugMode = Default(PlugMode,0) # Default 0, 0=ALL Plugin names, 1 Short Plugin names only, 2 Long Plugin Names only(with DLL name prepended) # only for PLUGIN=TRUE.
Args = Default(Args,False) # Default No Args
Quotes = Default(Quotes,True) # Default Double quote parameters
Sort = Default(Sort,False) # Default No sort
DEBUG = Default(DEBUG,False) # Show where dupes removed, to DebugView [google]
Assert(!Plugin || (0 <= PlugMode <= 2),myName+"Illegal PlugMode (0 <= PlugiMode <=2)")
FnS=RT_StrReplace(Plugin?RT_PluginFunctions:RT_InternalFunctions," ",Chr(10))
LINES = RT_TxtQueryLines(FnS)
Assert(LINES>0,myName+"Failed to get function names list")
Step = (!Plugin) ? 1 : 2
S="" OldS=""
Q = (Quotes) ? Chr(34) : ""
EXCLUDE_NULL = True # TRUE will exclude AVS Devs Null function from builtin list
for(i=0,LINES-1,Step) {
t1S = RT_TxtGetLine(FnS,Line=i)
SkipNull = (EXCLUDE_NULL && !Plugin && t1S=="Null") # Skip """Null "c[copy]s"""", dont return AVS devs debug function
if(!SkipNull) {
if(RemDup) {
Skip = t1S==OldS # Qwik check for dupe (Skip==True)
if(!Skip) { # Slow check, could still be dupe (Arh!!!)
FndS = (ARGS) ? t1S + " " : t1S
SLINES=RT_TxtQueryLines(S)
for(Start=0,SLINES-1) {
Got=RT_TxtFindStr(S,FndS,Sig=False,Pos=1,Start=Start,Lines=0)
if(Got>=0) {
GotS = S.RT_TxtGetLine(Line=Got)
Pos = GotS.RT_FindStr(FndS,Sig=False,Pos=1)
Skip = (ARGS) ? Pos==1 : Pos==1 && StrLen(GotS)==StrLen(FndS)
Start = (Skip) ? SLINES : Got # Skip then break Else Start = Next Time Got+1
} else { Start=SLINES } # Break
}
}
(DEBUG && Skip) ? RT_DebugF("Removed Dupe = %s",t1S,name=myName) : NOP
} Else { Skip=False }
if(!Skip) { # Skip if dupe
OldS=t1S
if(!Plugin || PlugMode!=2) { # Shortname
t1S = (Args) ? RT_String("%s %s%s%s",t1S,Q,RT_PluginParam(t1S),Q) : t1S
S = RT_String("%s%s\n",S,t1S) # Concatenate new name + Chr(10)
}
if(Plugin && PlugMode!=1) { # Long name
t2S = RT_TxtGetLine(FnS,Line=i+1)
t2S = (Args) ? RT_String("%s %s%s%s",t2S,Q,RT_PluginParam(t2S),Q) : t2S
S = RT_String("%s%s\n",S,t2S) # Concatenate new name + Chr(10)
}
}
}
}
Return (SORT) ? S.RT_TxtSort(mode=0) : S
}
Function GetDllNamesList(String DllName,bool "RemDup",Int "PlugMode",Bool "Args",Bool "Quotes",Bool "Sort") {
myName = "GetDllNamesList: "
RemDup = Default(RemDup,true) # Default remove duplicates
PlugMode = Default(PlugMode,0) # Default 0, 0=ALL Plugin names, 1 Short Plugin names only, 2 Long Plugin Names only(with DLL name prepended) # only for PLUGIN=TRUE.
Args = Default(Args,False) # Default No Args
Quotes = Default(Quotes,True) # Default Double quote parameters
Sort = Default(Sort,False) # Default No sort
Assert(0 <= PlugMode <= 2,myName+"Illegal PlugMode (0 <= PlugiMode <=2)")
Assert(DllName!="",myName+"DllName Cannot be ''")
Name = RT_FilenameSplit(DllName,Get=4)
NameLen = Name.strlen
GoodName = 0 < NameLen
Assert(GoodName,myName+"0 < NameLen")
for(i=1,NameLen) {
c = Name.MidStr(i,1).UCase
GoodName = (i==1) ? (c=="_" || (c>="A" && c<="Z")) : (c=="_" || (c>="A" && c<="Z") || (c>="0" && c<="9"))
i = (GoodName) ? i : NameLen # continue or break
}
Assert(GoodName,myName+"Bad DllName (1st char '_' or Alpha, thereafter digits too)")
FnS = GetFunctionNamesList(True, remdup=RemDup,PlugMode=(PlugMode==2)?2:0,Args=False,sort=False)
LINES = RT_TxtQueryLines(FnS)
Assert(0 < LINES,myName+"Plugin Entries Not Found")
PreFix = name + "_"
S="" Q = (Quotes) ? Chr(34) : ""
STEP = (PlugMode==2) ? 1 : 2
for(i=0, LINES-1, STEP) {
t2S = FnS.RT_TxtGetLine(Line=i+STEP-1)
Pos = t2S.RT_FindStr(PreFix,Sig=False,Pos=1)
Skip = Pos!=1
if(!Skip) {
if(PlugMode!=2) { # Shortname
t1S = FnS.RT_TxtGetLine(Line=i)
t1S = (Args) ? RT_String("%s %s%s%s",t1S,Q,RT_PluginParam(t1S),Q) : t1S
S = RT_String("%s%s\n",S,t1S) # Concatenate new name + Chr(10)
}
if(PlugMode!=1) { # Long name
t2S = (Args) ? RT_String("%s %s%s%s",t2S,Q,RT_PluginParam(t2S),Q) : t2S
S = RT_String("%s%s\n",S,t2S) # Concatenate new name + Chr(10)
}
}
}
Return (SORT) ? S.RT_TxtSort(mode=0) : S
}
GetFunctionNamesList_Client.avs
# Import(".\GetFunctionNamesList.avsi")
REMDUP = TRUE # True) Remove function instances without alternative parameter list [only single list exposed by AVS]
PLUGMODE = 1 # 1) Only output short name, not long DLL prepended names.
ARGS = TRUE # True) append parameter list.
QUOTES = TRUE # True) enclose parameter list in double quotes.
SORT = TRUE # True) Sort final list.
DEBUG = TRUE # True, output duplicates removed to DebugView [Google]
S=GetFunctionNamesList(False,remdup=REMDUP,PlugMode=PLUGMODE,Args=ARGS,Quotes=QUOTES,sort=SORT,debug=DEBUG)
RT_WriteFile(".\InternalFunctionsList.txt","%s",S)
S=GetFunctionNamesList(True,remdup=REMDUP,PlugMode=PLUGMODE,Args=ARGS,Quotes=QUOTES,sort=SORT,debug=DEBUG)
RT_WriteFile(".\PluginFunctionsList.txt","%s",S)
Return MessageClip("DONE")
GetDllNamesList_Client.avs
# LoadPlugin(".\Grunt.dll") # If Not In Plugins
# Import(".\GetFunctionNamesList.avsi")
DLLNAME = "Grunt" # Dll to Check for functions.
REMDUP = TRUE # True) Remove function instances without alternative parameter list [only single list exposed by AVS]
PLUGMODE = 1 # 1) Only output short name, not long DLL prepended names.
ARGS = TRUE # True) append parameter list.
QUOTES = TRUE # True) enclose parameter list in double quotes.
SORT = TRUE # True) Sort final list.
S=GetDllNamesList(DLLNAME,remdup=REMDUP,PlugMode=PLUGMODE,Args=ARGS,Quotes=QUOTES,sort=SORT)
RT_WriteFile(".\DllFunctionsList.txt","%s",string(S))
Return MessageClip("DONE")
DllFunctionList.txt for "Grunt" dll
AverageChromaU "ci"
AverageChromaV "ci"
AverageLuma "ci"
BindStr "s"
ChromaUDifference "cci"
ChromaVDifference "cci"
ConditionalFilter "cccs[showx]b[args]s[local]b"
FrameEvaluate "cs[showx]b[after_frame]b[args]s[local]b"
GConditionalFilter "cccs[show]b[args]s[local]b"
GFrameEvaluate "cs[show]b[after_frame]b[args]s[local]b"
GRTConfig "[local]b"
GScriptClip "cs[show]b[after_frame]b[args]s[local]b"
GWriteFile "c[filename]ss+[append]b[flush]b[args]s[local]b"
GWriteFileIf "c[filename]ss+[append]b[flush]b[args]s[local]b"
LumaDifference "cci"
RGBDifference "cci"
RGBDifferenceFromPrevious "ci"
RGBDifferenceToNext "ci"
ScriptClip "cs[showx]b[after_frame]b[args]s[local]b"
UDifferenceFromPrevious "ci"
UDifferenceToNext "ci"
UPlaneMax "c[threshold]fi"
UPlaneMedian "ci"
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
VDifferenceFromPrevious "ci"
VDifferenceToNext "ci"
VPlaneMax "c[threshold]fi"
VPlaneMedian "ci"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
WriteFile "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
WriteFileIf "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
YDifferenceFromPrevious "ci"
YDifferenceToNext "ci"
YPlaneMax "c[threshold]fi"
YPlaneMedian "ci"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"
EDIT: BindStr "s" AND GRTConfig "[local]b", look to be Grunt() secret funcs.
EDIT:
Several of above funcs [eg UPlaneMax "c[threshold]fi"] indicate a non optional final arg i of type int,
strictly speaking, I think all parameters following any optional parameter, MUST be also optional (I think they should maybe also be named optionals),
this is true in many if not all languages with optional arguments.
Some similar functions in AVS+ had similarly erroneous non optionals [now fixed I think].
EDIT: Actually, the same AVS+ builtin functions also have non optionals following an optional one, ie [below wrong in both Grunt and AVS+]
UPlaneMax "c[threshold]fi"
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
VPlaneMax "c[threshold]fi"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
YPlaneMax "c[threshold]fi"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"
EDIT:
/* BAD trailing compulsory arg i, following an optional arg. [BAD in both AVS+ and Grunt]
UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]fi"
VPlaneMax "c[threshold]fi"
VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]fi"
YPlaneMax "c[threshold]fi"
YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]fi"ing compulsory arg
*/
#YPlaneMin "c[threshold]fi"
Blankclip(pixel_type="YV12")
SSS="""
# y=YPlaneMin(0.4,1) # OK, Threshold = 0.4, Offset = 1 ie current_frame+1
y=YPlaneMin(threshold=0.4,1) # Script Error: The named argument "threshold" was passed more than once to YPlaneMin
RT_Subtitle("%d] Y=%d",current_frame,Y)
return last
"""
ScriptClip(SSS)
StainlessS
10th October 2021, 14:00
Well finally got back to the parameter parsing function,
# ParseParamList.avs
Function ChrIsSPACE(String S) {return RT_Ord(S)==32} # SPACE
Function ChrIsDQuote(String S) {return RT_Ord(S)==34} # "
Function ChrIsOSquare(String S) {return RT_Ord(S)==91} # [
Function ChrIsCSquare(String S) {return RT_Ord(S)==93} # ]
Function ChrEatWhite(String S) {i=1 C=RT_Ord(S,i) While(C==32||C>=8&&C<=13) {i=i+1 C=RT_Ord(S,i)} return i>1?MidStr(S,i):S}
Function ChrInChars(String S,string Chars,Bool "Sig",int "Pos") { return RT_FindStr(Chars,S.MidStr(Default(Pos,1),1),Sig)>0 } # Sig default True, Pos default 1
# Return extent of string S [ie length from the beginning] that matches any character in Chars set of characters [Default case insignificant]. # StrMatchChrLen("1234.567abcd","0123456789.") = 8
Function StrMatchChrLen(String s,String Chars,Bool "Sig") {
Function __StrMatchChrLen_LOW(String s,String Chars,int n) { c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)==0) ? n : s.__StrMatchChrLen_LOW(Chars,n+1) }
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrMatchChrLen_LOW(s,Chars,0)
}
# Return extent of string S [ie length from the beginning] that DOES NOT match any character in Chars set of characters [Default case insignificant].
# # StrBrkChrLen("1234.567,abcd",",.") = 4
# If 1st character of s matches any in Chars set, then returns 0. # StrBrkChrLen("1234.567,abcd","321") = 0
# If no characters in s match any character in Chars set, then returns length of string s. # StrBrkChrLen("1234.567,abcd","NOP") = 13
Function StrBrkChrLen(String s,String Chars,Bool "Sig") {
Function __StrBrkChrLen_LOW(String s,String Chars,int n) {c=s.MidStr(n+1,1) Return(c==""||Chars.FindStr(c)!=0)?n:s.__StrBrkChrLen_LOW(Chars,n+1)}
Sig=Default(Sig,False) # Default Case Insignificant
s=(Sig)?s:s.UCASE Chars=(Sig)?Chars:Chars.UCASE
__StrBrkChrLen_LOW(s,Chars,0)
}
# Remove/Eat leading string from S that DOES NOT match any character in Chars set of characters [Default case insig]. # StrEatTillChr("12.34:567;abcd",",:;") = ":567;abcd"
# If 1st character of s matches any in Chars set, then returns original string s. # StrEatTillChr("12.34:567;abcd","321") = "12.34:567;abcd"
# If There are no characters matching Chars set, then returns empty string "". # StrEatTillChr("12.34:567;abcd","PON") = ""
Function StrEatTillChr(String s,String Chars,Bool "Sig") { Return s.MidStr(s.StrBrkChrLen(Chars,Sig)+1) }
# Match Variable OR Function name ('_' or Alpha for first character, thereafter additionaly digits, alway case Insignificant).
Function StrMatchVarName(String s) { # StrMatchVarName("_My_FuncName66><!ds") = "_My_FuncName66"
c=s.MidStr(1,1)
return (c>="0" && c<="9")?"": s.LeftStr(s.StrMatchChrLen("_ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")) # If first char is digit, then NOT Valid Variable name(force fail).
}
Function CheckFunctionNamesList(String S) {
Types = "cifsb.na"
OrMore = "*+"
ES=""
LINES = RT_TxtQueryLines(S)
for(i=0, LINES-1) {
tSRem = S.RT_TxtGetLine(Line=i)
e = ""
ts = tsRem.StrEatTillChr(" ") # ret "" if no SPACE
if(ts.ChrIsSpace) {
ts=ts.ChrEatWhite
if(ts.ChrIsDQuote) { # check/remove wrapping quotes
n = ts.Strlen
if(n>1 && ts.RightStr(1).ChrIsDQuote) { ts = ts.MidStr(2,n-2) }
else { e = "BAD QUOTE" }
}
if(e=="") {
# Compulsories
while(ts.ChrInChars(Types)) {
ts=ts.MidStr(2)
if(ts.ChrInChars(OrMore)) { ts=ts.MidStr(2) }
}
if(ts.ChrIsOSquare) {
While(ts.LeftStr(2) == "[]" && ts.ChrInChars(Types,pos=3)) { # UnNamed optionals
ts=ts.MidStr(4)
if(ts.ChrInChars(OrMore)) { ts=ts.MidStr(2) }
}
if(ts.ChrIsOSquare) { # Only named optionals from here
While(e=="" && ts.ChrIsOSquare ) { # Opening '['
ts = ts.MidStr(2)
n = ts.StrMatchVarName.StrLen
if(n > 0) {
ts=ts.MidStr(n+1)
if(ts.ChrIsCSquare) { # Closing ']'
ts=ts.MidStr(2)
if(ts.ChrInChars(Types)) {
ts=ts.MidStr(2)
if(ts.ChrInChars(OrMore)) { ts=ts.MidStr(2) }
} else { e = "MISSING TYPE" }
} else { e = "OPT_NO_CLOSING_']'" }
} else { e = "NAME_NOT_OPTIONAL" }
}
if(e=="" && ts.StrLen>0) { e = "EXPECTING '['" }
}
}
}
}
if(ts != "" || e!="") {
e = (e=="") ? "NONPARSE" : e
ES=RT_string("%s%s\n *** ERROR LINE %d: %s @ '%s'\n",ES,tSRem,i+1,e,tS)
}
}
RT_DebugF("%s",ES)
return ES
}
Import(".\GetFunctionNamesList.avs")
BlankClip(width=1024,height=900)
E=GetFunctionNamesList(false,remdup=true,PlugMode=1,Args=true,Sort=true) # Builtins
#E=GetFunctionNamesList(True,remdup=true,PlugMode=1,Args=true,Sort=true) # Plugins
#E=GetDllNamesList("Grunt",remdup=true,PlugMode=1,Args=true,Sort=true) # Dll
S=CheckFunctionNamesList(E)
RT_subtitle("%s",S)
Output on builtins [a bit strange, why do WriteFile type funcs have OPTIONAL filename]
00001839 0.68595290 RT_DebugF: Histogram "c[mode]s[].i[keepsource]b[markers]b"
00001840 0.68597490 RT_DebugF: *** ERROR LINE 221: NAME_NOT_OPTIONAL @ '].[bits]i[keepsource]b[markers]b'
00001841 0.68599439 RT_DebugF: Spline "[x]ff+[cubic]b"
00001842 0.68600678 RT_DebugF: *** ERROR LINE 400: EXPECTING '[' @ 'f+[cubic]b'
00001843 0.68606669 RT_DebugF: UPlaneMax "c[threshold]fi"
00001844 0.68608242 RT_DebugF: *** ERROR LINE 437: EXPECTING '[' @ 'i'
00001845 0.68614203 RT_DebugF: UPlaneMin "c[threshold]fi"
00001846 0.68615443 RT_DebugF: *** ERROR LINE 439: EXPECTING '[' @ 'i'
00001847 0.68621379 RT_DebugF: UPlaneMinMaxDifference "c[threshold]fi"
00001848 0.68622690 RT_DebugF: *** ERROR LINE 440: EXPECTING '[' @ 'i'
00001849 0.68628609 RT_DebugF: VPlaneMax "c[threshold]fi"
00001850 0.68629807 RT_DebugF: *** ERROR LINE 452: EXPECTING '[' @ 'i'
00001851 0.68635762 RT_DebugF: VPlaneMin "c[threshold]fi"
00001852 0.68637007 RT_DebugF: *** ERROR LINE 454: EXPECTING '[' @ 'i'
00001853 0.68642938 RT_DebugF: VPlaneMinMaxDifference "c[threshold]fi"
00001854 0.68643671 RT_DebugF: *** ERROR LINE 455: EXPECTING '[' @ 'i'
00001855 0.68649602 RT_DebugF: WriteFile "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
00001856 0.68650872 RT_DebugF: *** ERROR LINE 463: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001857 0.68656892 RT_DebugF: WriteFileEnd "c[filename]sn+[append]b[local]b"
00001858 0.68657631 RT_DebugF: *** ERROR LINE 464: EXPECTING '[' @ 'n+[append]b[local]b'
00001859 0.68663442 RT_DebugF: WriteFileIf "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
00001860 0.68664718 RT_DebugF: *** ERROR LINE 465: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001861 0.68670171 RT_DebugF: WriteFileStart "c[filename]sn+[append]b[local]b"
00001862 0.68671280 RT_DebugF: *** ERROR LINE 466: EXPECTING '[' @ 'n+[append]b[local]b'
00001863 0.68676698 RT_DebugF: YPlaneMax "c[threshold]fi"
00001864 0.68678093 RT_DebugF: *** ERROR LINE 469: EXPECTING '[' @ 'i'
00001865 0.68680388 RT_DebugF: YPlaneMin "c[threshold]fi"
00001866 0.68682200 RT_DebugF: *** ERROR LINE 471: EXPECTING '[' @ 'i'
00001867 0.68683958 RT_DebugF: YPlaneMinMaxDifference "c[threshold]fi"
00001868 0.68685728 RT_DebugF: *** ERROR LINE 472: EXPECTING '[' @ 'i'
And Plugins [just a few in Plugins dir] : NOTE, it actually found a bug in ApparentFPS params list (top line, used '[' instead of closing ']', does not seem to cause problems though)
EDIT: Actually 46 plugins auto loaded, only 2 of which cause errors (AssumeFPS, Grunt).
00001704 1.30285561 RT_DebugF: ApparentFPS "c[DupeThresh]f[FrameRate]f[Samples]i[ChromaWeight]f[Prefix]s[Show]b[Verbose]b[Debug]b[Mode]i[Matrix]i[BlkW]i[BlkH[i[oLapX]i[oLapY]i"
00001705 1.30287409 RT_DebugF: *** ERROR LINE 13: OPT_NO_CLOSING_']' @ '[i[oLapX]i[oLapY]i'
00001706 1.30294704 RT_DebugF: GWriteFile "c[filename]ss+[append]b[flush]b[args]s[local]b"
00001707 1.30303323 RT_DebugF: *** ERROR LINE 93: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001708 1.30310595 RT_DebugF: GWriteFileIf "c[filename]ss+[append]b[flush]b[args]s[local]b"
00001709 1.30319190 RT_DebugF: *** ERROR LINE 94: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001710 1.30321240 RT_DebugF: UPlaneMax "c[threshold]fi"
00001711 1.30323160 RT_DebugF: *** ERROR LINE 440: EXPECTING '[' @ 'i'
00001712 1.30325079 RT_DebugF: UPlaneMin "c[threshold]fi"
00001713 1.30326951 RT_DebugF: *** ERROR LINE 442: EXPECTING '[' @ 'i'
00001714 1.30328333 RT_DebugF: UPlaneMinMaxDifference "c[threshold]fi"
00001715 1.30335224 RT_DebugF: *** ERROR LINE 443: EXPECTING '[' @ 'i'
00001716 1.30344224 RT_DebugF: VPlaneMax "c[threshold]fi"
00001717 1.30346227 RT_DebugF: *** ERROR LINE 448: EXPECTING '[' @ 'i'
00001718 1.30348146 RT_DebugF: VPlaneMin "c[threshold]fi"
00001719 1.30350041 RT_DebugF: *** ERROR LINE 450: EXPECTING '[' @ 'i'
00001720 1.30351925 RT_DebugF: VPlaneMinMaxDifference "c[threshold]fi"
00001721 1.30353296 RT_DebugF: *** ERROR LINE 451: EXPECTING '[' @ 'i'
00001722 1.30360138 RT_DebugF: WriteFile "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
00001723 1.30368745 RT_DebugF: *** ERROR LINE 465: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001724 1.30370772 RT_DebugF: WriteFileIf "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
00001725 1.30377746 RT_DebugF: *** ERROR LINE 466: EXPECTING '[' @ 's+[append]b[flush]b[args]s[local]b'
00001726 1.30386353 RT_DebugF: YPlaneMax "c[threshold]fi"
00001727 1.30392945 RT_DebugF: *** ERROR LINE 470: EXPECTING '[' @ 'i'
00001728 1.30401099 RT_DebugF: YPlaneMin "c[threshold]fi"
00001729 1.30402970 RT_DebugF: *** ERROR LINE 472: EXPECTING '[' @ 'i'
00001730 1.30404937 RT_DebugF: YPlaneMinMaxDifference "c[threshold]fi"
00001731 1.30406749 RT_DebugF: *** ERROR LINE 473: EXPECTING '[' @ 'i'
Most of above from Grunt plugin.
EDIT: You cannot have a compulsory arg [non optional] after any optional parameter, you cannot have an un-named optional after any named optional.
EDIT: From here:- http://avisynth.nl/index.php/User_defined_script_functions
Facts about user defined script functions
Functions can take up to sixty arguments and the return value can be of any type supported by the scripting language (clip, int, float, bool, string, AVS+array).
Although not recommended practice, an argument type may be omitted, and will default to val, the generic type.
If the function expects a video clip as its first argument, and that argument is not supplied, then the clip in the special Last variable will be used.
Functions support named arguments. Simply enclose an argument's name inside double quotes to make it a named argument. [B]Note that after doing so the following apply:
All subsequent arguments in the argument list must be named also.
A named argument is an optional argument, that is, it need not be supplied by the caller.
One presumes that the rules for script functions also apply to builtin/plugin,
so after 1st named argument, all following others must also be named,
and when calling a function [script or plugin], after providing an optional name, so all following args must also be called with names.
[there seem to be a few rule breakers]
VoodooFX
11th October 2021, 09:54
Facts about user defined script functions
Functions can take up to sixty arguments and the return value can be of any type supported by the scripting language (clip, int, float, bool, string, AVS+array).
Max 60 entered at once? I counted 71 arguments in InpaintDelogo, probably QTGMC has even more.
StainlessS
11th October 2021, 11:18
I'm not sure, but seem to remember somebody [maybe even pre v2.60] saying that the 60 args limit had been made 'unlimited',
as far as dll functions concerned, I've had it up to about 256 args in a ClipClop script function.
(clipclop supports up to 256 clip args, plus a few non clip args, and I have used them ALL).
EDIT: Update for more than 60 args might have been done by tritical [or other dev active around the same time].
MysteryX
14th October 2021, 18:04
"if", while", "for", "Global", would [I think] be keywords but not functions.
Where do you find those? They're not in the Wiki, and searching for them returns nothing
http://avisynth.nl/index.php/The_full_AviSynth_grammar#Keywords
StainlessS
15th October 2021, 00:40
'Global' is in the keyword list that you linked.
As Previously stated, True/False [and also Yes/No], are Global Variables that are initialised early in Avisynth instance lifetime.
You can do something like eg Global True=!True Global False=!False to toally mess things up,
or even speed access to both by making local variables within a script fuction,
eg True=True False=False [assign local variables from globals, will no longer be able to access the Globals within that scope]
The 'if' 'while' etc keywords are inherited from GScript (in AVS+), and probably not currently documented as such.
EDIT: Here is a AVS+ specific doc, keywords not mentioned:- http://avisynth.nl/index.php/AviSynth%2B#GScript
Reel.Deel
21st October 2021, 11:43
These don't qualify as keywords but they don't show up in the internal function list.
OPT_AllowFloatAudio
OPT_UseWaveExtensible
OPT_dwChannelMask
OPT_AVIPadScanlines
OPT_VDubPlanarHack
OPT_Enable_V210
OPT_Enable_Y3_10_10
OPT_Enable_Y3_10_16
OPT_Enable_b64a
OPT_Enable_PlanarToPackedRGB
The 'if' 'while' etc keywords are inherited from GScript (in AVS+), and probably not currently documented as such.
EDIT: Here is a AVS+ specific doc, keywords not mentioned:- http://avisynth.nl/index.php/AviSynth%2B#GScript
I'll see if I can clear that up a bit, thanks for pointing it out.
StainlessS
21st October 2021, 13:10
Blankclip(pixel_type="YV12")
#IsD=Defined(OPT_AllowFloatAudio) # "I dont know what OPT_AllowFloatAudio is"
IsE=VarExist("OPT_AllowFloatAudio")
subtitle(string(isE)) # shows FALSE
Those [EDIT: Global] variables [I only tried "OPT_AllowFloatAudio"] only exist if user set. [wiki says default = False].
EDIT: There dont seem to be a single [good] English word meaning opposite of exist,
Nonexistence synonyms:- https://thesaurus.yourdictionary.com/nonexistence
nonbeing ::: (Countable) That which is not a being; a potential entity that does not exist.
non-being ::: (related)
non-existence ::: (related)
nothingness ::: State of nonexistence
oblivion (related)
nihility ::: Nothingness, nullity.
nothing
maybe "nihility" is closest, but I aint ever heard of it. [or maybe nothing better]
Perhaps a simple "Optional Flag Variable, where only exists if User Set, otherwise default if unspecified is same as FALSE." might suffice as description.
Perhaps Wonkey can give better description, he's very "flowery" with words.
johnmeyer
21st October 2021, 16:22
EDIT: There dont seem to be a single [good] English word meaning opposite of exist,
Nonexistence synonyms:- https://thesaurus.yourdictionary.com/nonexistence
nonbeing ::: (Countable) That which is not a being; a potential entity that does not exist.
non-being ::: (related)
non-existence ::: (related)
nothingness ::: State of nonexistence
oblivion (related)
nihility ::: Nothingness, nullity.
nothing
maybe "nihility" is closest, but I aint ever heard of it. [or maybe nothing better]Dead.
StainlessS
22nd October 2021, 05:23
"Dead", Implies that it once existed :)
EDIT: WRONG -That it exists and was once alive.
johnmeyer
22nd October 2021, 16:18
Perhaps you should research existentialism. It studies what it means to "exist."
VoodooFX
22nd October 2021, 22:59
The 'if' 'while' etc keywords are inherited from GScript (in AVS+), and probably not currently documented as such.
Oh that's why "if() {} else if() {} else {}" worked... I thought that it's some undocumented avs+ feature. :D
StainlessS
23rd October 2021, 14:27
VX,
In a plugins script loader type avsi that loads scripts from some other folder, where any loaded GScript() type script function scripts have had all
GScript("""
# ...
""")
type wrapper stuff removed, can use
for Avs 2.60 std, with Gscript Plugin,
GImport("some_gscript_avs_script_with_Gscript_wrappers_removed.avs") # GImport(), equivalent to RT_ReadTxtFromfile("...").GEval()
for avs+
Import("some_gscript_avs_script_with_Gscript_wrappers_removed.avs") # Import() equivalent to RT_ReadTxtFromfile("...").Eval()
I thought that it's some undocumented avs+ feature.
Yip, currently undocc'ed.
by JM,
Perhaps you should research existentialism
Wot, that namby pamby nonsense.
I was, therefore I once is. [or is that some other twaddle]
EDIT:
Existentialists believe that we're born without purpose into a world that makes no sense
Sounds about right [we are little more than microbes in the soup] :)
EDIT: RaffRiff42 would like the below: https://i.postimg.cc/TYKRbNbB/HHGTTG-Douglas-adams-crop70x70.png (https://postimages.org/)
1. There is a theory which states that if ever anyone discovers exactly what the Universe is for and why it is here,
it will instantly disappear and be replaced by something even more bizarre and inexplicable.
There is another theory which states that this has already happened.
2. It is known that there are an infinite number of worlds, simply because there is an infinite amount of space for them to be in.
However, not every one of them is inhabited. Therefore, there must be a finite number of inhabited worlds.
Any finite number divided by infinity is as near to nothing as makes no odds, so the average population of all the planets in the Universe
can be said to be zero.
From this it follows that the population of the whole Universe is also zero,
and that any people you may meet from time to time are merely the products of a deranged imagination.
3. “Space,” it says, “is big. Really big. You just won’t believe how vastly, hugely, mindbogglingly big it is.
I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to space.”
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.