Log in

View Full Version : AviSynth+ thread Vol.2


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

FranceBB
20th March 2022, 20:13
Out of curiosity, what about propclearall() right after indexing?

Selur
21st March 2022, 05:32
ClearAutoloadDirs()
LoadPlugin("I:\INNOIN~1\64bit\Avisynth\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\INNOIN~1\64bit\Avisynth\AVISYN~1\MosquitoNR.dll")
LWLibavVideoSource("G:\TESTCL~1\test.avi",cache=false,dr=true,format="YUV420P8", prefer_hw=0)
propclearall()
MosquitoNR()
ConvertToRGB32(matrix="Rec601")
return last
also crashes at the initial invoke call and without the 'ConvertToRGB32' it crashes when 'ConvertToRGB32' is later called.
-> no change

FranceBB
21st March 2022, 10:18
Ok, so I've tried to test a bit:


ColorBars(848, 480, pixel_type="YV12")
MosquitoNR()
ConverttoRGB(matrix="Rec601")


works.
So I tried with a real video, an XDCAM-50 file and it works too:



FFVideoSource("\\mibctvan000.avid.mi.bc.sky.it\Ingest\MEDIA\temp\Test9_UCN_manual_QC_SubITA_DolbyE_DolbyE_PCM_PCM.mxf")
propClearAll()
MosquitoNR()
ConverttoRGB(matrix="Rec601")


Last but not least, I've tried LWLibavVideoSource() which is the indexer you were trying to use and... it works:


LWLibavVideoSource("\\mibctvan000.avid.mi.bc.sky.it\Ingest\MEDIA\temp\Test9_UCN_manual_QC_SubITA_DolbyE_DolbyE_PCM_PCM.mxf")
propClearAll()
MosquitoNR()
ConverttoRGB(matrix="Rec601")


https://i.imgur.com/CuQ5u4C.png

and even your exact same command line:

https://i.imgur.com/7nU6s0C.png


Avisynth 3.7.2 Stable x64
Windows 11 x64

