Log in

View Full Version : Avisynth+


Pages : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 [93] 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

tuanden0
23rd March 2019, 13:47
New version of AVS+ (2772 and older) got glitch with FFMS2 when using to encode audio.

I tried to use AVS+ to cut some scenes of video and audio to watch on my smartphone.
After encode, video is OK but audio got some "noise".

But when I tried to use "LWLibavAudioSource" instead of "FFAudioSource", It's OK.
I used FFMS2 from here: https://forum.doom9.org/showthread.php?p=1866411#post1866411
Here's my simple script:
c=FFVideoSource("E:\Download\Source\Maria Ozawa Collection Vol-02.mkv",colorspace="YV12")
c=AssumeFPS(c, 24000, 1001)
a=FFAudioSource("E:\Download\Source\Maria Ozawa Collection Vol-02.mkv")
a=AssumeFPS(a, 24000, 1001)
AudioDub(c,a)
Trim(0,718) + Trim(2872,31877) + Trim(34036,0)

wonkey_monkey
23rd March 2019, 14:17
There is nothing wrong with copying PClips. In the above example, is tmp unused deliberately?

Yes, even if I make not further reference to tmp the problem manifests. If I comment out that line, no problem. If child and child2 are different clips, no problem. The problem is that I don't get the expected pixels (checking the pixels of tmp->GetReadPtr() and src->GetReadPtr() gives different results).

MT mode is not used. I'll try to whittle it down to a more minimal example, as currently I'm only seeing it happen with a combination of two filters.

StainlessS
23rd March 2019, 14:53
@Wonkey
Frame Accurate source ? (although I guess frame should be cached anyways).

EDIT:
Maybe as debug assist, double frame height in constructor (vi.height), and return both frames stacked, maybe try ColorBars.ShowFrameNumber as source.

wonkey_monkey
23rd March 2019, 17:53
Ahhh, I think I've been an idiot. It didn't occur to me that, because my first filter is incomplete, it's not being entirely deterministic (only the first few columns are being written). And then it further didn't occur to me that when I call GetFrame on it twice, it is actually getting the frame twice, and not caching or anything - on the first GetFrame it's coming back with one set of garbage data and on the second GetFrame it's coming back with different garbage data. That was the discrepancy I was seeing with the second filter.

So the first filter is faulty (due to being a work in progress) but the second filter could also be a bit smarter.

gaak
1st April 2019, 00:04
My apologies in advance if this is the wrong thread to make such a request, but can someone supply a 0.7 64 bit version of Variableblur to replace the 0.5 version out there now? Thanks.

StainlessS
1st April 2019, 00:36
I was gonna have a go at compile but requires VS2010 as per below

** As of version 0.6 the Visual Studio 2010 Service Pack 1 redistributable is required due to OpenMP multithreading.

v0.7 Zip @ SendSpace below this post in my sig, 32 bit only + source (for anybody wants to compile).

The 64 bit zip (via Wiki) on Archive.org seem not to be available.

EDIT: The source has Assembler in it, so dont know if compilable for x64 on VS2010.

Reel.Deel
1st April 2019, 01:05
The 64 bit zip (via Wiki) on Archive.org seem not to be available.


