Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th May 2020, 11:52   #221  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by FranceBB View Post
Still access violation.
I see! Would you mind uploading the newly created build?
Or is it the AviSynth+_3.6.0_i686-xp-nosimd uploaded by qyot27?
No, I just started to build one for XP then I made a sanitiy check before the actual build and was a bit surprised that this build would not be for XP contrary to the choice in cmake gui.
pinterf is offline   Reply With Quote
Old 25th May 2020, 14:07   #222  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Did you know?
New Format function in 3.6
http://avisynth.nl/index.php/Interna...ring_functions
and scroll down a bit
pinterf is offline   Reply With Quote
Old 25th May 2020, 14:25   #223  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Did you know (#2)?
New "SetMaxCPU" function in 3.6
http://avisynth.nl/index.php/Interna...Global_Options
pinterf is offline   Reply With Quote
Old 25th May 2020, 14:46   #224  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Did you know (#3)?
Escaped string literals (from Nekopanda's fork)
http://avisynth.nl/index.php/The_ful...ammar#Literals
pinterf is offline   Reply With Quote
Old 25th May 2020, 15:53   #225  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by pinterf View Post
EDIT: test-test-test Retro masktools 2.0.48 as an Avisynth 2.6 dll. https://drive.google.com/open?id=1xP...bT0JkffmEUQA67
Do _NOT_ mix it with masktools2!
Thanks for this test build...

It does work on my Win7 computer with a CORE i5, but on my old XP machine (no SSE2) I get an access violation.

Anyways, it does not make much of a difference. The vast majority of my plugins are CPP 2.5 plugins, and I do want to keep using them.

The StaxRip version I use interfaces with AviSynth through the VFW interface, and this seems to cause my issues with AVS+ 3.6. Other host applications for AviSynth (like AVStoDVD) do not have these problems with LAV Filters not being released from memory, it is only StaxRip. And after more tests I found out that a lot of the CPP 2.5 plugins trigger this issue.

So some of the changes between AVS+ 3.5.1 and 3.6 must have broken the VFW interface with the effect that old 2.5 plugins no longer work correctly.

Now you might want to get rid of the VFW interface altogether in the near future, or you might want to drop support for 2.5 plugins, I don't know. Since I am unwilling to give up my StaxRip version or replace my 2.5 plugins with newer 2.6 versions, I only can decide to stick with AVS+ 3.5.1. All the new features are nothing I am interested in, so I do not miss out on anything.

Cheers
manolito
manolito is offline   Reply With Quote
Old 25th May 2020, 15:57   #226  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
On the output side, VfW interface is used e.g. for VirtualDub2, I had no problems on that side however.
pinterf is offline   Reply With Quote
Old 25th May 2020, 16:08   #227  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by manolito View Post
Thanks for this test build...

It does work on my Win7 computer with a CORE i5, but on my old XP machine (no SSE2) I get an access violation.
It's important because it was created with XP settings on the DLL side.

This masktools project consists of two parts, the other - non DLL part - was not flagged with this XP special option.
Test 2: (ThreadSafeInit- flag set to all modules)
https://drive.google.com/open?id=12d...qZhI3CquBDXKGD
pinterf is offline   Reply With Quote
Old 25th May 2020, 17:22   #228  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Alright, the new test build now runs on my XP machine without any problems...

For the VfW interface I had not even thougt about VDub, thanks for mentioning it.

And yes, I can easily reproduce the issue under VDub. I use an older version by FCCHandler with integrated MPEG2 support (VDub2 does nothing for me), but this should not make a difference.

This is the source script:
Quote:
movie = "d:\test.mp4"
a = DirectShowSource(movie, video = false)
v = DSS2(movie)
AudioDub(v, a)
Crop(0,0,-Width % 4,-Height % 4)
FineSharp()
DSS2Mod plus the latest stable LAV Filters installed.

The FineSharp script relies on MT_MaskTools-26 and RemoveGrain and Repair. All of them are CPP 2.5 plugins.

If you comment out the FineSharp call in the above script and open it with VDub, everything works fine. But if you activate FineSharp, things change. Opening the script just once is no problem, but if you reopen the script you will see that the previous LAV Filter instances stay in memory. Reopen the script a couple of times, and you will see your taskbar populated with many LAV instances (if you have enabled the tray icons in the LAV settings).

So I believe that it really is the VfW interface which is broken in AVS+ 3.6. Are we getting somewhere?
manolito is offline   Reply With Quote
Old 25th May 2020, 18:12   #229  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
I assume SetMaxCPU will have effect on this kind of code:
Code:
	SSE2_Enable=((env->GetCPUFlags()&CPUF_SSE2)!=0);
	AVX_Enable=((env->GetCPUFlags()&CPUF_AVX)!=0);
	AVX2_Enable=((env->GetCPUFlags()&CPUF_AVX2)!=0);
It's working for the code on the constructor ?
Interesting for debuging.

BTW, there is still no possibility to know the prefecth value used in the script within the Create function or the constructor ?
__________________
My github.
jpsdr is offline   Reply With Quote
Old 25th May 2020, 18:19   #230  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by jpsdr View Post
I assume SetMaxCPU will have effect on this kind of code:
Code:
	SSE2_Enable=((env->GetCPUFlags()&CPUF_SSE2)!=0);
	AVX_Enable=((env->GetCPUFlags()&CPUF_AVX)!=0);
	AVX2_Enable=((env->GetCPUFlags()&CPUF_AVX2)!=0);
It's working for the code on the constructor ?
Interesting for debuging.

BTW, there is still no possibility to know the prefecth value used in the script within the Create function or the constructor ?
For experiments check env->GetEnvProperty(prop_id), which function is now is part of IScriptEnvironment, their constant are also in avisynth.h. Don't know when and what it returns, but you can even ask it in every GetFrame. And do your thread count adjustment on-the-fly?
pinterf is offline   Reply With Quote
Old 26th May 2020, 11:58   #231  |  Link
jpsdr
Registered User
 
Join Date: Oct 2002
Location: France
Posts: 2,308
Quote:
Originally Posted by pinterf View Post
And do your thread count adjustment on-the-fly?
For my needs... Not...
It's like... wanting to change the tires of a car while driving...

I need the information when i create the threapools
Code:
if (!poolInterface->CreatePool(prefetch)) env->ThrowError("...")
in the Create function.
Then i create for one (or more) pool the number of threads (in each pool) in the constructor (with each step a check to be sure everything went fine), and in the GetFrame the creation part is allready done, everything is ready to use, and used.

Anyway, it's not critical, as the parameter can be set.
__________________
My github.

Last edited by jpsdr; 26th May 2020 at 12:10.
jpsdr is offline   Reply With Quote
Old 26th May 2020, 14:02   #232  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
the output of GeneralConvolution seems different from AviSynth 2.6, is it bug?

using

ConvertTorgb32
GeneralConvolution(Matrix="-1 2 -1 2 0 2 -1 2 -1")
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th May 2020, 14:13   #233  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 890
Quote:
Originally Posted by pinterf View Post
And a list about changes that affect future plugins.
Both serious and not so serious plugin writers have to keep in mind............................................

Inheritance is broken if a filter does not behave in a frame-property friendly way. There is not problem when a plugin is using MakeWriteable. But when using NewVideoFrame which accepts only a format input (VideoInfo) the chain is broken. There is no frame property source for this empty frame. Avisynth core cannot guess it. But now we have a new IScriptEnvironment function "NewVideoFrameP" with the option of specifying the property source which will be copied to the newly created frame as well..
After a long time I am going through this thread and got alarmed. In the initial years of Avisynth 2.5 plugin creators were advised not to use MakeWritable function but use NewVideoFrame(vi) and copy the input frame. I have been using that advice meticulously since then and modified my old sources.
Now it appears MakeWritable may be the way to go. Also it appears NewVideoFrame(vi) will break.
Do I need to alter all my avisynth+ plugins with this new environment? True when using IscriptEnvironment2 we were warned that it may change. But for keeping thread safety getting buffers from avisynth became possible and convenient.
I request to please advise me on these aspects.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 26th May 2020, 14:31   #234  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
hi vcmohan
since you about update your plugins, can you make your plugins look for libfftw3f-3.dll first, then fftw3.dll like https://github.com/pinterf/fft3dfilt...ilter.cpp#L711 ?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 26th May 2020, 19:56   #235  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,883
Quote:
Originally Posted by pinterf View Post
No, I just started to build one for XP then I made a sanitiy check before the actual build and was a bit surprised that this build would not be for XP contrary to the choice in cmake gui.
Ok so the build that you generated, although it was supposed to be for XP when you selected it with CMake, but it wasn't.
By the way, I connected my GitHub account and selected the project on my computer and when I have time I'll take a look at it and I'll try to make a /Zc:threadSafeInit debug x86 build to see whether it works or not, however I'm not really familiar with CMake... Image
If you or someone else has time to make a /Zc:threadSafeInit x86 debug test build in the meantime, I'll test it.
FranceBB is offline   Reply With Quote
Old 26th May 2020, 20:42   #236  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by FranceBB View Post
Ok so the build that you generated, although it was supposed to be for XP when you selected it with CMake, but it wasn't.
By the way, I connected my GitHub account and selected the project on my computer and when I have time I'll take a look at it and I'll try to make a /Zc:threadSafeInit debug x86 build to see whether it works or not, however I'm not really familiar with CMake... Image
If you or someone else has time to make a /Zc:threadSafeInit x86 debug test build in the meantime, I'll test it.
With minus at the end.
/Zc:threadSafeInit-
Sorry, I had zero time, need a few days even for this simple task.
pinterf is offline   Reply With Quote
Old 27th May 2020, 12:08   #237  |  Link
mastrboy
Registered User
 
Join Date: Sep 2008
Posts: 365
Is there a similar function to Histogram("luma") that works with > 8 bit content in Avisynth+ 3.6?
__________________
(i have a tendency to drunk post)
mastrboy is offline   Reply With Quote
Old 27th May 2020, 16:05   #238  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Dear volunteers, please test this version with as much CPP-2.5 plugins as you can (including those which were crashing with 3.6)
Avisynth+ 3.6.1-20200527 test

Files only, *XP-compatible version, 32 bit version runs on SSE
*cannot guarantee until you are reporting that is really works.

Features: a bit (much) more friendly to Avisynth 2.5 style plugins

- AvisynthPluginInit2 passes a separate ScriptEnvironment for CPP2.5 plugins, so Avisynth+ can catch their AddFunction and Invoke methods
- since Avs2.5-ness is registered during plugin loading and AddFunction, calling such plugins from Avisynth+ core can happen in a compatible way without memory leaks.

This results in stopping memory leak (on e.g. "last" clip would not freed up on destroying ScriptEnvironment) resulted in increasing memory consumption when doing consecutive script reloads in VirtualDub or probably in other editors.

Last edited by pinterf; 27th May 2020 at 16:58.
pinterf is offline   Reply With Quote
Old 27th May 2020, 16:24   #239  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by vcmohan View Post
After a long time I am going through this thread and got alarmed. In the initial years of Avisynth 2.5 plugin creators were advised not to use MakeWritable function but use NewVideoFrame(vi) and copy the input frame. I have been using that advice meticulously since then and modified my old sources.
Now it appears MakeWritable may be the way to go. Also it appears NewVideoFrame(vi) will break.
Do I need to alter all my avisynth+ plugins with this new environment? True when using IscriptEnvironment2 we were warned that it may change. But for keeping thread safety getting buffers from avisynth became possible and convenient.
I request to please advise me on these aspects.
In Interface V8 the buffer pool has been moved to the standard IScriptEnvironment.

As for MakeWritable, I don't know why it was on the blacklist.

You can use NewVideoFrame in the future, it will take a long time until plugins are starting to use frame properties and the rules and conventions are defined and handled properly. All we have now that you can define, read and write frame properties.
You can tell on creating a new empty frame which previous frame you want to be the parent of the frame properties.
MakeWritable will do this copy instead of you automatically.

This was my transition in mvtools to apply proper passing of those theoretical frame properties:
https://github.com/pinterf/mvtools/c...0a3bfbb318a8f8
You can see there different techniques:
- no source given at all (mask),
- using NewVideoFrameP passing the source of fp immediately
- using NewVideoFrame, then set fp's later by copyFrameProps.

Plus it is done adaptively, only when filter detects a V8 interface.
pinterf is offline   Reply With Quote
Old 27th May 2020, 16:53   #240  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,078
Quote:
Originally Posted by pinterf View Post
Dear volunteers, please test this version with as much CPP-2.5 plugins as you can (including those which were crashing with 3.6)
Avisynth+ 3.6.1-20200527 test
Thanks for the test build, but Google won't let me download it without logging in. You can call me a bit paranoid, but I refuse to open accounts with Google, Microsoft and other collectors of personal data.

So can you or someone else please upload the file somewhere else?

Thanks
manolito
manolito is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:45.


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