Out of curiosity, are you using this build of MosquitoNR? Link (https://www.dropbox.com/s/0dgrruxne80izus/MosquitoNR_0.10_x64.zip?dl=1)

Selur
21st March 2022, 13:03
I know that it works in avspmod, problem is that it does not work in my code.

Out of curiosity, are you using this build of MosquitoNR?
Yes, I do.

Cu Selur

pinterf
21st March 2022, 16:35
Using latest AviSynth+ 3.7.2

When I use:
...
my code crashes when loading the the file:
AVS_linkage = m_env->GetAVSLinkage();
const char* infile = m_currentInput.toLocal8Bit(); //convert input name to char*
std::cout << "Importing " << infile << std::endl;
AVSValue arg(infile);
m_res = m_env->Invoke("Import", AVSValue(&arg, 1)); // <- here it dies
see: https://github.com/Selur/avsViewer/blob/441500fe4f46ece0e48542a61daec95eb019ff3b/avsViewer.cpp#L142
...
-> any idea?

Cu Selur
Just a faint guess. it is the first use of m_res. Maybe the crash is related to it.
In the avsViewer::avsViewer there is an initialization of AVSValue m_res in that initialization list. Here:
https://github.com/Selur/avsViewer/blob/441500fe4f46ece0e48542a61daec95eb019ff3b/avsViewer.cpp#L28
But the global variable const AVS_Linkage *AVS_linkage which is needed as a bridge to fill/initialize an AVSValue does not exist yet. I'd try to remove m_res from the initialization list. Otherwise your code seems to be correct: toLocal8Bit is providing a safe null-terminated buffer; I guess 'm_env' exists just fine, so GetAVSLinkage should work as well.

Selur
21st March 2022, 17:07
Sadly, removing m_res from the initialization list doesn't help.
The strange thing is that if the .avs script doesn't include any "ConvertTo..." calls the loading of the script works fine, but then it crashes when I call ConvertToRGB32. :/
When I use:

bool avsViewer::invokeFunction(const QString& name)
{
try {
std::cout << "invoking " << qPrintable(name) << std::endl;
const char* function = name.toLocal8Bit();
if (!m_env->FunctionExists(function)) {
m_env->ThrowError(name.toLocal8Bit() + " does not exist!");
}
m_res = m_env->Invoke(function, AVSValue(&m_res, 1)); // invoking the function
std::cerr << "invoked " << qPrintable(name) << std::endl;
return true;
} catch (AvisynthError err) { //catch AvisynthErrors
std::cerr << "Avisynth error " << qPrintable(m_currentInput) << ": " << std::endl << err.msg << std::endl;
} catch (...) { //catch the rest
std::cerr << "Unknown C++ exception" << std::endl;
}
return false;
}
I see:
Initializing the avisynth script environment,..
loaded avisynth dll,..(I:/workspace/avsViewer/release/AviSynth.dll)
loaded CreateScriptEnvironment definition from dll,..
Importing c:\Users\Selur\Desktop\test.avs

Color: YV12, Resolution: 640x352, Frame rate: 25 fps, Length: 429 frames, PRO

Current color space: YV12
invoking ConvertToRGB32

so it dies in
m_res = m_env->Invoke(function, AVSValue(&m_res, 1)); // invoking the function

This is driving me nuts. :(

Cu Selur

Ceppo
21st March 2022, 17:24
I'm not in the right mind at the moment but:

m_res = m_env->Invoke(function, AVSValue(&m_res, 1)); // invoking the function

Is assigning a value to m_res and to use it with a reference at the same time... legit??

/I'mNotAProgrammer

Selur
21st March 2022, 17:40
Since the right side should be evaluated before the assignment I see no problem with it. :)

Cu Selur

Ps.: Can someone compile MosquitoNR with MVSC++ 2019?

wonkey_monkey
21st March 2022, 18:22
We should probably pop all this out into its own thread. But for now, I can confirm that

temp = env->Invoke("colorbars", 1280); // how do you invoke a filter with no parameters?
temp = env->Invoke("converttoyv12", AVSValue(&temp, 1));
temp = env->Invoke("mosquitonr", AVSValue(&temp, 1));
temp = env->Invoke("converttorgb32", AVSValue(&temp, 1));


crashes (MSVC2019, Avisynth+ 3.7.1), but doesn't crash if I remove the converttogrb32.

Yet putting ConvertToRGB32 directly in a script after MosquitoNR works fine. Very strange.

Reel.Deel
21st March 2022, 18:43
Ps.: Can someone compile MosquitoNR with MVSC++ 2019?

For x64 it would have to be with the Intel compiler since the source contains assembly.

On a side note, for anyone with the means to do it. The following plugins were all compiled with the Intel compiler as well. Downside is that they are compiled for the 2.5 interface and may be problematic as stated here: https://github.com/AviSynth/AviSynthPlus/issues/272

Not only unaware of frame props.
SmoothD2 is an AviSynth 2.5 plugin which can use hardcoded ("baked") code for frame manipulation instead of Avisynth interface calls. Behavior is uncontrolled and random.


Decomb
IT_YV12
MosquitoNR
SmoothD
SmoothD2


A 2.6 interface update for these plugins would be appreciated :).

Selur
21st March 2022, 19:02
But for now, I can confirm that
Man I'm happy that this does not happen to just me. :)

crashes (MSVC2019, Avisynth+ 3.7.1), but doesn't crash if I remove the converttogrb32.
hmm,.. I'm using 3.7.2 and there "putting ConvertToRGB32 directly in a script after MosquitoNR" does not work fine here. :/

A 2.6 interface update for these plugins would be appreciated
Yup, that would be cool. :)

Cu Selur

wonkey_monkey
21st March 2022, 19:04
I'm trying to build 3.7.2 from source with MSVC 2019. I download the source, use "Open a local folder" and it imports everything fine. I then go to Manage Configurations... which gives me a GUI to make changes to CMakeSettings.json. I take out the default Debug build and replace it with x64-Release, and I change the Configuration type to Release.

When I try to build, I get a number of unresolved externals:

https://i.imgur.com/FL6yuBP.png

The funny thing is I can do the exact same thing on my work computer, and it works fine. But not at home. Does anyone know what's wrong with my setup? Am I missing some required part of MSVC?

Edit: I CAN successfully build an x64-Debug version. But not Release.

wonkey_monkey
21st March 2022, 19:10
hmm,.. I'm using 3.7.2 and there "putting ConvertToRGB32 directly in a script after MosquitoNR" does not work fine here. :/