Some guy (Yakub2.X see here (http://avisynth.nl/index.php?title=AviSynth%2B_x64_plugins&action=history)) messed up a handful of the links on the avs+ 64-bit plugin page, I have not had time to go over and find and correct those mistakes. :mad:

Correct link is here:
http://avisynth.nl/index.php/VariableBlur#Archived_Downloads

StainlessS
1st April 2019, 02:03
OK thanx RD, but v0.7 seems not available anywhere(wiki or d9, or archive.org) , so maybe somebody could do compile of SendSpace in my sig zip
(the v0.5 x64 source also has Assembler, so I presume that it is actually compilable in VS2010).

EDIT: I spent some time searching web but could not find v0.7 x64, dll or source.

Reel.Deel
1st April 2019, 06:01
OK thanx RD, but v0.7 seems not available anywhere(wiki or d9, or archive.org).

Download link in the abstract box from wiki (http://avisynth.nl/index.php/VariableBlur) works for me, also mirror link in the archived downloads section works :confused:.


EDIT: I spent some time searching web but could not find v0.7 x64, dll or source.

There is none, v0.5 is the only x64 version available :(.

wonkey_monkey
2nd April 2019, 14:55
Sorry if this is yet another inane and obvious question, but is there a recommended/simple way to change video clip properties/colourspace/subsampling? Like if I get an 8-bit clip, but I want my filter to output a 16-bit or float clip while keeping all other properties the same (or doing something else like changing subsampling to 444, whatever the input is), is there a simple operation that will do this, and work for all inputs, including interleaved and planar RGB? Or are there always caveats?

ChaosKing
2nd April 2019, 15:04
http://avisynth.nl/index.php/AviSynth%2B
http://avisynth.nl/index.php/Convert

Easiest way to convert to 16bit is ConvertBits(16). But not all filters support filtering in 16bit.

wonkey_monkey
2nd April 2019, 15:29
I meant in filter development terms. Do I just have to monkey around with vi.pixel_type? I'm guessing so but I can't any proper documentation on it.

pinterf
3rd April 2019, 08:20
I meant in filter development terms. Do I just have to monkey around with vi.pixel_type? I'm guessing so but I can't any proper documentation on it.
Yes, monkeying around is a probably a proper definition. In Avisynth.h you can see some masks, look for words "GENERIC" or e.g. CS_Sample_Bits_Mask.
Example for bit depth change (https://github.com/pinterf/AviSynthPlus/blob/MT/avs_core/convert/convert.cpp#L3118)

LigH
3rd April 2019, 14:57
Enabling MT together with returning a clip explicitly does not work as expected.

I created a test script for a more elaborate filtering, producing different alternative clips, and I let it return one of these clips to be able to switch quickly between different versions. The AviSynth Wiki – AviSynth+: Enabling MT (http://avisynth.nl/index.php/AviSynth%2B#Enabling_MT) tells:

... You enable MT by placing a single call to Prefetch(X) at the end of your script, where X is the number of threads to use. If there is a return statement in your script it must be placed after Prefetch().

This explanation suggests that Prefetch() is somewhat independent of the clip assignment workflow. So I tried. But instead, I get a confusing error message about invalid arguments for Prefetch(). To condense the issue, I tested it with the following script:

c = ColorBarsHD(1280, 720, "YV24").KillAudio().AssumeFPS(25, 1).Trim(0, 249)
return c

Works well. Now with a Prefetch before the return:

c = ColorBarsHD(1280, 720, "YV24").KillAudio().AssumeFPS(25, 1).Trim(0, 249)
Prefetch(4)
return c

Script error: Invalid arguments to function 'Prefetch'.
(...\PrefetchTest.avs, line 2)

Did I misunderstand? Is Prefetch() a clip filter just like most functions in AviSynth+? I will probably have to use the workaround to implicitly assign the clip to last, instead of returning it explicitly:

c = ColorBarsHD(1280, 720, "YV24").KillAudio().AssumeFPS(25, 1).Trim(0, 249)
c
Prefetch(4)

Or in a completely different way, concatenated with the dot:

c = ColorBarsHD(1280, 720, "YV24").KillAudio().AssumeFPS(25, 1).Trim(0, 249)
return c.Prefetch(4)

Yes, both work well. So better assume that Prefetch() is related to the context of the active filter chain.

Groucho2004
3rd April 2019, 15:07
Is Prefetch() a clip filter just like most functions in AviSynth+?Yes it is. Ferenc will correct me if I'm wrong. :)

LigH
3rd April 2019, 15:12
Then I would vote for explaining that a bit better in the Wiki. IMHO, the current explanation is too ambiguous.

StainlessS
3rd April 2019, 17:27
ProtoType extracted by RT_Stats Make_Avisynth_BuiltIn_FunctionList.avs

AviSynth+_0.1_(r2772,_MT,_i386)_ORDERED_Function_List.txt

AviSynth+_0.1_(r2772,_MT,_i386)_ORDERED_Function_List


There follows a list of all function names together with CPP style argument specifiers that inform
Avisynth the 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
###################################

Prefetch "c[threads]i"

There may be more than one prototype, only one is exposed and extractable (sadly).

LigH
3rd April 2019, 18:33
This explains the error when called without a reference clip. In my examples, "last" was never assigned.

Gavino
3rd April 2019, 23:44
What if the Prefetch call is followed by a return, but 'last' has been assigned somewhere earlier?
ColorBarsHD(1280, 720, "YV24") # 'last' assigned here
c = KillAudio().AssumeFPS(25, 1).Trim(0, 249)
Prefetch(4)
return c
This won't give an error, but I suspect Prefetch won't work properly (or at all) since it is not in the final filter chain - its result is not used.

Does it ever make sense to follow Prefetch() by a return statement?

Perhaps instead of
Prefetch(4)
return x

you always need to write
return x.Prefetch(4)

StainlessS
4th April 2019, 00:06
Yo big G, thats a long walkabout that you're on, come back when you've found youself, yeh.

you always need to write
return x.Prefetch(4)

Not a bad idea.

Here Differences between Avisynth NEO and Avisynth+ (current versions).
Seems that we are detecting multiple prototypes for builtins, but not detecting proper separate parameter strings for each, but still handy non the less.

No idea what NEO 'n' type specifiers are [perhaps array index or something].

There follows a list of all function names together with CPP style argument specifiers that inform
Avisynth the 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
###################################

Differences between Avisynth NEO and Avisynth+
##############################################


AviSynth_Neo_0.1_(r2822,_Neo,_i386)_ORDERED_Function_List AviSynth+_0.1_(r2772,_MT,_i386)_ORDERED_Function_List


AddProp "csn"
AlignedSplice "cci" AlignedSplice "cc+"
AlignedSplice "cci"


AverageChromaU "c[offset]i" AverageChromaU "ci"
AverageChromaV "c[offset]i" AverageChromaV "ci"

AverageLuma "c[offset]i" AverageLuma "ci"

AVIFileSource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]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" AVISource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"

ChromaUDifference "cc" ChromaUDifference "cci"
ChromaVDifference "cc" ChromaVDifference "cci"

ConditionalFilter "cccn[show]b" ConditionalFilter "cccs[showx]b[args]s[local]b"
ConditionalFilter "cccn[show]b" ConditionalFilter "cccs[showx]b[args]s[local]b"
ConditionalFilter "cccn[show]b"

ConditionalSelect "cnc+[show]b" ConditionalSelect "csc+[show]b"
ConditionalSelect "cnc+[show]b"

DumpFilterGraph "c[outfile]s[mode]i[nframes]i[repeat]b"

FrameEvaluate "cs[show]b[after_frame]b" FrameEvaluate "cs[showx]b[after_frame]b[args]s[local]b"

Func "n"

GeneralConvolution "c[bias]i[matrix]s[divisor]f[auto]b" GeneralConvolution "c[bias]f[matrix]s[divisor]f[auto]b[luma]b[chroma]b[alpha]b"

GetProp "cs[offset]i"

IsFunction "."

LumaDifference "cc" LumaDifference "cci"

OnCPU "n"
OnCPU "n"
OnCUDA "n[device_index]i"
OnCUDA "n[device_index]i"
OpenDMLSource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i" OpenDMLSource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"

Prefetch "c[threads]i[frames]i" Prefetch "c[threads]i"

RGBDifference "cc" RGBDifference "cci"
RGBDifferenceFromPrevious "c" RGBDifferenceFromPrevious "ci"
RGBDifferenceToNext "c[offset]i" RGBDifferenceToNext "ci"

ScriptClip "cn[show]b[after_frame]b" ScriptClip "cs[showx]b[after_frame]b[args]s[local]b"
ScriptClip "cn[show]b[after_frame]b"

SegmentedAVISource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i" SegmentedAVISource "s+[audio]b[pixel_type]s[fourCC]s[vtrack]i[atrack]i[utf8]b"

SetCacheMode "[mode]i"
SetDeviceOpt "[opt]i[val]i"

SetGraphAnalysis "b"

SetMemoryMax "[]i[type]i[index]i" SetMemoryMax "[]i"

TypeName "."

UDifferenceFromPrevious "c" UDifferenceFromPrevious "ci"
UDifferenceToNext "c[offset]i" UDifferenceToNext "ci"
UnalignedSplice "cci" UnalignedSplice "cc+"
UnalignedSplice "cci"

UPlaneMax "c[threshold]f[offset]i" UPlaneMax "c[threshold]fi"
UPlaneMedian "c[offset]i" UPlaneMedian "ci"
UPlaneMin "c[threshold]f[offset]i" UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]f[offset]i" UPlaneMinMaxDifference "c[threshold]fi"
UseVar "cs+"

VDifferenceFromPrevious "c" VDifferenceFromPrevious "ci"
VDifferenceToNext "c[offset]i" VDifferenceToNext "ci"

VPlaneMax "c[threshold]f[offset]i" VPlaneMax "c[threshold]fi"
VPlaneMedian "c[offset]i" VPlaneMedian "ci"
VPlaneMin "c[threshold]f[offset]i" VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]f[offset]i" VPlaneMinMaxDifference "c[threshold]fi"

WAVSource "s+" WAVSource "s+[utf8]b"

WriteFile "c[filename]sn+[append]b[flush]b" WriteFile "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
WriteFile "c[filename]sn+[append]b[flush]b"

WriteFileEnd "c[filename]sn+[append]b" WriteFileEnd "c[filename]ss+[append]b"
WriteFileEnd "c[filename]sn+[append]b"
WriteFileIf "c[filename]sn+[append]b[flush]b" WriteFileIf "c[filenamex]ss+[append]b[flush]b[args]s[local]b"
WriteFileIf "c[filename]sn+[append]b[flush]b"
WriteFileStart "c[filename]sn+[append]b" WriteFileStart "c[filename]ss+[append]b"
WriteFileStart "c[filename]sn+[append]b"
YDifferenceFromPrevious "c" YDifferenceFromPrevious "ci"
YDifferenceToNext "c[offset]i" YDifferenceToNext "ci"
YPlaneMax "c[threshold]f[offset]i" YPlaneMax "c[threshold]fi"
YPlaneMedian "c[offset]i" YPlaneMedian "ci"
YPlaneMin "c[threshold]f[offset]i" YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]f[offset]i" YPlaneMinMaxDifference "c[threshold]fi"


Here, RT_Stats scripts for making function lists, with a few mods done today for Avs NEO(~56KB):- http://www.mediafire.com/file/mdtte1sll6yz4nf/RT_Stats_FunctionLists.zip/file
Also contains complete function lists for these versions of avisynth.

# AviSynth v2.58
AviSynth 2.58, build:Dec 22 2008 [08:46:51]

# AviSynth v2.60
AviSynth 2.60, build:Mar 31 2015 [16:38:54]

# AviSynth v2.61 Alpha
AviSynth 2.61, build:May 17 2016 [16:06:18] VC2008Exp

# Avisynth v2.60 ICL
AviSynth 2.60 (ICL10)

# Avisynth V2.60 MT
AviSynth 2.60, build:Feb 20 2015 [03:16:45]

# Avisynth+ v2.60
AviSynth+ 0.1 (r2772, MT, i386)
AviSynth+ 0.1 (r2772, MT, x86_64)

# Avisynth NEO
AviSynth Neo 0.1 (r2822, Neo, i386)
AviSynth Neo 0.1 (r2822, Neo, x86_64)

# Avisynth NEO Forerunner Avisynth+ CUDA
AviSynth+ 0.1 (r2533, CUDA, i386)
AviSynth+ 0.1 (r2533, CUDA, x86_64)

x86/x64 function lists for same version avs should be identical, I think [EDIT: Yes, except for the embedded name, are identical].

EDIT: Perhaps 'n' is name, ie function name, variable name, device name.

pinterf
4th April 2019, 07:37
EDIT: Perhaps 'n' is name, ie function name, variable name, device name.
'n' is for functioN

StainlessS
4th April 2019, 09:14
'n' is for functioN
Thanx.

Last one on list,

YPlaneMinMaxDifference "c[threshold]fi"

Un-named optional final arg of type int ?

Whereas NEO

YPlaneMinMaxDifference "c[threshold]f[offset]i"


EDIT: After ANY optional arg, so all following args have to be optional (standard amongst many languages) and I think that is enforced by Avisynth
even though 'i' type arg is neither specified as named optional, nor un-named optional, '[offset]i' or '[]i', however, how does it magically know that the arg name should be accepted as 'offset', when is not specified.
(I think some clever magic spell is being cast, but maybe should comply with standard prototype spec stuff, or some things will not work proper [eg AvsPMod]).
Avisynth+ may know what clever magic is involved, but as AVS exports function names in "$InternalFunctions$" (and "$PluginFunctions$"), and parameters via "$Plugin!" and "!Param$",
so would be best if software that interrogates those infos, get the un-magic'ed versions.

EDIT: From Wiki:- http://avisynth.nl/index.php/Internal_functions#Runtime_functions

Color plane median, min, max, range

YPlaneMedian(clip [, int offset = 0])
UPlaneMedian(clip [, int offset = 0])
VPlaneMedian(clip [, int offset = 0])
BPlaneMedian(clip [, int offset = 0]) AVS+
GPlaneMedian(clip [, int offset = 0]) AVS+
RPlaneMedian(clip [, int offset = 0]) AVS+

YPlaneMin(clip [, float threshold = 0, int offset = 0])
UPlaneMin(clip [, float threshold = 0, int offset = 0])
VPlaneMin(clip [, float threshold = 0, int offset = 0])
BPlaneMin(clip [, float threshold = 0, int offset = 0]) AVS+
GPlaneMin(clip [, float threshold = 0, int offset = 0]) AVS+
RPlaneMin(clip [, float threshold = 0, int offset = 0]) AVS+

YPlaneMax(clip [, float threshold = 0, int offset = 0])
UPlaneMax(clip [, float threshold = 0, int offset = 0])
VPlaneMax(clip [, float threshold = 0, int offset = 0])
BPlaneMax(clip [, float threshold = 0, int offset = 0]) AVS+
GPlaneMax(clip [, float threshold = 0, int offset = 0]) AVS+
RPlaneMax(clip [, float threshold = 0, int offset = 0]) AVS+

YPlaneMinMaxDifference(clip [, float threshold, int offset = 0])
UPlaneMinMaxDifference(clip [, float threshold, int offset = 0])
VPlaneMinMaxDifference(clip [, float threshold, int offset = 0])
BPlaneMinMaxDifference(clip [, float threshold, int offset = 0]) AVS+
GPlaneMinMaxDifference(clip [, float threshold, int offset = 0]) AVS+
RPlaneMinMaxDifference(clip [, float threshold, int offset = 0]) AVS+

pinterf
4th April 2019, 11:08
Thanx.

Last one on list,

YPlaneMinMaxDifference "c[threshold]fi"

Un-named optional final arg of type int ?

Whereas NEO

YPlaneMinMaxDifference "c[threshold]f[offset]i"



Avisynth+ is also OK.
Avisynth+:
{ "YPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_Y },
{ "UPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_U }, // AVS+! was before: missing offset parameter
{ "VPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_V }, // AVS+! was before: missing offset parameter
{ "RPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_R },
{ "GPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_G },
{ "BPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_B },

StainlessS
4th April 2019, 13:26
Not sure that I'm understanding properley, think that you are saying that it works ok.


PLG="YPlaneMinMaxDifference"
PARAM=RT_PluginParam(PLG)
RT_Debugf("PLUG=%s PARAM=%s",PLG,PARAM)
return MessageClip("DONE")


result ( '[offset]' missing )

00000011 13:16:13.462 [2900] RT_DebugF: PLUG=YPlaneMinMaxDifference PARAM=c[threshold]fi


{ "YPlaneMinMaxDifference", BUILTIN_FUNC_PREFIX, "c[threshold]f[offset]i", MinMaxPlane::Create_minmax, (void *)PLANAR_Y },
"[offset]" has gone AWOL.

Source to RT_PluginParam [ env->AddFunction("RT_PluginParam", "s",RT_PluginParam, 0); ]

AVSValue __cdecl RT_PluginParam(AVSValue args, void* user_data, IScriptEnvironment* env) {
char * myName="RT_PluginParam: ";
const char *s=args[0].AsString();
int len = int(strlen(s));
char *bf = new char[len + 16];
if(bf==NULL) env->ThrowError("%sCannot allocate memory",myName);
strcpy(bf,"$Plugin!");
strcat(bf,s);
strcat(bf,"!Param$");
char *ps;
try {
AVSValue var = env->GetVar(bf);
if(!var.IsString()) {
delete [] bf;
env->ThrowError("%s Var '$Plugin!%s!Param$' is not a string",myName,s);
}
delete [] bf;
ps = (char*)var.AsString();
} catch (IScriptEnvironment::NotFound) {
ps="";
}
return env->SaveString(ps);
}


Also, is there a way to extract all alterative parameter lists for a plugin name ? [there did not used to be for avs standard).

pinterf
4th April 2019, 13:56
When there are too many data, e.g. output is fast, OutputDebugString can lose characters.

Groucho2004
4th April 2019, 14:01
When there are too many data, e.g. output is fast, OutputDebugString can lose characters.
That's nasty.

StainlessS
4th April 2019, 14:17
When there are too many data, e.g. output is fast, OutputDebugString can lose characters.

Cannot possibly be the cause, the RT_Stats function list extractors do not use OutputDebugString at all, same problem.
I've never seen swallowed output in OutputDebugString (and I've often sent biggish text files to OutputDebugString for capture and checking)

function list extractors do not use OutputDebugString at all
At least not for extraction or processing or writing to file. [there is a problem somewhere]

EDIT: There are many others with exact same symptoms in the functionlist comparitor prev posted, YPlaneMinMaxDifference just happened to be the easiest to locate, being the last one in list.
From first few

Differences between Avisynth NEO and Avisynth+
##############################################


AviSynth_Neo_0.1_(r2822,_Neo,_i386)_ORDERED_Function_List AviSynth+_0.1_(r2772,_MT,_i386)_ORDERED_Function_List


AddProp "csn"
AlignedSplice "cci" AlignedSplice "cc+"
AlignedSplice "cci"


AverageChromaU "c[offset]i" AverageChromaU "ci"
AverageChromaV "c[offset]i" AverageChromaV "ci"

AverageLuma "c[offset]i" AverageLuma "ci"


Actually, It ALWAYS seems to happen with "[offset]i", every single one of them (and there are quite a few).

EDIT:
Wiki, seems to be missing offset args

LumaDifference(clip1, clip2)
ChromaUDifference(clip1, clip2)
ChromaVDifference(clip1, clip2)
RGBDifference(clip1, clip2)

BDifference(clip1, clip2) AVS+
GDifference(clip1, clip2) AVS+
RDifference(clip1, clip2) AVS+
BDifferenceFromPrevious(clip) AVS+
GDifferenceFromPrevious(clip) AVS+
RDifferenceFromPrevious(clip) AVS+

YDifferenceFromPrevious(clip)
UDifferenceFromPrevious(clip)
VDifferenceFromPrevious(clip)
RGBDifferenceFromPrevious(clip)



Swallowed optional offset names [RHS text column, hope I got them all].

ChromaUDifference "cc" ChromaUDifference "cci"
ChromaVDifference "cc" ChromaVDifference "cci"

LumaDifference "cc" LumaDifference "cci"

RGBDifference "cc" RGBDifference "cci"
RGBDifferenceFromPrevious "c" RGBDifferenceFromPrevious "ci"
RGBDifferenceToNext "c[offset]i" RGBDifferenceToNext "ci"

UDifferenceFromPrevious "c" UDifferenceFromPrevious "ci"
UDifferenceToNext "c[offset]i" UDifferenceToNext "ci"
UPlaneMax "c[threshold]f[offset]i" UPlaneMax "c[threshold]fi"
UPlaneMedian "c[offset]i" UPlaneMedian "ci"
UPlaneMin "c[threshold]f[offset]i" UPlaneMin "c[threshold]fi"
UPlaneMinMaxDifference "c[threshold]f[offset]i" UPlaneMinMaxDifference "c[threshold]fi"

VDifferenceFromPrevious "c" VDifferenceFromPrevious "ci"
VDifferenceToNext "c[offset]i" VDifferenceToNext "ci"
VPlaneMax "c[threshold]f[offset]i" VPlaneMax "c[threshold]fi"
VPlaneMedian "c[offset]i" VPlaneMedian "ci"
VPlaneMin "c[threshold]f[offset]i" VPlaneMin "c[threshold]fi"
VPlaneMinMaxDifference "c[threshold]f[offset]i" VPlaneMinMaxDifference "c[threshold]fi"

YDifferenceFromPrevious "c" YDifferenceFromPrevious "ci"
YDifferenceToNext "c[offset]i" YDifferenceToNext "ci"
YPlaneMax "c[threshold]f[offset]i" YPlaneMax "c[threshold]fi"
YPlaneMedian "c[offset]i" YPlaneMedian "ci"
YPlaneMin "c[threshold]f[offset]i" YPlaneMin "c[threshold]fi"
YPlaneMinMaxDifference "c[threshold]f[offset]i" YPlaneMinMaxDifference "c[threshold]fi"

pinterf
4th April 2019, 14:31
That's nasty.
Probably the output is O.K., I experienced the missing lines in the viewer (DebugView)

StainlessS
4th April 2019, 15:07
Maybe old DebugView, update.

DebugView v4.81(Published: December 4, 2012):- https://docs.microsoft.com/en-us/sysinternals/downloads/debugview

[Maybe you use Kernel mode a lot, I dont]

EDIT: I switch off option WIN32 PIDS, and always Force Carriage Returns [If you dont, some text disappears off RHS when not sending '\n' at end of lines].

wonkey_monkey
4th April 2019, 15:47
I use DebugView too and have never had any problem with missing lines.

Clear-output string: When DebugView sees the special debug output string "DBGVIEWCLEAR" it clears the output.

Holy cow that's going to save me a lot of trouble.

StainlessS
4th April 2019, 16:34
Holy cow that's going to save me a lot of trouble.

I've never seen that before, making a note of it.

I used to use a Sinclair QL via RS232 for showing debug stuff (used to just switch on/plug in and auto started showing any debug stuff on 9" green screen), I kinda forgot bout that when I gave to charity shop 2 QL's
+ £1000's of softwares, next day I thought, what the hell do I do for debugging now. Maybe I set up debugview for same type output on laptop or 10" tablet laptoppy thingy.
I got a USB to Ethernet whatsit, but wonder if USB alone could be persuaded to work.
EDIT: I also used to view Debug stuff on 2nd monitor, but have not had dual display for a few years now, guess we needs one.

StainlessS
5th April 2019, 02:32
Seems to be a pretty serious bug in avisynth NEO, Main avs level local variables not visible inside Scriptclip.
Works fine even in Avs v2.58, Fails in AVS NEO < "I dont know what S Means. ([Scriptclip] Line 1)" >

S=RT_TxtAddStr(S,S2) # Some String
W=1280 H=640 LINES=RT_TxtQueryLines(S)
L= LINES*20 + H + 100
RT_Debug(S)
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",S,x=10,y=height+100-current_frame,expx=true,expy=true)""")


Fixes in Avs NEO

S=RT_TxtAddStr(S,S2) # Some String
W=1280 H=640 LINES=RT_TxtQueryLines(S)
L= LINES*20 + H + 100
RT_Debug(S)
Global GLB_S=S
BlankClip(Width=W,Height=H,Length=L).ScriptClip("""RT_Subtitle("%s",GLB_S,x=10,y=height+100-current_frame,expx=true,expy=true)""")


The Fix was already incorporated into the zip of FunctionLists/FunctionList_creator_scripts previously posted.

Perhaps we need a NEO thread.
Could probably be fixed using Grunt style ScriptClip(args="S") instead of Global.

EDIT: Alternative script OK in v2.58, but error in NEO [EDIT: Thanx Grouchy, its a breeze to switch avs back and forth now with Universal Avisynth Installer (https://forum.doom9.org/showthread.php?t=172124) ]

S="HELLO"
BlankClip.ScriptClip("""Subtitle(S)""")

Maybe some GitHub guy could post in Neo whotsit.

EDIT: To post #4629
Maybe old DebugView, update.

DebugView v4.81(Published: December 4, 2012):- https://docs.microsoft.com/en-us/sysinternals/downloads/debugview

[Maybe you use Kernel mode a lot, I dont]

EDIT: I switch off option WIN32 PIDS, and always Force Carriage Returns [If you dont, some text disappears off RHS when not sending '\n' at end of lines].

EDIT: Above in BLUE why I now always use the below with auto add NewLine (rather than OutputDebugString directly).

int __cdecl dprintf(char* fmt, ...) {
char printString[2048]="Shuffle: "; // Must be nul Termed, eg "Test: " or ""
char *p=printString;
for(;*p++;);
--p; // @ null term
va_list argp;
va_start(argp, fmt);
vsprintf(p, fmt, argp);
va_end(argp);
for(;*p++;);
--p; // @ null term
if(printString == p || p[-1] != '\n') {
p[0]='\n'; // append n/l if not there already
p[1]='\0';
}
OutputDebugString(printString);
return int(p-printString); // strlen printString
}

Stereodude
5th April 2019, 18:59
Is it not possible to use two instances of the same filter that each use conditional reader in AVIsynth+ with unique conditional arguments for each?

This does not give the results I would expect.
LoadPlugin("C:\HDTV Tools\DGMPGDec\DGDecode-x86.dll")

MPEG2Source("YMMB_2.d2v", idct=5, moderate_h=40, moderate_v=40, cpu2="oooooo")

ConvertBits(16)

ColorYUV(conditional=true, levels="TV", analyze=false)
ConditionalReader("offu_t.txt", "coloryuv_off_u", false)
ConditionalReader("offv_t.txt", "coloryuv_off_v", false)

#some processing here

ColorYUV(conditional=true, levels="TV", analyze=false)
ConditionalReader("off_y.txt", "coloryuv_off_y", false)
ConditionalReader("gain_y.txt", "coloryuv_gain_y", false)

ConvertBits(8, dither = 1)

The output is the same as this:
LoadPlugin("C:\HDTV Tools\DGMPGDec\DGDecode-x86.dll")

MPEG2Source("YMMB_2.d2v", idct=5, moderate_h=40, moderate_v=40, cpu2="oooooo")

ConvertBits(16)

ColorYUV(conditional=true, levels="TV", analyze=false)
ConditionalReader("offu_t.txt", "coloryuv_off_u", false)
ConditionalReader("offv_t.txt", "coloryuv_off_v", false)
ConditionalReader("off_y.txt", "coloryuv_off_y", false)
ConditionalReader("gain_y.txt", "coloryuv_gain_y", false)

#some processing here

ColorYUV(conditional=true, levels="TV", analyze=false)
ConditionalReader("offu_t.txt", "coloryuv_off_u", false)
ConditionalReader("offv_t.txt", "coloryuv_off_v", false)
ConditionalReader("off_y.txt", "coloryuv_off_y", false)
ConditionalReader("gain_y.txt", "coloryuv_gain_y", false)

ConvertBits(8, dither = 1)
It seems that all 4 ConditionalReader arguments in the script are seen by each of the ColorYUV instances. Is there some way to prevent each instance of the ColorYUV filter from seeing all 4 conditional reader arguments?

TheFluff
6th April 2019, 00:37
Is that your actual script? To me it looks like you're reading the same files in both instances.

Stereodude
6th April 2019, 00:57
Is that your actual script? To me it looks like you're reading the same files in both instances.
That's a simplified version of the actual script that shows the issue without having a pile of extra stuff in it. The actual script has other filters in between the two ColorYUV instances. Hence the #some processing here line.

I'm not sure what you're trying to say about the same files. Those two scripts have the exact same output. I'm asking if that's intentional. If so, can we have some sort of additional feature to segregate conditional reader statements in Avisynth+. Like a line that will be parsed by Avisynth+ and prevent all 4 ConditionalReader lines from being seen by both instances of the ColorYUV filter. Something that will cause conditional reader statements above the line to not be seen by filters below the line and vice versa.

wonkey_monkey
7th April 2019, 13:25
I have a filter which takes an array of floats as one of its arguments. It's instantiated like this:

AVSValue __cdecl Create_pyramid_mul(AVSValue args, void* user_data, IScriptEnvironment* env) {
return new pyramid_mul(
args[0].AsClip(),
args[1],
args[2].AsBool(false),
env
);
}

I want to create another function which only takes a single float argument, and constructs the array itself before calling the same constructor (below is just some test code which doesn't use the parameter):

AVSValue __cdecl Create_pyramid_blur(AVSValue args, void* user_data, IScriptEnvironment* env) {
AVSValue multipliers[3] = { 0, 0, 1 };

return new pyramid_mul(
args[0].AsClip(),
AVSValue(multipliers, 3),
false,
env
);
}

But for some reason this doesn't work. Instead of receiving an array (0,0,1), the values the filter finds in the array are either 0, QNAN, or some random very large number.

Clearly my understanding of AVSValue objects and arrays is lacking. Can someone tell me the right way to do this?

---

Edit: is it because the AVSValue I'm sending to the filter - which I use in every GetFrame - is a pointer which becomes invalid after the constructor is called and the instantiator ends?

TheFluff
7th April 2019, 16:13
That's a simplified version of the actual script that shows the issue without having a pile of extra stuff in it. The actual script has other filters in between the two ColorYUV instances. Hence the #some processing here line.

I'm not sure what you're trying to say about the same files. Those two scripts have the exact same output. I'm asking if that's intentional. If so, can we have some sort of additional feature to segregate conditional reader statements in Avisynth+. Like a line that will be parsed by Avisynth+ and prevent all 4 ConditionalReader lines from being seen by both instances of the ColorYUV filter. Something that will cause conditional reader statements above the line to not be seen by filters below the line and vice versa.

What I mean is that both sets of calls to conditionalreader seem to be reading from the same input files. I'm asking if this is a mistake in your example script or not. If it's not a mistake, well, you would expect two function calls with the same parameters to give the same results, no?

pinterf
7th April 2019, 17:55
AVSValue __cdecl Create_pyramid_blur(AVSValue args, void* user_data, IScriptEnvironment* env) {
AVSValue multipliers[3] = { 0, 0, 1 };

return new pyramid_mul(
args[0].AsClip(),
AVSValue(multipliers, 3),
false,
env
);
}

What happens if you try with floats?
AVSValue multipliers[3] = { 0.0f, 0.0f, 1.0f };

wonkey_monkey
7th April 2019, 19:13
Same thing. It seems the object only exists during construction of the filter instance, whereas actual proper filter parameters persist. I made the filter take a copy during construction, and now it works as intended.

Stereodude
7th April 2019, 22:19
What I mean is that both sets of calls to conditionalreader seem to be reading from the same input files. I'm asking if this is a mistake in your example script or not. If it's not a mistake, well, you would expect two function calls with the same parameters to give the same results, no?
They're not the same in the script with two and two. They have similar names, but they're not the same.

RainyDog
8th April 2019, 14:20
Does anyone know of any logo removal plugin's for x64 Avisynth+ that they can point me to please?

Something that can remove a small semi-transparent logo from a TV broadcast.

Thanks.

pinterf
8th April 2019, 14:49
If so, can we have some sort of additional feature to segregate conditional reader statements in Avisynth+. Like a line that will be parsed by Avisynth+ and prevent all 4 ConditionalReader lines from being seen by both instances of the ColorYUV filter. Something that will cause conditional reader statements above the line to not be seen by filters below the line and vice versa.
Nice problem. This commit (https://github.com/pinterf/AviSynthPlus/commit/4e57ce9b7b04e4dc1b0d04458967d4458f728574#diff-57531bd28bca7e5a39e73c62c313e3df) will probably help you. Do someone need a fresh build from current dev state? It's faster for me than doing a proper release.

Gser
8th April 2019, 16:08
Does anyone know of any logo removal plugin's for x64 Avisynth+ that they can point me to please?

Something that can remove a small semi-transparent logo from a TV broadcast.

Thanks.

I use MP_Pipeline https://forum.doom9.org/showthread.php?t=163281(https://www.mediafire.com/folder/2izh9abzep52o/Video_works to pipe rm_logo to the 32-bit version of avisynth in one script, meaning you need both 32 and 64 bit versions installed

wonkey_monkey
8th April 2019, 19:03
Here's an oddity: if I use extracta on a YUV clip with no alpha channel, I get an error. If I use it on an RGB24 clip, which also has no alpha channel, no error - just white pixels.

Reel.Deel
13th April 2019, 20:19
My apologies in advance if this is the wrong thread to make such a request, but can someone supply a 0.7 64 bit version of Variableblur to replace the 0.5 version out there now? Thanks.

Thanks to Asd there is now a 64-bit VariableBlur v0.7 (among other plugins). See http://avisynth.nl/index.php/AviSynth%2B_x64_plugins

Source code(s) available here: http://avisynth.nl/index.php/User_talk:Asd

StainlessS
13th April 2019, 22:07
Many thanx Reel.Deel and especially Asd (dont seem to have D9 Account) for the x64 rendition and source.

ChaosKing
13th April 2019, 23:49
Why not make a github organisation to keep plugins + source code organised? Like this one https://github.com/HomeOfVapourSynthEvolution

gaak
17th April 2019, 01:27
Many thanx Reel.Deel and especially Asd (dont seem to have D9 Account) for the x64 rendition and source.

Please add my thanks as well. My life is now complete (and so is my project):).

Dogway
26th April 2019, 15:30
I made a test script to understand the new syntax for expressions but I'm having a hard time getting a grasp of it.
In the below case, I have a different behavior when working in 16 or 8 bit.

blankclip(length=1,width=700,height=480, pixel_type="YV12")
ConvertBits(16)
expr(" sx width / range_max * ", "","", scale_inputs = "none" )
#~ ConvertBits(8) # comment and uncomment


strength = string(1.1)

expr( last, " x "+strength+" scalef ^ ","","", scale_inputs = "floatf" )



edit: In case anyone's interested here's the function it works but 8b and 16b give different results (strength is not scaled correctly I think)

function Vignette(clip c, float "Vignette", bool "show") {

strength = string(Default(Vignette, 0.7))
show = Default(show, false)

a=expr( c, " sx width 2 / - abs width 2 / / range_max * 1.5 "+strength+" 2 / + ^ range_max / 0 max ", "","", scale_inputs = "none" )
b=expr( c, " sy height 2 / - abs width 2 / / range_max * 1.5 "+strength+" 2 / + ^ range_max / 0 max ", "","", scale_inputs = "none" )

msk=expr(a,b,"x y + range_max - abs", "range_half","range_half", scale_inputs = "none" )

show ? msk : expr(msk,c,"x y * range_max / ", "y", "y", scale_inputs = "none" )

}


Also, is there an internal function similar to mt_merge() for YUV?
I could replicate it with expr() at some extent, only for luma, I could split planes but I don't know if there's a more elegant solution?
expr(video, msk,"x z range_size - abs * y z * + range_max / ","","",scale_inputs="none")

Nico8583
27th April 2019, 12:41
Hi,
What is the difference between "https://github.com/AviSynth/AviSynthPlus/releases/download/Rel-r1576/AviSynthPlus-r1576.exe" from http://avs-plus.net/ and "https://github.com/pinterf/AviSynthPlus/releases/download/r2772-MT/AviSynthPlus-MT-r2772.exe" from https://github.com/pinterf/AviSynthPlus/releases ? Is it just one newer than the other ? Or a fork ?
Thank you.