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.

Domains: forum.doom9.org / forum.doom9.net / forum.doom9.se

 

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

Reply
 
Thread Tools Display Modes
Old 6th December 2025, 09:18   #61  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,540
Quote:
Originally Posted by vcmohan View Post
Many thanks for the good words above. As I was away last week I could not amend my code. However I have a doubt. My avisynth.h is of 2020vintage. I require a link to get new version. Request for it. Also do I need a new installer for avisynth.dlls?
I wish you a good health and clear mind!

The necessary changes, which appeared in interface version 12, are still in a not-yet-released development version of Avisynth+.

- install 3.7.5 from the installer, wonkey_monkey linked
- download the latest development DLLs from here
https://github.com/pinterf/AviSynthP...3.7.6pre-r4356
- and overwrite the existing 3.7.5 one, presumably in your system32 folder.
pinterf is offline   Reply With Quote
Old 9th December 2025, 13:33   #62  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Many thanks pinterif. I installed following steps you mentioned.
I am having some doubts.
1. in my manyPlus plugin there are several functions which use fftw dll, I am thinking of having one global lock class code for all of them, Each will communicate its own env ptr to this class code. The code for preventing copying is raising concern.
2. various versions of header files avisynthPlus.h use differing #ifndef ..... Since I was using version 8 header in many other functions I ran into problem immediately. Is there some reason for using differing defines?
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 10th December 2025, 14:25   #63  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
While trying to compile with new avisynth.h file I am getting error /warning C26495 for all AVSValue(....) in the AVSValue class. There appears to be other errors/warnings also. Am I doing something wrong?
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 10th December 2025, 21:44   #64  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,540
Quote:
Originally Posted by vcmohan View Post
Many thanks pinterif. I installed following steps you mentioned.
I am having some doubts.
1. in my manyPlus plugin there are several functions which use fftw dll, I am thinking of having one global lock class code for all of them, Each will communicate its own env ptr to this class code. The code for preventing copying is raising concern.
I recommend you - perhaps you already found it - looking at https://avisynthplus.readthedocs.io/...uiregloballock.

You should use the locker class only for a short time, just around the risky, non-thread safe fftw call. If you use C++ the automatic declaration of the shown locking class, then when the class goes out of scope, it just does the unlock automatically.

The class itself is not part of Avisynth.h, it is just provided in the docs as a convenient ready-made example for using global locks.

What is important, that you should call the lock and unlock with the same env pointer. When you use the GlobalLockGuard class, seen in the documentation example, then you don't even need to call unlock, since going out of scope, the class is destroyed and the unlock happens automatically.

You have to guard as short code part as you can, around those fftw functions (plans like fftwf_plan_many_dft_r2c, fftwf_malloc, fftwf_init_threads)

This was my commit when I made fft3dfilter global-thread-safe:
https://github.com/pinterf/fft3dfilt...c3a426b4003fbc

As you can see, I was already using a mutex there, but it ensured only the in-filter safety. I simply replaced it with the example GlobalLockGuard class.

I had problems with making fftw calls thread-safe in the desctructor (freeing up fftwf allocations), you can see in the fft3dfilter commit changes that there is a env_saved which I used here. I save end_saved in the constructor, just to be able to pass it to the GlobalLockGuard object (which in turn is using it for lock acquire and unlocking).

Internally, the global mutex - which Avisynth's core provides - exists only once for all plugins which use the same avisynth dll.

Quote:
Originally Posted by vcmohan View Post
2. various versions of header files avisynthPlus.h use differing #ifndef ..... Since I was using version 8 header in many other functions I ran into problem immediately. Is there some reason for using differing defines?
I don't know where it causes problems, one single project usually should use one avisynth.h

Anyway, you can use the new headers without problem on older systems as well.

But note: global-lock environment function call is valid only since v12 interface capable Avisynth. Your plugin will crash if someone use your modernized plugin with older Avisynths, unless you use the class with v12-awareness. Whether the actual avisynth interface version is v12 or newer, can be established easily, see examples.

In order to be able to tolerate both old and new Avisynth.dll, the above mentioned locker-class has a dedicated bool v12 flag, when you create it. If it is set to false, the object won't call the new interface function, but will still use a filter-local mutex, which is still way better than nothing.

And as another example of a real-life filter modification: this is what Asd-g's changed in neo_DFTTest:
https://github.com/HomeOfAviSynthPlu...261908ada1527b

I think the documentation and looking at fft3dfilter and neo_DTFTest changes can help you a lot.
pinterf is offline   Reply With Quote
Old 10th December 2025, 21:56   #65  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,540
Quote:
Originally Posted by vcmohan View Post
While trying to compile with new avisynth.h file I am getting error /warning C26495 for all AVSValue(....) in the AVSValue class. There appears to be other errors/warnings also. Am I doing something wrong?
It should work out-of-box. Are you seeing error or just warnings?
(please note that only avisynth.h is not enough to update, the avs/ folder has additional includes, which must exist there as well.)

It C26495 is really only a warning, ignore it.