Does your program still invoke ConvertToRGB32 when it is already in the script?

What worked for me was putting ConvertToRGB32 in a script and then running the script with AVSMeter64. If I try to load the script in my viewer - which invokes ConvertToRGB32 a further time, regardless of what type the script produces - it crashes.

Selur
21st March 2022, 19:18
Does your program still invoke ConvertToRGB32 when it is already in the script?
Nope, ConvertToRGB32 is only invoked if the input isn't already RGB32.

pinterf
21st March 2022, 19:57
I'm trying to build 3.7.2 from source with MSVC 2019. I download the source, use "Open a local folder" and it imports everything fine. I then go to Manage Configurations... which gives me a GUI to make changes to CMakeSettings.json. I take out the default Debug build and replace it with x64-Release, and I change the Configuration type to Release.

When I try to build, I get a number of unresolved externals:

https://i.imgur.com/FL6yuBP.png

The funny thing is I can do the exact same thing on my work computer, and it works fine. But not at home. Does anyone know what's wrong with my setup? Am I missing some required part of MSVC?

Edit: I CAN successfully build an x64-Debug version. But not Release.
I've never used cmake from Visual Studio GUI.
I'm using CMakeGUI and using it to generate the .sln solution for all projects and dlls in Avisynth+.
https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/contributing/compiling_avsplus.html#from-cmake-gui
Then I open the generated sln and can use both debug and release build from Visual Studio IDE.

Ceppo
21st March 2022, 20:08
Might be unrelated, but when I used invoke with vinverse, when passing directly the value in the invoke call I got the float converted to int for no reason, then I declared first the array and then I set the value of each index individually and the problem was gone, give it a shot, you got nothing to lose after all...

3 nights without sleeping :D

Selur
21st March 2022, 20:16
On my way to bed, you mean like this?

AVSValue tmp[1] = { &m_res };
m_res = m_env->Invoke(function, tmp);
(will try tomorrow after work)

pinterf
21st March 2022, 20:36
Is it easy and straightforward to build and use avsviewer cloned from git? Does it have any prerequisites?

Ceppo
21st March 2022, 20:47
On my way to bed, you mean like this?



AVSValue tmp[1];
tmp[0] = &m_res;

Dogway
22nd March 2022, 00:29
I wonder if frame props are broken? I expect frame properties assigned to frame 0 be retrieved outside a runtime environment.

ScriptClip( function[] () {
SelectEvery(1,-current_frame)
AverageLuma() > 98 ? propSet("_TestFP", 4) : propSet("_TestFP", 1)
SelectEvery(1, current_frame)
subtitle(string(AverageLuma()),align=8,y=100)
} )

subtitle(string(propGetInt("_TestFP")),align=8)

Selur
22nd March 2022, 04:35
Is it easy and straightforward to build and use avsviewer cloned from git? Does it have any prerequisites?
Qt + avisynth dll/inclues, nothing more. I usually build it with MSVC Community editoion, QCreator and Avisynth+ sdk installed. FilterSDK path in the .pro file "C:\Program Files (x86)\AviSynth+\FilterSDK\include" might need to be adjusted to your system. When building with mingw, you probably would need to add some additional dependencies to the .pro file.

AVSValue tmp[1];
tmp[0] = &m_res;
nope, doesn't change a thing.

pinterf
22nd March 2022, 08:44
Qt + avisynth dll/inclues, nothing more. I usually build it with MSVC Community editoion, QCreator and Avisynth+ sdk installed.
Is this add-on enough?
https://www.qt.io/blog/2019/01/21/qt-visual-studio-tools-2-3-1-released
and following the list here: https://wiki.qt.io/Visual_Studio_Add-in and choose pre-built windows one? (3.9GB??)
https://download.qt.io/official_releases/qt/5.12/5.12.9/

pinterf
22nd March 2022, 09:44
Qt + avisynth dll/inclues, nothing more. I usually build it with MSVC Community editoion, QCreator and Avisynth+ sdk installed.
Is this add-on enough?

These are my findings and I was able to build avsViewer under Windows and VS2019.

