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 22nd May 2020, 03:41   #161  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,346
Quote:
Originally Posted by real.finder View Post
Check the Thread in my signature
Thanks, it's ok now

It needed Zs_RF_Shared.avs as well
poisondeathray is offline   Reply With Quote
Old 22nd May 2020, 04:09   #162  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: void
Posts: 2,633
Quote:
Originally Posted by pinterf View Post
Interesting ideas, they are a bit abstract for our present thinking.
I wish that was the only task to simplify. Instead there are many other opportunities to make the code a bit cleaner. E.g. removing all checks for 16 byte frame aligment in Avisynth (no unaligned frames allowed), and there are still other ancient techniques there which are sometimes workarounds for a VS2005 behaviour.
cool, and if ur ever gonna design a new API for new plugins, feel free to take a look at vsfilterscript and see how coding c++ plugins could be easy as scripting with a modern API. it might attract more developers since writing filters is a cinch. a few rules to make things simple,

1) there must be no base class/interface and inheritance, and thus no virtual functions, polymorphism should be implemented by duck typing (or more precisely, structural typing)

2) there should be no type declaration unless it's a type cast, everything should be of type "auto". this is essential to structural typing since we differentiate types by their behaviors rather than their names, use a concept if the type must be constrained.

Code:
template<typename T>
concept string_alike = requires(T x) { std::string{ x }; };

auto f(string_alike auto&& str) {
    ...
}

auto x = "aaa";
f(x); // OK, str instantiates to const char* 
f("aaa"); // OK, str instantiates to const char[4]
f("aaa"s); // OK, str instantiates to std::string
f("aaa"sv); // OK, str instantiates to std::string_view
f(123); // Error
this is vastly different from manually defining a bunch of interfaces (base classes) and subtypes, note that there is no common base type for const char*, const char[4], std::string and std::string_view, yet they all satisfy the "string_alike" concept since they share the same behavior (convertible to std::string), there is also no type erasure so the type precision is fully preserved.

3) constexpr if and requires expressions are your friend, these are extremely powerful tools and let you go even beyond structural typing, you can detect if a certain behavior is legal to a certain type and specialize your code based on that information.

Code:
auto print(auto&& stuff) {
    // see if stuff is a container by detecting if it has the "begin()" member
    if constexpr (requires { stuff.begin(); })
        for (auto x : stuff)
            std::cout << x << " ";
    else
        std::cout << stuff;
}

print(std::array{ 1, 2, 3 }); // prints "1 2 3"
print(std::vector{ "hello", "world" }); // prints "hello world"
print(3.14); // prints "3.14"
functions may return different types like in dynamically typed languages as long as the type can be determined at compile time with a little help from constexpr if

Code:
// consteval parameter is planned as a C++23 core language feature
auto f(consteval auto x) {
    if constexpr (x == "a"sv)
        return 123;
    else
        return 3.14;
}

auto x = f("a"); // x == 123, x is of type int
auto y = f("b"); // y == 3.14, y is of type double
nominal typing (type declaration) is evil and is the root cause of highly coupled, inflexible, unmaintainable code and all the ugliness out there
feisty2 is offline   Reply With Quote
Old 22nd May 2020, 04:51   #163  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by FranceBB View Post
ffmpeg instead complains about my SetMaxCPU("C"):

https://i.imgur.com/kOU9aR3.png
The message is from SetMaxCPU, not FFmpeg. It passes through the clip messages from AviSynth to stdout.

I had just copied the Changelog entries as-is out of readme.txt, which still contained the old invocation syntax. readme_history.txt shows it correctly: "" or "none". I've edited the post and release summary to reflect that.

Quote:
so I removed it and tried again with just ColorBars(848, 480):

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

I thought it was going to work as it correctly received both the audio and video stream, however it quickly stopped encoding and it generated a completely empty (0 byte) output file:

https://i.imgur.com/xDkC670.png
I couldn't grab that exact build of ffmpeg, probably because Zeranoe's forum is dead, but with the one from ffmpeg-N-93674-g1e01f66-win32-static_legacy.7z, that command works and produces a valid output on Win10.

I also started up my old WinXP/Coppermine-128 machine and tested it on there (with 3.6.0 and ffmpeg-N-93674-g1e01f66-win32-static_legacy.7z). ffmpeg.exe with the exact same command is cool with it, and ffplay.exe can play back the result of the encode.
qyot27 is offline   Reply With Quote
Old 22nd May 2020, 11:03   #164  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Download MeGUI AviSynth Wrapper test.

I think it works not only for AviSynth+ but for avs2.6 or newer in general.