Btw, which Visual Studio are you using?
pinterf is offline   Reply With Quote
Old 11th December 2025, 07:31   #66  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Thanks. I commited a silly mistake due to which I was getting those errors and warnings. Shows how much I was out of practice. Sorry for the trouble.
/
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 16th December 2025, 12:34   #67  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
I have introduced the Global_lock code in all my fftwf dependant plugins. How do I test the correct functioning of the lock?
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 25th December 2025, 09:39   #68  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,540
Dear vcmohan.

The interface version checker would crash on pre-V9 Avisynth interface, due to call env->GetEnvProperty without checking its availibility.

If you used the earlier example, please update your code to this modified one.

Code:
    IScriptEnvironment *env = ...
    avisynth_if_ver = 6; // guessed minimum
    avisynth_bugfix_ver = 0;
    try { env->CheckVersion(8); avisynth_if_ver = 8; }
    catch (const AvisynthError&) {}
    try { 
      env->CheckVersion(9); // if this works, we are at least V9, can use GetEnvProperty with AEP_INTERFACE_VERSION
      avisynth_if_ver = env->GetEnvProperty(AEP_INTERFACE_VERSION); // only since V9!
      avisynth_bugfix_ver = env->GetEnvProperty(AEP_INTERFACE_BUGFIX);
    }
    catch (const AvisynthError&) {}
    has_at_least_v8 = avisynth_if_ver >= 8; // frame properties, NewVideoFrameP, other V8 environment functions
    has_at_least_v12 = avisynth_if_ver >= 12; // global locks, GetCPUFlagsEx, query L2 cache size
pinterf is offline   Reply With Quote
Old 25th December 2025, 09:52   #69  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,540
Quote:
Originally Posted by vcmohan View Post
I have introduced the Global_lock code in all my fftwf dependant plugins. How do I test the correct functioning of the lock?
This is not easy, since for visible effect

- you have to load and call multiple fftw plugins
- without the locks, only an occasional garbage would sign that the different fftw planners are using each others data. If things work, it is just shown as no user report processing artifacts.
- After introducing the lock mechanism these disapperared.
- Here, in our original working conversation, asd-g prepared me very nice fftw wrapper DLLs, which created very detailed log files (what is called, when is called, detected concurrent - non-guarded - calls). This was a huge help to me in the development. This is where it is mentioned: https://github.com/AviSynth/AviSynth...ent-2925664910

After the changes I wrote:
"Thank you very much. 100% failure without, 100% success with v12 GlobalLock."

Before the fix, such lines appeared in the log:

"[TID: 11744] !!! CONCURRENT PLANNER ACCESS DETECTED !!! fftwf_plan_dft_r2c_2d entered while 1 other planner call(s) active."
pinterf is offline   Reply With Quote
Old 25th December 2025, 13:06   #70  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Thanks. That is reassuring. I will shortly update my manyPlus plugin on to my plugins web page,
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 3rd February 2026, 15:17   #71  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,693
Quote:
Originally Posted by vcmohan View Post
I will shortly update my manyPlus plugin on to my plugins web page,
any news?
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 4th February 2026, 12:54   #72  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Quote:
Originally Posted by real.finder View Post
any news?
A month back I have updated the manyPlus plugin functions using fftw dll to avoid racing. But unfortunately the avisynth site for uploading at present is not accessible due to some problem. I have brought this to the notice of the administrator Wilbert and awaiting the resolution. Meanwhile you can use the dll presently available on my page. Suggest use single thread only for the functions using fftw dll, Regards
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 4th February 2026, 13:17   #73  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 3,080
Quote:
Originally Posted by vcmohan View Post
Meanwhile you can use the dll presently available on my page.
The last modified date for ManyPlus still shows 30 June 2023.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 5th February 2026, 13:56   #74  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Yes. That is correct. Recent one is in Dec 25-Jan 26 which I am still trying to upload.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 6th February 2026, 13:16   #75  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 3,080
Quote:
Originally Posted by vcmohan View Post
Yes. That is correct. Recent one is in Dec 25-Jan 26 which I am still trying to upload.
Would you please have a look here?

I don't know if I can achieve what I am looking for with your frequency functions.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 7th February 2026, 13:19   #76  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
All my filters work on single frame. For removing flickering you will reqire filters that act on multiple frame input.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 15th February 2026, 03:49   #77  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,693
Quote:
Originally Posted by vcmohan View Post
unfortunately the avisynth site for uploading at present is not accessible due to some problem. I have brought this to the notice of the administrator Wilbert and awaiting the resolution
maybe you can give Wilbert the files so he can upload them on your behalf? I also went through this before https://forum.doom9.org/showthread.p...10#post2025610
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 17th February 2026, 13:03   #78  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Thanks for the suggestion. I requested wilbert address to which I need to send the files.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Old 25th February 2026, 12:42   #79  |  Link
vcmohan
Registered User
 
Join Date: Jul 2003
Location: India
Posts: 914
Thanks to the help of Wilbert the manyPlus plugin is now the latest. If any problems please indicate in this thread.
__________________
mohan
my plugins are now hosted here
vcmohan is offline   Reply With Quote
Reply

Thread Tools
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 19:16.


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