- Install Avisynth+ with SDK (if you want to have Avisynth headers in c:\Program Files (x86)\AviSynth+\FilterSDK\include\)
- VS2019: Clone https://github.com/Selur/avsViewer.git
- QT: Download and install pre-built package, find link at https://wiki.qt.io/Visual_Studio_Add-in. (3,9GB!)
- Start installer, you'll need to create a QT account, email-confirmation, yes-I'm individual, Choose VS2017 32 bit x86 (no VS2019 version)
- In VS2019 find Extensions|Manage Extensions, type in search Qt Visual Studio tools, Download. Exit from VS2019 to install it.
- Restart VS2019
- The Qt project file extension .pro is not for MS Visual Studio, avsViewer.pro has to be converted first:
- If you already have a .pro file but no .vcproj file:
Extensions|Qt VS Tools|Open Qt Project File (.pro) to convert .pro file to a .vcproj file.
Grrr. Error: qmake not found, specify a version
- Extensions|Qt VS Tools|Options|Qt|Versions
Browse for qmake.exe: C:\Qt\Qt5.12.9\5.12.9\msvc2017\bin\qmake.exe
version: 5.12.9_msvs2017, Host: Windows, Path: C:\Qt\Qt5.12.9\5.12.9\msvc2017 will be filled.
OK
- Again: Extensions|Qt VS Tools|Open Qt Project File (.pro) to convert .pro file to a .vcproj file.
Yeah, it works now.

EDIT:
These lines result in complete garbage (e.g. YYYYYYYYYYYYYYY) in 'infile' and 'function'.
Debugging step-by-step and watch variables: m_current_input is a valid Qt string containing the avs file with full path, and name contains "ConvertToRGB32" Qt string.
Both conversions fail.
const char* infile = m_currentInput.toLocal8Bit(); //convert input name to char*
const char* function = name.toLocal8Bit();
Replacing them with hardcoded avs file name:
e.g. const char* infile = "C:/Tape13/20220322_AvsViewer/s1.avs";
and const char* function = "ConvertToRGB32"; everything works perfectly.

I'm trying Win32 at the moment with the following script:

LoadPlugin("MosquitoNR.dll")
ColorBars(pixel_type = "YV12")
propclearall()
MosquitoNR()
#ConvertToRGB32(matrix="Rec601")
return last

Selur
22nd March 2022, 16:12
I ususally use QCreator and thus no vcproj file is needed. :)
Win32 works fine here, only win64 fails.

pinterf
22nd March 2022, 16:43
I ususally use QCreator and thus no vcproj file is needed. :)
Win32 works fine here, only win64 fails.
I don't know what Qcreator is; are you able to debug the DLL built with Visual Studio stepping by line and inspect variables?

Selur
22nd March 2022, 17:42
QCreator -> https://www.qt.io/product/development-tools
It detects the installed MSVC compiler and the Windows Debugger. (if you open the projects dialog)
When debugging you can set hbreak points an go from them step-by-step and see how the variables change.
it looks like this:
https://i.ibb.co/rvq13XH/Qt-Creator.png (https://ibb.co/qxhPC2p)

pinterf
23rd March 2022, 14:22
I could not figure out why my existing MSVC reported junk result for your Qt string converter line. And no x64 project settings were generated, probably I missed it during install?

Anyway, I updated the plugin instead of spending days on learning Qt things.