Copy over the existing one.

Probably the old one bundled with MEGUI was compiled with an AviSynth CPP 2.5 header.

The bundled DLL set is a "bit" old as well.
The x64 CPP 2.5 plugins are especially outdated.

Code:
[C++ 2.5 Plugins (64 Bit)]  [Version, Time stamp]
C:\Download\MeGUI-64\tools\avisynth_plugin\ColorMatrix.dll  [2.5.0.0, 2010-03-18]
C:\Download\MeGUI-64\tools\avisynth_plugin\Decomb.dll  [n/a, 2013-12-01]
C:\Download\MeGUI-64\tools\avisynth_plugin\FluxSmooth.dll  [n/a, 2010-11-30]
C:\Download\MeGUI-64\tools\avisynth_plugin\leakkerneldeint.dll  [1.5.4.0, 2010-03-14]
C:\Download\MeGUI-64\tools\avisynth_plugin\NicAudio.dll  [n/a, 2012-01-02]
C:\Download\MeGUI-64\tools\avisynth_plugin\TDeint.dll  [1.1.0.0, 2010-03-14]
C:\Download\MeGUI-64\tools\avisynth_plugin\undot.dll  [0.0.1.1, 2006-09-19]

[C++ 2.6 Plugins (64 Bit)]  [Version, Time stamp]
C:\Download\MeGUI-64\tools\avisynth_plugin\EEDI2.dll  [0.9.2.0, 2017-11-17]
C:\Download\MeGUI-64\tools\avisynth_plugin\TimeStretch.dll  [n/a, 2016-10-20]
C:\Download\MeGUI-64\tools\avisynth_plugin\TIVTC.dll  [1.0.11.0, 2018-03-23]
C:\Download\MeGUI-64\tools\avisynth_plugin\VSFilter.dll  [3.1.0.801, 2018-09-04]
C:\Download\MeGUI-64\tools\avisynth_plugin\yadifmod2.dll  [0.0.2.0, 2017-02-21]

[Uncategorized files]  [Time stamp]
C:\Download\MeGUI-64\tools\avisynth_plugin\_versions.txt  [2018-09-08]
C:\Download\MeGUI-64\tools\avisynth_plugin\ColorMatrix.htm  [2009-01-25]
C:\Download\MeGUI-64\tools\avisynth_plugin\Decomb_Copying  [1995-10-18]
C:\Download\MeGUI-64\tools\avisynth_plugin\Decomb_FAQ.html  [2013-02-26]
C:\Download\MeGUI-64\tools\avisynth_plugin\Decomb_ReferenceManual.html  [2013-02-26]
C:\Download\MeGUI-64\tools\avisynth_plugin\DecombTutorial.html  [2013-02-26]
C:\Download\MeGUI-64\tools\avisynth_plugin\EEDI2_README.txt  [2006-06-07]
C:\Download\MeGUI-64\tools\avisynth_plugin\LeakKernelDeintHelp.html  [2005-01-19]
pinterf is offline   Reply With Quote
Old 22nd May 2020, 11:29   #165  |  Link
Zetti
Registered User
 
Join Date: Dec 2015
Posts: 306
Many Thanks pinterf

The wrapper test works fine for my needs.
Zetti is offline   Reply With Quote
Old 22nd May 2020, 12:04   #166  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
Download MeGUI AviSynth Wrapper test[/URL].
Don't know if a coincidence but after replacing file, MeGUI_x64 asked me to update AVS+ to 3.5 r3106 with release date 01/05/2020.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd May 2020, 12:42   #167  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by tormento View Post
Don't know if a coincidence but after replacing file, MeGUI_x64 asked me to update AVS+ to 3.5 r3106 with release date 01/05/2020.
Dunno, it wasn't me Did they update the plugin set as well?
pinterf is offline   Reply With Quote
Old 22nd May 2020, 12:48   #168  |  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 qyot27 View Post
The message is from SetMaxCPU, not FFmpeg. It passes through the clip messages from AviSynth to stdout.

I had just copied the Changelog entries as-is out of readme.txt, which still contained the old invocation syntax. readme_history.txt shows it correctly: "" or "none". I've edited the post and release summary to reflect that.


I couldn't grab that exact build of ffmpeg, probably because Zeranoe's forum is dead, but with the one from ffmpeg-N-93674-g1e01f66-win32-static_legacy.7z, that command works and produces a valid output on Win10.

