Log in

View Full Version : Help compiling filter from 2015


Corpsecreate
4th February 2024, 08:08
Hi all,

So basically I wrote 2 filters in C++ back in 2015 and compiled the code into a .dll file. The code for both filters were contained within the same project file I was working with in Visual Studio (I think?). Here I am 9 years later, having not really touched Avisynth at all since then, and I haven't the faintest idea on how all of this stuff fits together anymore. My compiled dll doesn't seem to work for some reason in Avisynth across multiple machines, and I don't recall how to take my source code and re-compile everything into a new dll.

I've zipped the project file and it's available for download here: https://mega.nz/file/NMcklR7R#n_v5K6wkrGIyDeXg_N9Kpr4xACgrhnaWFDqxAp0hzxE

I was hoping that someone on this forum who is much more experienced than me might be able to give me some pointers on how to compile the dll using the attached source code files or better still, having a go at it themselves. I imagine a fair amount has changed since 2015 so perhaps the process is easier now? The two filters that should be accessible within avisynth are named "CustomMatrix" and "AnalyzeLevels". The former will remap colours of a video saimilar to Rec601 -> Rec709 conversions but with some custom coefficients, and the latter will scan a video and output summary statistics around the black/white levels. It would be amazing if someone could help with this! It's been on my mind for literally multiple years.

lvqcl
4th February 2024, 09:23
Hi all,
My compiled dll doesn't seem to work for some reason in Avisynth across multiple machines

This DLL requires MSVS 2012 redist. Maybe it's not installed on those computers.

Corpsecreate
4th February 2024, 10:12
This DLL requires MSVS 2012 redist. Maybe it's not installed on those computers.

Absolute legend. This legit worked straight away first try without any hassle. Unbelievable that it was this simple to fix all along.

Now I have to weigh up whether it's worth learning how to make new filters in C++ since I don't have much of a need for it anymore haha. Thank you so much!

qyot27
7th February 2024, 21:04
If you want filters to be broadly compatible across compilers, use the C plugin interface. C++ plugins built by GCC or Clang in its default GCC-mimicking mode aren't usable with an AviSynth+ host built with MSVC, and vice-versa. C plugins don't have that problem (and the minor name decoration differences between MSVC and GCC can be #define'd away).

Separately, just making sure the source can compile with GCC and/or Clang is also useful for getting the plugin ported to Linux or macOS, etc.