https://github.com/pinterf/MosquitoNR/releases/tag/v0.2
If something does not work or the result is not the same as it was, please report it on github (issues) (~1000 lines of assembly code was converted, I'd easily missed something in the process).
Tested with Avspmod.

I do hope it works fine and the crash in avsViewer is not Avisynth related.

pinterf
23rd March 2022, 15:18
I wonder if frame props are broken? I expect frame properties assigned to frame 0 be retrieved outside a runtime environment.

ScriptClip( function[] () {
SelectEvery(1,-current_frame)
AverageLuma() > 98 ? propSet("_TestFP", 4) : propSet("_TestFP", 1)
SelectEvery(1, current_frame)
subtitle(string(AverageLuma()),align=8,y=100)
} )

subtitle(string(propGetInt("_TestFP")),align=8)
They are set.
Uncomment the external SubTitle and check if error message is shown by ScriptClip. Because I fed it with BlankClip() and ScriptClip failed because AverageLuma could not be done on an RGB clip.
BlankClip(pixel_type="YV12") did the job.

wonkey_monkey
23rd March 2022, 15:23
What licence is Avisynth+ distributed under? It's got copies of the GPL in the files, but nothing that actually says that's what it's distributed under, as far as I can tell.

Also Avisynth used to have an exception:

As a special exception, the copyright holders of Avisynth give you
permission to link Avisynth with independent modules that communicate
with Avisynth solely through the interfaces defined in avisynth.h,
regardless of the license terms of these independent modules, and to
copy and distribute the resulting combined work under terms of your
choice, provided that every copy of the combined work is accompanied by
a complete copy of the source code of Avisynth (the version of Avisynth
used to produce the combined work), being distributed under the terms of
the GNU General Public License plus this exception. An independent
module is a module which is not derived from or based on Avisynth, such
as 3rd-party filters, import and export plugins, or graphical user
interfaces.


http://avisynth.org.ru/docs/english/license.htm

Does that/can that still apply to Avisynth+? I've distributed plugins without source code often - because of laziness more than anything else, because I draw on bits and pieces of code (all mine) scattered in various different projects and it's a pain to package it all up or even test that it'll compile elsewhere.

pinterf
23rd March 2022, 15:34
https://forum.doom9.org/showthread.php?p=1645648&highlight=avisynth+license#post1645648
https://forum.doom9.org/showthread.php?p=1653152&highlight=avisynth+license#post1653152

I don't know that .ru site, but you can find the 'special exception' text in each avisynth.h and avisynth_c.h.

wonkey_monkey
23rd March 2022, 15:49
Avisynth.h, of course! I'm an eejit. Thanks.

Selur
23rd March 2022, 16:07
I do hope it works fine and the crash in avsViewer is not Avisynth related.
Yes! avsViewer works fine with the new version! Thanks a lot!

pinterf
23rd March 2022, 16:33
Yes! avsViewer works fine with the new version! Thanks a lot!
You're welcome. I though it was more problematic after seeing the amount of assembler lines inside. Ten hours fun, one less 2.5 plugin to bother with. Great deal, isn't it ;)

StainlessS
23rd March 2022, 16:41
Pinterf, Avisynth code czar and incredible geezer :)

[actually I looked up 'geezer' in my online dictionary, and it aint as flattering as I thought :) ]

Selur
23rd March 2022, 17:09
Okay, I checked all the filters I use in Hybrid with 64bit Avisynth and I found another one which causes the same issue: Motion (http://wilbertdijkhof.com/mg262/Motion_v10.zip) which I use through SalFPS3:
ClearAutoloadDirs()
SetFilterMTMode("DEFAULT_MT_MODE", MT_MULTI_INSTANCE)
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\LSMASHSource.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\motion.dll")
LoadPlugin("I:\Hybrid\64bit\Avisynth\AVISYN~1\masktools2.dll")
Import("I:\Hybrid\64bit\Avisynth\avisynthPlugins\SalFPS3.avs")
# loading source: G:\TestClips&Co\files\test.avi
# color sampling YV12@8, matrix: bt601, scantyp: progressive, luminance scale: limited
LWLibavVideoSource("G:\TESTCL~1\files\test.avi",cache=false,dr=true,format="YUV420P8", prefer_hw=0)
# current resolution: 640x352
# adjusting frame rate
SalFPS3(50.0)
# filtering
PreFetch(16)
# setting output fps to 50.000fps
AssumeFPS(50,1)
# output: color sampling YV12@8, matrix: bt601, scantyp: progressive, luminance scale: limited
return last
-> could you also compile that? :)

Cu Selur

Dogway
23rd March 2022, 18:04
They are set.
Uncomment the external SubTitle and check if error message is shown by ScriptClip. Because I fed it with BlankClip() and ScriptClip failed because AverageLuma could not be done on an RGB clip.
BlankClip(pixel_type="YV12") did the job.

Thanks for the reply, the external subtitle is stuck at value 0.000, try with this example:

BlankClip(pixel_type="YV12")

Expr("frameno","128")

ScriptClip( function[] () {

avg = AverageLuma()

SelectEvery(1,-current_frame)
propSet("_TestFP", avg)
SelectEvery(1, current_frame)

subtitle("IN: "+string(avg),align=8,y=100)
} )

subtitle("OUT: "+string(propGetFloat("_TestFP")),align=8)
https://i.imgur.com/LV7mopim.png