I also started up my old WinXP/Coppermine-128 machine and tested it on there (with 3.6.0 and ffmpeg-N-93674-g1e01f66-win32-static_legacy.7z). ffmpeg.exe with the exact same command is cool with it, and ffplay.exe can play back the result of the encode.
Well, the thing is that on Win10 x64 on the very same machine I didn't have any issues, so it must be something with XP even though it works fine on your end. Is there something else I can use to debug to find a better answer other than "ACCESS VIOLATION"?
By the way, here's the complete list of XP-Compatible ffmpeg builds made by Reino: https://rwijnsma.home.xs4all.nl/files/ffmpeg/?C=M;O=D
FranceBB is offline   Reply With Quote
Old 22nd May 2020, 12:50   #169  |  Link
kalehrl
Registered User
 
Join Date: Feb 2011
Posts: 331
Too bad Zathor stopped developing MeGUI.
kalehrl is offline   Reply With Quote
Old 22nd May 2020, 13:20   #170  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by pinterf View Post
Dunno, it wasn't me Did they update the plugin set as well?

Nope. It sorta triggered something...
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd May 2020, 13:49   #171  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by FranceBB View Post
Well, the thing is that on Win10 x64 on the very same machine I didn't have any issues, so it must be something with XP even though it works fine on your end. Is there something else I can use to debug to find a better answer other than "ACCESS VIOLATION"?
By the way, here's the complete list of XP-Compatible ffmpeg builds made by Reino: https://rwijnsma.home.xs4all.nl/files/ffmpeg/?C=M;O=D
Have you tried both the xp installer and the fileonly versions (just to exclude a wrongly packaged dll version)?
pinterf is offline   Reply With Quote
Old 22nd May 2020, 15:42   #172  |  Link
Zathor
Registered User
 
Join Date: Nov 2009
Posts: 2,405
Quote:
Originally Posted by pinterf View Post
Download MeGUI AviSynth Wrapper test.

I think it works not only for AviSynth+ but for avs2.6 or newer in general.

Copy over the existing one.

Probably the old one bundled with MEGUI was compiled with an AviSynth CPP 2.5 header.
Thank you very much. Sadly it does not work for me with AVS+ r3106 installed. The internal check in AviSynthWrapper.cpp:468 returns NULL and therefore MeGUI assumes that the DLL and/or the installed AviSynth version are outdated. Do you mind to share the source code?

And yes, the wrapper is/was still using the interface 3 as the interface 6 from AVS+ does have the issue that in MeGUI the FFMS filter cannot show the input preview - it is black (lsmash does work). You need to refresh the preview again to show it properly (and yes, using 8bit input files). I was too lazy to rewrite the preview to trigger a new input bitmap when the first one is completly black.
Btw. the wrapper is only used for some internal functions (preview, deint check, audio encoding) but not when encoding the video.
In any case I am not very much familiar with C++ so I did not had the chance to improve the wrapper much. Likely there are way better methods to serve the data to MeGUI.
Zathor is offline   Reply With Quote
Old 22nd May 2020, 16:11   #173  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,419
Quote:
Originally Posted by FranceBB View Post
Well, the thing is that on Win10 x64 on the very same machine I didn't have any issues, so it must be something with XP even though it works fine on your end. Is there something else I can use to debug to find a better answer other than "ACCESS VIOLATION"?
I don't know. My experience using a debugger is restricted to gdb, which won't work with the MSVC builds.

Quote:
By the way, here's the complete list of XP-Compatible ffmpeg builds made by Reino: https://rwijnsma.home.xs4all.nl/files/ffmpeg/?C=M;O=D
I know; that's where I downloaded it from.
qyot27 is offline   Reply With Quote
Old 22nd May 2020, 16:15   #174  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
Quote:
Originally Posted by Zathor View Post
Thank you very much. Sadly it does not work for me with AVS+ r3106 installed. The internal check in AviSynthWrapper.cpp:468 returns NULL and therefore MeGUI assumes that the DLL and/or the installed AviSynth version are outdated.
I had the same problem and found that not all the 7Z file was unpacked and the AviSynth was missing in the internal folders. Just unpack the file in the update manually.
__________________
@turment on Telegram
tormento is offline   Reply With Quote
Old 22nd May 2020, 16:21   #175  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by Zathor View Post
Thank you very much. Sadly it does not work for me with AVS+ r3106 installed. The internal check in AviSynthWrapper.cpp:468 returns NULL and therefore MeGUI assumes that the DLL and/or the installed AviSynth version are outdated. Do you mind to share the source code?