pinterf
23rd March 2022, 20:42
Thanks for the reply, the external subtitle is stuck at value 0.000, try with this example:

BlankClip(pixel_type="YV12")

Expr("frameno","128")

ScriptClip( function[] () {

avg = AverageLuma()

SelectEvery(1,-current_frame)
propSet("_TestFP", avg)
SelectEvery(1, current_frame)

subtitle("IN: "+string(avg),align=8,y=100)
} )

subtitle("OUT: "+string(propGetFloat("_TestFP")),align=8)

Yes, outer display is stuck at a constant value. Outside ScriptClip everything is invoked and evaluated only once, at the very moment the filter (SubTitle, non-runtime propGetFloat) is invoked. Clips have known format, strings have their values ready. Constant values are assigned to all variables during script evaluation. Outer PropGetFloat calls GetFrame(0) only once in its constructor, and at that moment this will show 0 and so it will be displayed by SubTitle.

Try putting the outer SubTitle to ScriptClip to make it behave dynamically and you'll see the changing values.
ScriptClip(function[] () {
subtitle("OUT: "+string(propGetFloat("_TestFP")),align=8)
} )

pinterf
23rd March 2022, 20:57
Okay, I checked all the filters I use in Hybrid with 64bit Avisynth and I found another one which causes the same issue: Motion (http://wilbertdijkhof.com/mg262/Motion_v10.zip) which I use through SalFPS3:

-> could you also compile that? :)

Cu Selur
Yikes! This plugin is only 15 year old. Better than a Black Label. Not nice.
Like MosquitoNR this is not a simple recompilation either; similarly to MosquitoNR all its inline assembler must be replaced/rewritten by hand. I surely don't have another 10-20 hours for it. At least not now. I'm gonna deal with it when I'm bored.

Dogway
23rd March 2022, 21:59
Yes, outer display is stuck at a constant value. Outside ScriptClip everything is invoked and evaluated only once, at the very moment the filter (SubTitle, non-runtime propGetFloat) is invoked. Clips have known format, strings have their values ready. Constant values are assigned to all variables during script evaluation. Outer PropGetFloat calls GetFrame(0) only once in its constructor, and at that moment this will show 0 and so it will be displayed by SubTitle.

Try putting the outer SubTitle to ScriptClip to make it behave dynamically and you'll see the changing values.

Yes, the description was confusing because it said properties from frame#0 could be retrieved from outside runtime.
AviSynth 3.7.1: allow propGetXXX property getter functions called as normal functions, outside runtime.
By default frame property values are read from frame#0 which index can be overridden by the offset parameter.

If we remove subtitle from the equation it's the same (no subtitle in this case), despite frame#0 has changing values:
var = propGetFloat("_TestFP")
var > 40 ? subtitle("OUT: OK!",align=8) : last

This was an effort to make filtering lighter on the CPU.

Reel.Deel
24th March 2022, 02:11
Okay, I checked all the filters I use in Hybrid with 64bit Avisynth and I found another one which causes the same issue: Motion (http://wilbertdijkhof.com/mg262/Motion_v10.zip) which I use through SalFPS3:
[code]
-> could you also compile that? :)

Cu Selur

I'm curious to see an example of Motion performing better then the current alternatives. I tried out this plugin long ago and I remember getting suboptimal results compared to MVTools2 and co.

Here's the actual source for the x64 version of Motion: Motion64_src.zip (http://members.optusnet.com.au/squid_80/sources/Motion64_src.zip)

Still includes asm but with #ifdef around it, maybe it too was compiled with the Intel compiler. Edit: indeed it was:

Intel's compiler does support inline assembly, that's how I was able to do tdeint, masktools, clouded's motion.dll and awarpsharp in quick succession...

kedautinh12
24th March 2022, 03:24
Binary here:
http://members.optusnet.com.au/squid_80/motion64.zip

Selur
24th March 2022, 05:41
@kedautinh12: That's the file I use which which causes me the issues. (also tried it and it does not work)

pinterf
24th March 2022, 07:50
Yes, the description was confusing because it said properties from frame#0 could be retrieved from outside runtime.


If we remove subtitle from the equation it's the same (no subtitle in this case), despite frame#0 has changing values:
var = propGetFloat("_TestFP")
var > 40 ? subtitle("OUT: OK!",align=8) : last