And yes, the wrapper is/was still using the interface 3 as the interface 6 from AVS+ does have the issue that in MeGUI the FFMS filter cannot show the input preview - it is black (lsmash does work). You need to refresh the preview again to show it properly (and yes, using 8bit input files). I was too lazy to rewrite the preview to trigger a new input bitmap when the first one is completly black.
Btw. the wrapper is only used for some internal functions (preview, deint check, audio encoding) but not when encoding the video.
In any case I am not very much familiar with C++ so I did not had the chance to improve the wrapper much. Likely there are way better methods to serve the data to MeGUI.
Hi, now that thing is interesting, I wonder why 3106 does not work.

btw is there any chance that the project move from sourceforge to github?

The source is here. Header files copy, a new ifdef and build.
Source:
https://drive.google.com/open?id=1zW...nLf8I4SHctdsrc

Are you using the C interface as well?
pinterf is offline   Reply With Quote
Old 22nd May 2020, 16:27   #176  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Ahh got it!
You can use the header file but please use
pstr->env = CreateScriptEnvironment(AVISYNTH_CLASSIC_INTERFACE_VERSION)
instead of
pstr->env = CreateScriptEnvironment(AVISYNTH_INTERFACE_VERSION);

This AVISYNTH_INTERFACE_VERSION comes from the actual avisynth.h but since this avisynth.h is "universal" and defines the actual IF version, you should use a former one.
I put the enum AVISYNTH_CLASSIC_INTERFACE_VERSION in the header for this very reason.

With this technique both former Avs 2.6 and Avs+ and current 3.6 will work and you'll get the environment properly.

EDIT: there are another places, altogether 4.
EDIT2:
I saw you are using v141_xp toolset, this only may not be enough for XP, this is usually needed:
/Zc:threadSafeInit-
to be put into the additional compiler flags


EDIT3:
Avisynth wrapper binaries (using only V6 restriction + WinXP additional safety flag)
https://drive.google.com/open?id=1Jf...0eXQEDCC3vUdN4
Source
https://drive.google.com/open?id=18t...-7hv5qMqDojYXp

Last edited by pinterf; 22nd May 2020 at 16:43.
pinterf is offline   Reply With Quote
Old 22nd May 2020, 17:18   #177  |  Link
tormento
Acid fr0g
 
tormento's Avatar
 
Join Date: May 2002
Location: Italy
Posts: 2,542
@pinterf
@Zathor

After some testing I confirm that older AVS+ doesn't work.

To stop the update request, do it once and copy AviSynth.dll from the update_cache\avisynthplus-3.5.1-64.7z to MeGUI\tools\avs and set it read only or MeGUI will delete it at every run (strange...).

Problem is when you add AVS script, it will tell you AviSynth 2.6 required as error.

With latest external AviSynth, no problems at all (you have anyway to put the read only AVS the same).
__________________
@turment on Telegram

Last edited by tormento; 22nd May 2020 at 17:22.
tormento is offline   Reply With Quote
Old 22nd May 2020, 17:20   #178  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Quote:
Originally Posted by tormento View Post
@pinterf
@Zathor

After some testing I confirm that older AVS+ doesn't work.

To stop the update request, do it once and copy AviSynth.dll from the update_cache\avisynthplus-3.5.1-64.7z to MeGUI\tools\avs and put it read only or MeGUI will delete it at every run (strange...).

Problem is when you add AVS script, it will tell you AviSynth 2.6 required as error.

With latest external AviSynth, no problems at all.
Have you tried the binaries in my previous post?
pinterf is offline   Reply With Quote
Old 22nd May 2020, 18:24   #179  |  Link
stax76
Registered User
 
stax76's Avatar
 
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
Maybe somebody can help with some errors I get with the new headers.

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'avs/cpuid.h': No such file or directory FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1337
Error C2365 'paAppend': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1163
Error C2365 'paReplace': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1162
Error C2365 'paTouch': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1164
Error C2365 'peIndex': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1158
Error C2365 'peType': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1157
Error C2365 'peUnset': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1156
Error C2365 'ptData': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1149
Error C2365 'ptFloat': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1148
Error C2365 'ptFrame': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1151
Error C2365 'ptInt': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1147
Error C2365 'ptUnset': redefinition; previous definition was 'enumerator' FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1146
Error C1083 Cannot open include file: 'avs/cpuid.h': No such file or directory FrameServer D:\Projekte\VB\staxrip\FrameServer\avisynth.h 1337

https://github.com/staxrip/staxrip
stax76 is offline   Reply With Quote
Old 22nd May 2020, 18:32   #180  |  Link
pinterf
Registered User
 
Join Date: Jan 2014
Posts: 2,309
Replace "avs/cpuid.h" instead of <avs/cpuid.h>
pinterf 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 05:42.


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