This was an effort to make filtering lighter on the CPU.
Avisynth scripting language is not capable to do that dynamically for you this way. It's ScriptClip and other runtime filters that are capable to do that. Or write a native filter and do the frame specific task in its GetFrame function.

When filter graph is built - once during script evaluation - all variables have single constant values, all functions have fixed, known parameter values, and they all return constant values as well which can be evaluated for the rest of the script text.

Selur
24th March 2022, 16:21
I'm curious to see an example of Motion performing better then the current alternatives. I tried out this plugin long ago and I remember getting suboptimal results compared to MVTools2 and co.
May be you are right -> I'll drop SalFPS3 from Hybrid. :)

Dogway
25th March 2022, 09:42
Avisynth scripting language is not capable to do that dynamically for you this way. It's ScriptClip and other runtime filters that are capable to do that. Or write a native filter and do the frame specific task in its GetFrame function.

When filter graph is built - once during script evaluation - all variables have single constant values, all functions have fixed, known parameter values, and they all return constant values as well which can be evaluated for the rest of the script text.

I managed to get the main filter run fast enough (around 140fps) but I know it's going to go down very quickly with consecutive runtime filters. Would it be possible to add 'Average' to PlaneMinMaxStats? It would make the filter run considerably faster by streamlining all the stats figures.

pinterf
25th March 2022, 12:59
I managed to get the main filter run fast enough (around 140fps) but I know it's going to go down very quickly with consecutive runtime filters. Would it be possible to add 'Average' to PlaneMinMaxStats? It would make the filter run considerably faster by streamlining all the stats figures.
Request registered. Any other meaningful statistics?

Dogway
25th March 2022, 19:20
There's the 'mode' but I have never used it, and I personally like 'IQM' (a 'mean' without the outliers). In any case I fear that adding too many would be counterproductive forcing all the stats to be computed.

EternalStudent
7th April 2022, 02:49
Other than looking at video output...how do people debug Avisynth+ use? I haven't found a log file I can enable, or a debug registry key to set.

I'm an SVP4 user (Smooth Video Project) and it uses Avisynth+, but seems to have issues with newer versions. I've found the SVP event log, but not a lot is mentioned there when things go wrong.

I found a debug registry key for AvsF, but I don't know if that'll show me everything happening inside Avisynth+ or not. The AvsF dev said they build a debug Avisynth+ version themselves and set a breakpoint. That's a bit more than I was hoping to do.

I just found and downloaded a few older wrapper tools that appear to test dependencies and give resource usage for a script. I haven't tried running them yet on the SVP created AVS. I have a feeling it won't be that easy. That they use some stored value from MPC-HC to know what to play.

To be clear, I'm not writing an AVS of my own. But am trying to help debug sporadic silent failures I ran across when upgrading a package myself (3.5.1 to 3.7.2). Where SVP reported itself disabled midway through the 2nd or 3rd episode of a TV series, and the video output still plays but not changed anymore. Kind of learning about all the parts by breaking them, and hoping to help the SVP dev(s) out with my efforts (or Avisynth+ if it's their bug).

StainlessS
7th April 2022, 07:55
I did not know what AvsF was, its described here for those interested:- https://www.svp-team.com/wiki/Avisynth_Filter_(AVSF) ]

EDIT: EternalStudent,
Probably not many people here will have any idea about the SVP AvsF thingy.
Suggest re-install Lav filters, W10 screws things up sometimes [for no apparent reason].

EDIT: You could also install this and run it before testing your AvsF thingy[DebugView]- https://docs.microsoft.com/en-us/sysinternals/downloads/debugview
Might spit out something relevant, or might not.

Also might want to check out AvsMeter,
command (with avsmeter/avsmeter64 somewhere in environment PATH),
"AvsMeter.exe -avsinfo" OR "AvsMeter64.exe -avsinfo",
AvsMeter if using x86 avsisynth via MPC-HC x86, or AvsMeter64 if 64 bit.

Reel.Deel
7th April 2022, 11:55
I did not know what AvsF was, its described here for those interested:- https://www.svp-team.com/wiki/Avisynth_Filter_(AVSF)


Link got messed up somehow: https://www.svp-team.com/wiki/Avisynth_Filter_(AVSF)

And here's the direct link to the repo: https://github.com/CrendKing/avisynth_filter

I've seen it before but never used it.