View Full Version : AviSynth+ 3.5: Linux, macOS, and BSD support


qyot27
3rd March 2020, 03:39
AviSynth+ version 3.5 marks the first release with native support for non-Windows OSes.

For the past few weeks, this has been getting tested and polished over at the Github repo. There's a few lingering issues that will have to wait for 3.5.1, but the important part is that the AviSynth+ core can now be built and used natively on Linux, macOS, and BSD. As of right now, the only source filter that can be used is FFMS2's C++ plugin.

Tested platforms:
Ubuntu 19.10
macOS 15.3 High Sierra and 15.4 Mojave
FreeBSD 12.1

There is no currently no automatic detection of autoloaded plugins. You'll need to use AddAutoloadDir (on macOS and BSD, AddAutoloadDir currently throws an exception, but LoadPlugin works correctly).

More detailed build instructions can be found in the AviSynth+ documentation (https://github.com/AviSynth/AviSynthPlus/blob/master/distrib/docs/english/source/avisynthdoc/contributing/posix.rst).

microchip8
3rd March 2020, 05:08
Nice! This is a major milestone!

StainlessS
3rd March 2020, 09:13
A big day indeed, thanks very much to all concerned.

FranceBB
3rd March 2020, 10:50
What an achievement!
For years and years Avisynth has been a Windows only frameserver and people on Linux had to rely on either using AVXSynth (which never got as many things as Avisynth+) or running AVS with wine and just hope. Today is definitely a truly remarkable day which extends the platforms supported and hopefully the Avisynth userbase along with the Doom9 one.

Well done indeed, guys!

StainlessS
3rd March 2020, 12:33
I'm gettin' this on build attempt Cinnamon Mint 19.3 Tricia x64.


steve@Plex-780:~$ git clone git://github.com/AviSynth/AviSynthPlus.git && \
> cd AviSynthPlus && \
> mkdir avisynth-build && \
> cd avisynth-build && \
>
> CC=gcc CXX=g++ LD=gcc cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && \
> ninja && \
> sudo ninja install
Cloning into 'AviSynthPlus'...
remote: Enumerating objects: 408, done.
remote: Counting objects: 100% (408/408), done.
remote: Compressing objects: 100% (246/246), done.
remote: Total 24585 (delta 254), reused 261 (delta 162), pack-reused 24177
Receiving objects: 100% (24585/24585), 31.05 MiB | 186.00 KiB/s, done.
Resolving deltas: 100% (16849/16849), done.
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/AviSynthPlus/avisynth-build
[12/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
FAILED: avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
/usr/bin/g++ -DAvsCore_EXPORTS -DBUILDING_AVSCORE -I../avs_core/include -Iavs_core -fpermissive -msse2 \
-Wl,--no-undefined -fPIC -std=c++1z -MD -MT avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o \
-MF avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o.d \
-o avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -c ../avs_core/core/PluginManager.cpp
../avs_core/core/PluginManager.cpp:8:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
[17/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/convert/convert.cpp.o
ninja: build stopped: subcommand failed.
steve@Plex-780:~/AviSynthPlus/avisynth-build$


Something I'm doin' wrong ?

EDIT: Edited for D9 Screen wrap, wide post.

EDIT: I also got this, dont know if matters

steve@Plex-780:~$ sudo apt-get update
Ign:1 http://packages.linuxmint.com tricia InRelease
Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease
Hit:4 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:7 http://dl.google.com/linux/earth/deb stable InRelease
Hit:8 http://dl.google.com/linux/earth/deb stable Release
Get:10 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease [15.4 kB]
Hit:11 https://repo.skype.com/deb stable InRelease
Hit:12 http://packages.linuxmint.com tricia Release
Get:14 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main i386 Packages [21.7 kB]
Get:15 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 Packages [23.1 kB]
Get:16 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main Translation-en [8,980 B]
Fetched 69.2 kB in 24s (2,888 B/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/earth/deb stable InRelease' doesn't support architecture 'i386'


Sourcefile PluginManager.cpp exists, but not the .o file.
https://i.postimg.cc/dhcQj3hG/Screenshot-from-2020-03-03-11-53-41.png (https://postimg.cc/dhcQj3hG)

/home/steve/AviSynthPlus/avisynth-build/avs_core/CMakeFiles/AvsCore.dir directory contains

parser [folder]
AviHelper.cpp.o
BufferPool.cpp.o
FilterConstructor.cpp.o
MTGuard.cpp.o
Prefetcher.cpp.o
ThreadPool.cpp.o


Is it related to this
There is no currently no automatic detection of autoloaded plugins. You'll need to use AddAutoloadDir (on macOS and BSD, AddAutoloadDir currently throws an exception, but LoadPlugin works correctly).

qyot27
3rd March 2020, 13:31
The CC/CXX/LD overrides likely need to use 'gcc-9/g++-9' so it sees the correct version of GCC (assuming that you've installed the gcc-9 package). 19.04 and distros based on it are the earliest that can build AviSynth+ with the version of GCC provided in the main repositories, because support for C++17 (to be able to use the filesystem library) was only added in GCC 8.

That warning/error message in sudo apt-get update was from the Google Earth repository, so no, nothing to do with this.

StainlessS
3rd March 2020, 14:59
OK, I've re-installed compiler again,


steve@Plex-780:~$ sudo apt-get install build-essential cmake git ninja-build checkinstall
[sudo] password for steve:
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
checkinstall is already the newest version (1.6.2-4ubuntu2).
ninja-build is already the newest version (1.8.2-1).
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
git is already the newest version (1:2.17.1-1ubuntu0.5).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
steve@Plex-780:~$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
You are about to add the following PPA:
Toolchain test builds; see https://wiki.ubuntu.com/ToolChain

More info: https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test
Press Enter to continue or Ctrl+C to cancel

Executing: /tmp/apt-key-gpghome.7YLFPl4fzu/gpg.1.sh --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 60C317803A41BA51845E371A1E9377A2BA9EF27F
gpg: key 1E9377A2BA9EF27F: "Launchpad Toolchain builds" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
steve@Plex-780:~$ sudo apt-get update
Hit:1 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease
Ign:2 http://mirrors.evowise.com/linuxmint/packages tricia InRelease
Hit:3 http://archive.canonical.com/ubuntu bionic InRelease
Hit:4 http://mirrors.evowise.com/linuxmint/packages tricia Release
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:7 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:8 http://dl.google.com/linux/earth/deb stable InRelease
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:10 http://dl.google.com/linux/earth/deb stable Release
Hit:11 https://repo.skype.com/deb stable InRelease
Get:13 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Fetched 252 kB in 22s (11.3 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/earth/deb stable InRelease' doesn't support architecture 'i386'
steve@Plex-780:~$
steve@Plex-780:~$ sudo apt-get install build-essential cmake git ninja-build gcc-9
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
ninja-build is already the newest version (1.8.2-1).
cmake is already the newest version (3.10.2-1ubuntu2.18.04.1).
git is already the newest version (1:2.17.1-1ubuntu0.5).
gcc-9 is already the newest version (9.2.1-17ubuntu1~18.04.1).
0 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
steve@Plex-780:~$


Downed AvsPlus

steve@Plex-780:~$ git clone git://github.com/AviSynth/AviSynthPlus.git
Cloning into 'AviSynthPlus'...
remote: Enumerating objects: 408, done.
remote: Counting objects: 100% (408/408), done.
remote: Compressing objects: 100% (246/246), done.
remote: Total 24585 (delta 254), reused 261 (delta 162), pack-reused 24177
Receiving objects: 100% (24585/24585), 31.05 MiB | 169.00 KiB/s, done.
Resolving deltas: 100% (16849/16849), done.


Line by line (separately)

steve@Plex-780:~$ cd AviSynthPlus
steve@Plex-780:~/AviSynthPlus$ ls
avs_core CMakeLists.txt cmake_uninstall.cmake.in distrib GNUmakefile plugins README.md

steve@Plex-780:~/AviSynthPlus$ mkdir avisynth-build
steve@Plex-780:~/AviSynthPlus$ cd avisynth-build
steve@Plex-780:~/AviSynthPlus/avisynth-build$
steve@Plex-780:~/AviSynthPlus/avisynth-build$ ls
steve@Plex-780:~/AviSynthPlus/avisynth-build$ CC=gcc-9 CXX=g++-9 LD=gcc-9 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && ninja
-- The C compiler identification is GNU 9.2.1
CMake Error at /usr/share/cmake-3.10/Modules/CMakeDetermineCXXCompiler.cmake:47 (message):
Could not find compiler set in environment variable CXX:

g++-9.

Call Stack (most recent call first):
CMakeLists.txt:12 (project)


CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
See also "/home/steve/AviSynthPlus/avisynth-build/CMakeFiles/CMakeOutput.log".
steve@Plex-780:~/AviSynthPlus/avisynth-build$


The CC/CXX/LD overrides likely need to use 'gcc-9/g++-9' so it sees the correct version of GCC
What does that mean, I am real new to linux, and never used command line compiler since the 90's.

EDIT: executing

CC=gcc-9 CXX=g++-9 LD=gcc-9

and then

printenv

shows nothing for eg CC, dont know if it should.

EDIT:
I am real new to linux
Well, Pinterf pretty much spoke for me also
[mc pretty much always been the 1st prog I install on linux, since the 90's when I first used RedHat 6.0, I think. (Cinnamon Mint is the first version Linux that has not left me feeling disappointed, though it could still be improved)],
At least for someone (me) who is using linux in every five years for only a day or two. All I can say that Midnight Commander rulez :)

qyot27
3rd March 2020, 22:36
It looks as if that PPA has gcc-9 and g++-9 as separate packages.
sudo apt-get install g++-9
will probably make it work.

StainlessS
4th March 2020, 12:44
Install g++-9

steve@Plex-780:~$ sudo apt-get install g++-9
[sudo] password for steve:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libstdc++-9-dev
Suggested packages:
g++-9-multilib gcc-9-doc libstdc++6-9-dbg libstdc++-9-doc
The following NEW packages will be installed
g++-9 libstdc++-9-dev
0 to upgrade, 2 to newly install, 0 to remove and 0 not to upgrade.
Need to get 10.1 MB of archives.
After this operation, 46.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 libstdc++-9-dev amd64 9.2.1-17ubuntu1~18.04.1 [1,705 kB]
Get:2 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic/main amd64 g++-9 amd64 9.2.1-17ubuntu1~18.04.1 [8,366 kB]
Fetched 10.1 MB in 5min 36s (29.9 kB/s)
Selecting previously unselected package libstdc++-9-dev:amd64.
(Reading database ... 451469 files and directories currently installed.)
Preparing to unpack .../libstdc++-9-dev_9.2.1-17ubuntu1~18.04.1_amd64.deb ...
Unpacking libstdc++-9-dev:amd64 (9.2.1-17ubuntu1~18.04.1) ...
Selecting previously unselected package g++-9.
Preparing to unpack .../g++-9_9.2.1-17ubuntu1~18.04.1_amd64.deb ...
Unpacking g++-9 (9.2.1-17ubuntu1~18.04.1) ...
Setting up libstdc++-9-dev:amd64 (9.2.1-17ubuntu1~18.04.1) ...
Setting up g++-9 (9.2.1-17ubuntu1~18.04.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...


OK so far, deleted existing avisynth-build, then

steve@Plex-780:~$ dir
AviSynthPlus Desktop Documents Downloads Music Pictures Public Templates Videos
steve@Plex-780:~$ cd AviSynthPlus
steve@Plex-780:~/AviSynthPlus$ ls
avisynth-build avs_core CMakeLists.txt cmake_uninstall.cmake.in distrib GNUmakefile plugins README.md
steve@Plex-780:~/AviSynthPlus$ mkdir avisynth-build
steve@Plex-780:~/AviSynthPlus$ cd avisynth-build
steve@Plex-780:~/AviSynthPlus/avisynth-build$ ls
steve@Plex-780:~/AviSynthPlus/avisynth-build$ CC=gcc CXX=g++ LD=gcc cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && \
> ninja && \
> sudo ninja install
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/AviSynthPlus/avisynth-build
[11/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
FAILED: avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
/usr/bin/g++ -DAvsCore_EXPORTS -DBUILDING_AVSCORE -I../avs_core/include -Iavs_core -fpermissive -msse2 -Wl,--no-undefined -fPIC -std=c++1z -MD -MT avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -MF avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o.d -o avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -c ../avs_core/core/PluginManager.cpp
../avs_core/core/PluginManager.cpp:8:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
[16/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/convert/convert.cpp.o
ninja: build stopped: subcommand failed.
steve@Plex-780:~/AviSynthPlus/avisynth-build$

A bit further.

EDIT: Actually, we seem to have stopped about the same position as 1st code block in post #5.

EDIT: Just checked DistroWatch, Linux Mint 3rd most page hits for last 6 months period, so solution might assist a lot of users.
DistroWatch:- https://distrowatch.com/

DJATOM
4th March 2020, 13:00
>GNU 7.4.0
Try CC=gcc-9 CXX=g++-9 LD=gcc-9 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && ninja && sudo ninja install

StainlessS
4th March 2020, 13:04
Thanks DJATOM,

Results

steve@Plex-780:~/AviSynthPlus/avisynth-build$ CC=gcc-9 CXX=g++-9 LD=gcc-9 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && ninja && sudo ninja install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/AviSynthPlus/avisynth-build
[2/66] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
FAILED: avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
/usr/bin/g++ -DAvsCore_EXPORTS -DBUILDING_AVSCORE -I../avs_core/include -Iavs_core -fpermissive -msse2 -Wl,--no-undefined -fPIC -std=c++1z -MD -MT
avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -MF avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o.d
-o avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -c ../avs_core/core/PluginManager.cpp
../avs_core/core/PluginManager.cpp:8:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
[7/66] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/avisynth.cpp.o
../avs_core/core/avisynth.cpp: In member function ‘virtual char* ScriptEnvironment::VSprintf(const char*, void*)’:
../avs_core/core/avisynth.cpp:3142:50: warning: ISO C++ forbids casting to an array type ‘va_list {aka __va_list_tag [1]}’ [-fpermissive]
std::string str = FormatString(fmt, (va_list)val);
^~~
ninja: build stopped: subcommand failed.
steve@Plex-780:~/AviSynthPlus/avisynth-build$


EDIT: Edited a line for line wrap

pinterf
4th March 2020, 13:19
If you are getting that missing <filesystem> error you are still at gcc version less than 8

StainlessS
4th March 2020, 13:21
Well no idea what to do about that. :)
The GNU 7.4 and 9.0 stuff had me confused from the start.
I have to leave home soon, I will probably be on-line, but mobile.

DJATOM
4th March 2020, 13:23
Probably CMakeCache related stuff, so delete all contents from build folder and configure again.

DJATOM
4th March 2020, 13:41
Tried with my server, looks like my method works (I'm just lazy to search for gcc-9 mirrors for debian buster or build gcc locally, so used gcc-8 on my end)
djatom@atomch-server:~/AviSynthPlus/avsplus-build$ CC=gcc-8 CXX=g++-8 LD=gcc-8 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && ninja
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/gcc-8
-- Check for working C compiler: /usr/bin/gcc-8 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-8
-- Check for working CXX compiler: /usr/bin/g++-8 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.20.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/djatom/AviSynthPlus/avsplus-build
[34/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/avisynth.cpp.o
../avs_core/core/avisynth.cpp: In member function ‘virtual char* ScriptEnvironment::VSprintf(const char*, void*)’:
../avs_core/core/avisynth.cpp:3142:50: warning: ISO C++ forbids casting to an array type ‘va_list’ {aka ‘__va_list_tag [1]’} [-fpermissive]
std::string str = FormatString(fmt, (va_list)val);
^~~
[79/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/filters/exprfilter/exprfilter.cpp.o
In file included from ../avs_core/filters/exprfilter/exprfilter.cpp:109:
../avs_core/filters/exprfilter/jitasm.h:8224:52: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<int N> struct ArgTraits_cdecl<N, __m64, 8> {enum {stack_size = 0, flag = ARG_IN_MMX | ARG_TYPE_VALUE, reg_id = MM0};};
^
../avs_core/filters/exprfilter/jitasm.h:8229:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
template<int N> struct ArgTraits_cdecl<N, __m128, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_SP | ARG_TYPE_VALUE, reg_id = XMM0};};
^
../avs_core/filters/exprfilter/jitasm.h:8234:55: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
template<int N> struct ArgTraits_cdecl<N, __m128d, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_DP | ARG_TYPE_VALUE, reg_id = XMM0};};
^
../avs_core/filters/exprfilter/jitasm.h:8237:55: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
template<int N> struct ArgTraits_cdecl<N, __m128i, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_INT | ARG_TYPE_VALUE, reg_id = XMM0};};
^
../avs_core/filters/exprfilter/jitasm.h:8294:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<> struct ArgTraits_win64<0, __m64, 8> : ArgTraits_win64_reg<RCX, ARG_IN_REG | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8295:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<> struct ArgTraits_win64<1, __m64, 8> : ArgTraits_win64_reg<RDX, ARG_IN_REG | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8296:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<> struct ArgTraits_win64<2, __m64, 8> : ArgTraits_win64_reg<R8, ARG_IN_REG | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8297:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<> struct ArgTraits_win64<3, __m64, 8> : ArgTraits_win64_reg<R9, ARG_IN_REG | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8357:67: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
template<int N> struct ArgTraits_linux64<N, __m64, sizeof(__m64)> : ArgTraits_linux64_sse<ARG_IN_XMM_INT | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8360:69: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
template<int N> struct ArgTraits_linux64<N, __m128, sizeof(__m128)> : ArgTraits_linux64_sse<ARG_IN_XMM_SP | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8363:70: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
template<int N> struct ArgTraits_linux64<N, __m128d, sizeof(__m128d)> : ArgTraits_linux64_sse<ARG_IN_XMM_DP | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8364:70: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
template<int N> struct ArgTraits_linux64<N, __m128i, sizeof(__m128i)> : ArgTraits_linux64_sse<ARG_IN_XMM_INT | ARG_TYPE_VALUE> {};
^
../avs_core/filters/exprfilter/jitasm.h:8742:25: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
struct ResultT<__m64, 8> {
^
../avs_core/filters/exprfilter/jitasm.h:8774:27: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
struct ResultT<__m128, 16> {
^
../avs_core/filters/exprfilter/jitasm.h:8798:28: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
struct ResultT<__m128d, 16> {
^
../avs_core/filters/exprfilter/jitasm.h:8820:28: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
struct ResultT<__m128i, 16> {
^
../avs_core/filters/exprfilter/jitasm.h:9081:22: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
struct Arg<__m64, 8>
^
../avs_core/filters/exprfilter/jitasm.h:9149:24: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
struct Arg<__m128, 16>
^
../avs_core/filters/exprfilter/jitasm.h:9199:36: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
template<> struct Arg<__m128d, 16> : Arg<__m128, 16> {
^
../avs_core/filters/exprfilter/jitasm.h:9199:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
template<> struct Arg<__m128d, 16> : Arg<__m128, 16> {
^
../avs_core/filters/exprfilter/jitasm.h: In constructor ‘jitasm::detail::calling_convention_cdecl::Arg<__vector(2) double, 16>::Arg(jitasm::Frontend&, const jitasm::detail::ArgInfo&)’:
../avs_core/filters/exprfilter/jitasm.h:9200:62: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
Arg(Frontend& f, const ArgInfo& arg_info) : Arg<__m128, 16>(f, arg_info) {}
^
../avs_core/filters/exprfilter/jitasm.h: At global scope:
../avs_core/filters/exprfilter/jitasm.h:9203:36: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
template<> struct Arg<__m128i, 16> : Arg<__m128, 16> {
^
../avs_core/filters/exprfilter/jitasm.h:9203:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
template<> struct Arg<__m128i, 16> : Arg<__m128, 16> {
^
../avs_core/filters/exprfilter/jitasm.h: In constructor ‘jitasm::detail::calling_convention_cdecl::Arg<__vector(2) long long int, 16>::Arg(jitasm::Frontend&, const jitasm::detail::ArgInfo&)’:
../avs_core/filters/exprfilter/jitasm.h:9204:62: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
Arg(Frontend& f, const ArgInfo& arg_info) : Arg<__m128, 16>(f, arg_info) {}
^
[80/80] Linking CXX shared library avs_core/libavisynth.so

sl1pkn07
4th March 2020, 13:52
https://aur.archlinux.org/packages/avisynthplus-git/

done in [AUR]

Richard1485
4th March 2020, 15:17
Many thanks to those involved in making this happen! AviSynth+ installed first time on pop!_os 19.10 (based on Ubuntu 19.10.)

In respect of ffmpeg, which repo is the "Sources" repo mentioned in the instructions? Here's the relevant portion of sources.list.


# deb cdrom:[Pop_OS 19.10 _Eoan Ermine_ - Release amd64 (20191019)]/ eoan main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ eoan main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ eoan-backports main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ eoan main restricted universe multiverse
deb http://apt.pop-os.org/proprietary eoan main
# deb-src http://apt.pop-os.org/proprietary eoan main


I know how to uncomment, but I'm not sure which one is meant. Perhaps it's enabled by default.

pinterf
4th March 2020, 15:27
I have uncommented all, then did a sudo apt-get update

Richard1485
4th March 2020, 15:46
Thanks. I did the same, and build-dep ffmpeg, nasm, and libsdl2-dev installed fine; but my curiousity as to which repo is envisaged by the instructions remains. (I've only ever edited sources.list to add repos -- never used a graphical interface.)

magiblot
4th March 2020, 16:25
EDIT: executing

CC=gcc-9 CXX=g++-9 LD=gcc-9

and then

printenv

shows nothing for eg CC, dont know if it should.


These variable definitions may only affect the current statement. For them to be persistent, you need to use export (assuming your shell is bash):

export CC=gcc-9 CXX=g++-9 LD=gcc-9

https://aur.archlinux.org/packages/avisynthplus-git/

done in [AUR]
:thanks:

StainlessS
4th March 2020, 17:03
Thanx magiblot, I have no idea what my shell is, but assume bash.
(Had mint installed for several months(maybe 6, maybe 9), only ever updated it, done nothing else).
EDIT: almost nothing else, sometimes Ive used it as a browser. [I never seem to have time for anything else]

MOBILE:

EDIT: Powerhouse Porter is great, Adnams Broadside next, lubbely :)

qyot27
4th March 2020, 17:36
Thanks DJATOM,

Results

steve@Plex-780:~/AviSynthPlus/avisynth-build$ CC=gcc-9 CXX=g++-9 LD=gcc-9 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && ninja && sudo ninja install
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/AviSynthPlus/avisynth-build
[2/66] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
FAILED: avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o
/usr/bin/g++ -DAvsCore_EXPORTS -DBUILDING_AVSCORE -I../avs_core/include -Iavs_core -fpermissive -msse2 -Wl,--no-undefined -fPIC -std=c++1z -MD -MT
avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -MF avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o.d
-o avs_core/CMakeFiles/AvsCore.dir/core/PluginManager.cpp.o -c ../avs_core/core/PluginManager.cpp
../avs_core/core/PluginManager.cpp:8:10: fatal error: filesystem: No such file or directory
#include <filesystem>
^~~~~~~~~~~~
compilation terminated.
[7/66] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/avisynth.cpp.o
../avs_core/core/avisynth.cpp: In member function ‘virtual char* ScriptEnvironment::VSprintf(const char*, void*)’:
../avs_core/core/avisynth.cpp:3142:50: warning: ISO C++ forbids casting to an array type ‘va_list {aka __va_list_tag [1]}’ [-fpermissive]
std::string str = FormatString(fmt, (va_list)val);
^~~
ninja: build stopped: subcommand failed.
steve@Plex-780:~/AviSynthPlus/avisynth-build$


EDIT: Edited a line for line wrap

CMake can't reconfigure compilers after you've already configured it for a different set.

Looks like I need to make the instructions a little more explicit. I'd been in a bit of a rush when I wrote that up and neglected to actually put down the build instructions for AviSynth+ on Ubuntu.

StainlessS
4th March 2020, 18:00
little more explicit.

Yep, good idea for us tards :)

Richard1485
4th March 2020, 18:24
I'd been in a bit of a rush when I wrote that up and neglected to actually put down the build instructions for AviSynth+ on Ubuntu.

In that case, I must have run the instructions for macOS. I thought that there was a gap in the guide but interpreted it to mean that after the prerequisites had been satisfied, the build instructions were the same for macOS and Ubuntu.

qyot27
4th March 2020, 19:27
Well, truth be told, I prefer Ninja anyway, so even on Ubuntu I still use it (on macOS it's a little more important to use Ninja because of weirdness concerning the Apple binutils and linking to libstc++). The major difference is that on 19.10, there's no need to override CC/CXX/LD because you're already using GCC 9.

For 19.04 and 19.10:
git clone git://github.com/AviSynth/AviSynthPlus.git
cd AviSynthPlus
mkdir avisynth-build
cd avisynth-build

cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive"
ninja
sudo checkinstall --pkgname=avisynth --pkgversion="$(grep -r \
Version avs_core/avisynth.pc | cut -f2 -d " ")-$(date --rfc-3339=date | \
sed 's/-//g')-git" --backup=no --deldoc=yes --delspec=yes --deldesc=yes \
--strip=yes --fstrans=no --default ninja install

Or if you'd rather use regular old GNU make:

git clone git://github.com/AviSynth/AviSynthPlus.git
cd AviSynthPlus
mkdir avisynth-build
cd avisynth-build

cmake ../ -DCMAKE_CXX_FLAGS="-fpermissive"
make -j$(nproc)
sudo checkinstall --pkgname=avisynth --pkgversion="$(grep -r \
Version avs_core/avisynth.pc | cut -f2 -d " ")-$(date --rfc-3339=date | \
sed 's/-//g')-git" --backup=no --deldoc=yes --delspec=yes --deldesc=yes \
--strip=yes --fstrans=no --default

For 18.04, after adding the PPA mentioned and installing the gcc-9 and g++-9 packages, the only difference for both of the above examples would be tacking CC=gcc-9 CXX=g++-9 LD=gcc-9 onto the front of the cmake command, just like on Mac.

Richard1485
4th March 2020, 19:54
If I used the macOS instructions as opposed to the Ubuntu ones just posted, do I have to uninstall and reinstall with the latter?

qyot27
4th March 2020, 20:06
Not really, the only substantive difference is checkinstall, which doesn't affect the actual running of anything (it just supervises the install process, makes a deb package and actually registers it in dpkg/apt so it can be handled with the package management system). If you didn't use checkinstall, you probably do need to run sudo ldconfig after sudo make install, though.

reisub
4th March 2020, 20:18
I can `t believe my eyes. Avisynt + released on * NIX. This is amazing.
https://aur.archlinux.org/packages/avisynthplus-git/

done in [AUR]
Thanks!

Richard1485
4th March 2020, 20:20
If you didn't use checkinstall, you probably do need to run sudo ldconfig after sudo make install, though.

Yeah, I didn't use checkinstall. I ran sudo ninja install in accordance with the macOS instructions, so I'll just run sudo ldconfig.

pinterf
4th March 2020, 21:16
I can only encourage all not-so-commandline hero Windows guys to plunge into this another world. StainlessS, it's not magic (haha, yes, it is)

I apologize from those who are using linux regularly but the first steps are always hard for a beginner, even if I have already used it many years ago for some days. When you say that one should simply "configure again", everybody understands except poor us, without a context this simple sentence means nothing for us. One simple additional sentence or hint can spare us hours :)

My learning curve in brief.

I'm on Windows 10. Downloaded and installed the 18.04 WSL Ubuntu app (https://wiki.ubuntu.com/WSL) (!), upgraded to 19.10 (https://www.how2shout.com/how-to/how-to-upgrade-ubuntu-18-04-to-19-10-on-windows-10-linux-subsystem.html).

Fortunately I had zero problems with GCC, I got version 9 ready.

Since I put a non-final test username at the installation time I then spent some hours with altering the default user who logins when I start the Ubuntu app. (Yes, Windows registry). I even learned the su command.

Then I got Midnight Commander, learned about nano (a text editor here, read about it on SO), configured git, and with qyot27's help I was able to build ffmpeg and avisynth+. Some problematic steps in the learning curve were the rights, such as using MC CTRL-X C for setting execute rights on files, keyboard commands of nano, that the letter M means ALT key in nano's help, frequently using that sudo thing for getting elevated rights. And there was a familiar thing: using the TAB key(s) I could easily auto-complete the commands or file and directory names. And finally: the file system is nicely mapped and accessible from Windows under \\wsl$\Ubuntu-18.04\ folder.

It's so simple, you are using Windows _and_ can have a couple of Ubuntu terminal windows.

One with avisynth build directory, another one with test avs scripts and ffmpeg, a third one with nano, a fourth console with mc to copy this and that.

pinterf
4th March 2020, 21:20
And a question: I have an AVX2 capable processor but the Info() filter tells me that Avisynth+ is seeing only up to AVX. However when I cat the processor features in the console I can see there AVX2.
I wonder if AVX2 detection fails only for me (because of WSL) or it has a generic problem.

Richard1485
4th March 2020, 21:34
So, for installing ffmpeg on Ubuntu, the instructions say to leave out the --prefix option and add a checkinstall command. If I've understood correctly, this should be right:


./configure --enable-gpl --enable-version3 \
--disable-doc --disable-debug --enable-pic --enable-avisynth && \
make -j$(nproc) && \
sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(git rev-list \
--count HEAD)-g$(git rev-parse --short HEAD)" --backup=no --deldoc=yes \
--delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes \
--fstrans=no --default

DJATOM
4th March 2020, 22:02
https://i.imgur.com/briNfH4.png
OS: Debian 10.3, CPU: i3-8100.
It seems there is no AVX2 detection on my side.

qyot27
4th March 2020, 22:27
So, for installing ffmpeg on Ubuntu, the instructions say to leave out the --prefix option and add a checkinstall command. If I've understood correctly, this should be right:


./configure --enable-gpl --enable-version3 \
--disable-doc --disable-debug --enable-pic --enable-avisynth && \
make -j$(nproc) && \
sudo checkinstall --pkgname=ffmpeg --pkgversion="7:$(git rev-list \
--count HEAD)-g$(git rev-parse --short HEAD)" --backup=no --deldoc=yes \
--delspec=yes --deldesc=yes --strip=yes --stripso=yes --addso=yes \
--fstrans=no --default


Yes, if you want that FFmpeg installed to the system. I set the instructions up to have FFmpeg installed to $HOME (which can be installed with just make install because you own that directory and don't want to be using sudo there) because I didn't want to get into the weeds of all the other things distros compile into FFmpeg (if you want libxvid, libx264, libx265, libdav1d, libaom, libopus, mbedtls, etc.). I kept it down to strictly what it takes for an AviSynth-supporting build, so that if you'd rather have a more fully-featured FFmpeg on the system, they won't conflict with each other.

If you're adventurous/patient enough to go through and make sure the builds are equivalent (or you don't care about any of those other external libraries), then installing to the system should be fine. sudo apt-get build-dep ffmpeg would have gotten you most of the way there, dependency-wise, so you could then use ffmpeg -buildconf and copy the configuration options over to the avsplus_linux patched version.

Ubuntu (well, Debian) configures its FFmpeg package with --enable-avisynth, so once the situation about switching away from AvxSynth gets resolved, there will be a point where we don't have to cover FFmpeg in the Ubuntu section of the docs. It'll just work once you install AviSynth+.

Richard1485
4th March 2020, 23:33
That all makes sense. I noticed in the past that after building ffmpeg, there can be issues with other programs that expect to see certain versions of libraries. For now, I'll stick to installing to $HOME. Unfortunately, an error appears during make. This is where the error occurs:


AR libavdevice/libavdevice.a
AR libavfilter/libavfilter.a
AR libavformat/libavformat.a
AR libpostproc/libpostproc.a
AR libavcodec/libavcodec.a
AR libswresample/libswresample.a
AR libswscale/libswscale.a
CC libavutil/hwcontext_cuda.o
CC libavutil/integer.o
CC libavutil/intmath.o
CC libavutil/lfg.o
CC libavutil/lls.o
CC libavutil/log.o
CC libavutil/log2_tab.o
CC libavutil/lzo.o
CC libavutil/mastering_display_metadata.o
CC libavutil/mathematics.o
CC libavutil/md5.o
In file included from libavutil/hwcontext_cuda.c:27:
libavutil/hwcontext_cuda.c: In function ‘cuda_device_uninit’:
libavutil/hwcontext_cuda.c:300:28: error: ‘CudaFunctions’ {aka ‘struct CudaFunctions’} has no member named ‘cuDevicePrimaryCtxRelease’
300 | CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
| ^~
libavutil/cuda_check.h:62:114: note: in definition of macro ‘FF_CUDA_CHECK_DL’
62 | #define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x)
| ^
libavutil/hwcontext_cuda.c:300:17: note: in expansion of macro ‘CHECK_CU’
300 | CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device));
| ^~~~~~~~
libavutil/hwcontext_cuda.c: In function ‘cuda_context_init’:
libavutil/hwcontext_cuda.c:353:26: error: ‘CudaFunctions’ {aka ‘struct CudaFunctions’} has no member named ‘cuDevicePrimaryCtxGetState’
353 | ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device,
| ^~
libavutil/cuda_check.h:62:114: note: in definition of macro ‘FF_CUDA_CHECK_DL’
62 | #define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x)
| ^
libavutil/hwcontext_cuda.c:353:15: note: in expansion of macro ‘CHECK_CU’
353 | ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device,
| ^~~~~~~~
libavutil/hwcontext_cuda.c:362:30: error: ‘CudaFunctions’ {aka ‘struct CudaFunctions’} has no member named ‘cuDevicePrimaryCtxSetFlags’
362 | ret = CHECK_CU(cu->cuDevicePrimaryCtxSetFlags(hwctx->internal->cuda_device,
| ^~
libavutil/cuda_check.h:62:114: note: in definition of macro ‘FF_CUDA_CHECK_DL’
62 | #define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x)
| ^
libavutil/hwcontext_cuda.c:362:19: note: in expansion of macro ‘CHECK_CU’
362 | ret = CHECK_CU(cu->cuDevicePrimaryCtxSetFlags(hwctx->internal->cuda_device,
| ^~~~~~~~
libavutil/hwcontext_cuda.c:368:26: error: ‘CudaFunctions’ {aka ‘struct CudaFunctions’} has no member named ‘cuDevicePrimaryCtxRetain’
368 | ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx,
| ^~
libavutil/cuda_check.h:62:114: note: in definition of macro ‘FF_CUDA_CHECK_DL’
62 | #define FF_CUDA_CHECK_DL(avclass, cudl, x) ff_cuda_check(avclass, cudl->cuGetErrorName, cudl->cuGetErrorString, (x), #x)
| ^
libavutil/hwcontext_cuda.c:368:15: note: in expansion of macro ‘CHECK_CU’
368 | ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx,
| ^~~~~~~~
CC libavutil/mem.o
make: *** [ffbuild/common.mak:59: libavutil/hwcontext_cuda.o] Error 1
make: *** Waiting for unfinished jobs....

qyot27
5th March 2020, 03:52
Those relate to trying to enable CUDA, which is autodetected apparently. I don't personally have an Nvidia card new enough to support CUDA, so I guess it skips it here. You may want to either --disable-cuvid (hopefully that's the right one; there's like three of them) or if more things in the hwaccels have problems, even go nuclear and use --disable-hwaccels.

Richard1485
5th March 2020, 05:30
You may want to either --disable-cuvid (hopefully that's the right one; there's like three of them) or if more things in the hwaccels have problems, even go nuclear and use --disable-hwaccels.

Unfortunately, even if I add both options to configure, I still see the error message,


./configure --prefix=$HOME/ffavx_build --enable-gpl --enable-version3 \
--disable-doc --disable-debug --enable-pic --enable-avisynth --disable-cuvid --disable-hwaccels


My card is pretty old now: ~8 years. It was as useful on Windows as it's been annoying on Linux. :D

EDIT: This seems to work.


./configure --prefix=$HOME/ffavx_build --enable-gpl --enable-version3 \
--disable-doc --disable-debug --enable-pic --enable-avisynth --disable-cuvid --disable-hwaccels --disable-cuda-llvm --disable-ffnvcodec

sl1pkn07
5th March 2020, 06:29
@qyot27 little offtopic but related

you have plans for send the avisynth+ patches to upstream ffmpeg and ffms2?

greetings

pinterf
5th March 2020, 09:54
OS: Debian 10.3, CPU: i3-8100.
It seems there is no AVX2 detection on my side.
Thank you. I'll check it then.

sl1pkn07
5th March 2020, 12:10
mmm

https://i.ibb.co/WHp34QN/Screenshot-20200305-120810.png

BlankClip(color=$000000)

same output

but version works ok

https://i.ibb.co/QpLk48c/Screenshot-20200305-121153.png

EDIT: ColorbarsHS() works

https://i.ibb.co/6D2cxBT/Screenshot-20200305-121645.png

qyot27
5th March 2020, 13:40
@qyot27 little offtopic but related

you have plans for send the avisynth+ patches to upstream ffmpeg and ffms2?

greetings
I asked on ffmpeg-devel what the preference would be for dropping AvxSynth and switching to AviSynth+, vis-a-vis a deprecation message first and then the switch happening later, or just doing a hard switch because AvxSynth is more or less equivalent to AviSynth 2.5 and FFmpeg hasn't supported 2.5 on Windows for nearly 5 years.

I haven't gotten a response yet. If it goes much longer (a day or two or early next week), I'll not even bother with the deprecation patch and just send the switchover patchset.

For FFMS2, the change to the actual code is just a small if/else in src/avisynth/avssources.h, but there's something about the flags used by the autotools build system used upstream that's making the built library unusable by AviSynth+. I haven't done a deep dive to try and figure out what it is, though.

mmm

[image]

BlankClip(color=$000000)

same output

but version works ok

[image]

EDIT: ColorbarsHS() works

[image]
The checkerboard output is what happens whenever mpv gets something with an alpha channel. It doesn't have anything to do specifically with AviSynth+.

If you use pixel_type="YUV444P" (or other format) to change the pix_fmt that Colorbars or BlankClip is outputting, it'll show up (conversely, using it in ColorbarsHD to have it output with an alpha channel will do the opposite). Same with using a ConvertTo function afterward that makes it drop the alpha channel.

Version() outputs bgr24, so no alpha channel there.

sl1pkn07
5th March 2020, 14:02
okis, thanks for the info. works!

greetings

StainlessS
5th March 2020, 16:17
Well, I went back and did as below, seems to have completed ok


steve@Plex-780:~$ sudo apt-get update
[sudo] password for steve:
Ign:1 http://mirrors.evowise.com/linuxmint/packages tricia InRelease
Hit:2 http://archive.canonical.com/ubuntu bionic InRelease
Hit:3 http://mirrors.evowise.com/linuxmint/packages tricia Release
Hit:4 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu bionic InRelease
Get:5 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Hit:6 http://archive.ubuntu.com/ubuntu bionic InRelease
Ign:7 http://dl.google.com/linux/earth/deb stable InRelease
Get:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:10 http://dl.google.com/linux/earth/deb stable Release
Get:12 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Hit:13 https://repo.skype.com/deb stable InRelease
Fetched 252 kB in 3s (76.8 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/earth/deb stable InRelease' doesn't support architecture 'i386'



steve@Plex-780:~$ export CC=gcc-9 CXX=g++-9 LD=gcc-9




steve@Plex-780:~$ printenv
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
LESSCLOSE=/usr/bin/lesspipe %s %s
LANG=en_GB.UTF-8
GDM_LANG=en_GB
DISPLAY=:0
GTK_OVERLAY_SCROLLING=1
COLORTERM=truecolor
XDG_VTNR=7
SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
MANDATORY_PATH=/usr/share/gconf/cinnamon.mandatory.path
S_COLORS=auto
CC=gcc-9
XDG_SESSION_ID=c1
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/steve
USER=steve
DESKTOP_SESSION=cinnamon
GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/9615975d_643e_4430_a9bd_aaac90012fc1
DEFAULTS_PATH=/usr/share/gconf/cinnamon.default.path
QT_QPA_PLATFORMTHEME=qt5ct
PWD=/home/steve
HOME=/home/steve
SSH_AGENT_PID=1356
QT_ACCESSIBILITY=1
XDG_SESSION_TYPE=x11
XDG_DATA_DIRS=/usr/share/cinnamon:/usr/share/gnome:/usr/local/share/:/usr/share/
XDG_SESSION_DESKTOP=cinnamon
GJS_DEBUG_OUTPUT=stderr
GTK_MODULES=gail:atk-bridge
CXX=g++-9
TERM=xterm-256color
SHELL=/bin/bash
VTE_VERSION=5202
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_CURRENT_DESKTOP=X-Cinnamon
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
GNOME_TERMINAL_SERVICE=:1.80
XDG_SEAT=seat0
SHLVL=1
LANGUAGE=en_GB:en
GDMSESSION=cinnamon
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
LOGNAME=steve
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
XDG_RUNTIME_DIR=/run/user/1000
XAUTHORITY=/home/steve/.Xauthority
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_CONFIG_DIRS=/etc/xdg/xdg-cinnamon:/etc/xdg
PATH=/home/steve/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
CINNAMON_VERSION=4.4.8
GJS_DEBUG_TOPICS=JS ERROR;JS LOG
SESSION_MANAGER=local/Plex-780:@/tmp/.ICE-unix/1273,unix/Plex-780:/tmp/.ICE-unix/1273
LD=gcc-9
LESSOPEN=| /usr/bin/lesspipe %s
_=/usr/bin/printenv



steve@Plex-780:~$ ls
AviSynthPlus Desktop Documents Downloads Music Pictures Public Templates Videos
steve@Plex-780:~$ cd AviSynthPlus
steve@Plex-780:~/AviSynthPlus$ mkdir avisynth-build
steve@Plex-780:~/AviSynthPlus$ cd avisynth-build



steve@Plex-780:~/AviSynthPlus/avisynth-build$ CC=gcc-9 CXX=g++-9 LD=gcc-9 cmake ../ -G Ninja -DCMAKE_CXX_FLAGS="-fpermissive" && \
> ninja && \
> sudo ninja install
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- Check for working C compiler: /usr/bin/gcc-9
-- Check for working C compiler: /usr/bin/gcc-9 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/g++-9
-- Check for working CXX compiler: /usr/bin/g++-9 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.17.1")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/steve/AviSynthPlus/avisynth-build
[33/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/core/avisynth.cpp.o
../avs_core/core/avisynth.cpp: In member function ‘virtual char* ScriptEnvironment::VSprintf(const char*, void*)’:
../avs_core/core/avisynth.cpp:3142:50: warning: ISO C++ forbids casting to an array type ‘va_list’ {aka ‘__va_list_tag [1]’} [-fpermissive]
3142 | std::string str = FormatString(fmt, (va_list)val);
| ^~~
[79/80] Building CXX object avs_core/CMakeFiles/AvsCore.dir/filters/exprfilter/exprfilter.cpp.o
In file included from ../avs_core/filters/exprfilter/exprfilter.cpp:109:
../avs_core/filters/exprfilter/jitasm.h:8224:52: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8224 | template<int N> struct ArgTraits_cdecl<N, __m64, 8> {enum {stack_size = 0, flag = ARG_IN_MMX | ARG_TYPE_VALUE, reg_id = MM0};};
| ^
../avs_core/filters/exprfilter/jitasm.h:8229:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
8229 | template<int N> struct ArgTraits_cdecl<N, __m128, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_SP | ARG_TYPE_VALUE, reg_id = XMM0};};
| ^
../avs_core/filters/exprfilter/jitasm.h:8234:55: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
8234 | template<int N> struct ArgTraits_cdecl<N, __m128d, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_DP | ARG_TYPE_VALUE, reg_id = XMM0};};
| ^
../avs_core/filters/exprfilter/jitasm.h:8237:55: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
8237 | template<int N> struct ArgTraits_cdecl<N, __m128i, 16> {enum {stack_size = 0, flag = ARG_IN_XMM_INT | ARG_TYPE_VALUE, reg_id = XMM0};};
| ^
../avs_core/filters/exprfilter/jitasm.h:8294:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8294 | template<> struct ArgTraits_win64<0, __m64, 8> : ArgTraits_win64_reg<RCX, ARG_IN_REG | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8295:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8295 | template<> struct ArgTraits_win64<1, __m64, 8> : ArgTraits_win64_reg<RDX, ARG_IN_REG | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8296:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8296 | template<> struct ArgTraits_win64<2, __m64, 8> : ArgTraits_win64_reg<R8, ARG_IN_REG | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8297:47: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8297 | template<> struct ArgTraits_win64<3, __m64, 8> : ArgTraits_win64_reg<R9, ARG_IN_REG | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8357:67: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8357 | template<int N> struct ArgTraits_linux64<N, __m64, sizeof(__m64)> : ArgTraits_linux64_sse<ARG_IN_XMM_INT | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8360:69: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
8360 | template<int N> struct ArgTraits_linux64<N, __m128, sizeof(__m128)> : ArgTraits_linux64_sse<ARG_IN_XMM_SP | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8363:70: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
8363 | template<int N> struct ArgTraits_linux64<N, __m128d, sizeof(__m128d)> : ArgTraits_linux64_sse<ARG_IN_XMM_DP | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8364:70: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
8364 | template<int N> struct ArgTraits_linux64<N, __m128i, sizeof(__m128i)> : ArgTraits_linux64_sse<ARG_IN_XMM_INT | ARG_TYPE_VALUE> {};
| ^
../avs_core/filters/exprfilter/jitasm.h:8742:25: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
8742 | struct ResultT<__m64, 8> {
| ^
../avs_core/filters/exprfilter/jitasm.h:8774:27: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
8774 | struct ResultT<__m128, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h:8798:28: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
8798 | struct ResultT<__m128d, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h:8820:28: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
8820 | struct ResultT<__m128i, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h:9081:22: warning: ignoring attributes on template argument ‘__m64’ {aka ‘__vector(2) int’} [-Wignored-attributes]
9081 | struct Arg<__m64, 8>
| ^
../avs_core/filters/exprfilter/jitasm.h:9149:24: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
9149 | struct Arg<__m128, 16>
| ^
../avs_core/filters/exprfilter/jitasm.h:9199:36: warning: ignoring attributes on template argument ‘__m128d’ {aka ‘__vector(2) double’} [-Wignored-attributes]
9199 | template<> struct Arg<__m128d, 16> : Arg<__m128, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h:9199:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
9199 | template<> struct Arg<__m128d, 16> : Arg<__m128, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h: In constructor ‘jitasm::detail::calling_convention_cdecl::Arg<__vector(2) double, 16>::Arg(jitasm::Frontend&, const jitasm::detail::ArgInfo&)’:
../avs_core/filters/exprfilter/jitasm.h:9200:62: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
9200 | Arg(Frontend& f, const ArgInfo& arg_info) : Arg<__m128, 16>(f, arg_info) {}
| ^
../avs_core/filters/exprfilter/jitasm.h: At global scope:
../avs_core/filters/exprfilter/jitasm.h:9203:36: warning: ignoring attributes on template argument ‘__m128i’ {aka ‘__vector(2) long long int’} [-Wignored-attributes]
9203 | template<> struct Arg<__m128i, 16> : Arg<__m128, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h:9203:54: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
9203 | template<> struct Arg<__m128i, 16> : Arg<__m128, 16> {
| ^
../avs_core/filters/exprfilter/jitasm.h: In constructor ‘jitasm::detail::calling_convention_cdecl::Arg<__vector(2) long long int, 16>::Arg(jitasm::Frontend&, const jitasm::detail::ArgInfo&)’:
../avs_core/filters/exprfilter/jitasm.h:9204:62: warning: ignoring attributes on template argument ‘__m128’ {aka ‘__vector(4) float’} [-Wignored-attributes]
9204 | Arg(Frontend& f, const ArgInfo& arg_info) : Arg<__m128, 16>(f, arg_info) {}
| ^
[80/80] Linking CXX shared library avs_core/libavisynth.so
[1/2] Install the project...
-- Install configuration: ""
-- Installing: /usr/local/lib/libavisynth.so
-- Installing: /usr/local/include/avisynth
-- Installing: /usr/local/include/avisynth/avisynth.h
-- Installing: /usr/local/include/avisynth/avs
-- Installing: /usr/local/include/avisynth/avs/types.h
-- Installing: /usr/local/include/avisynth/avs/capi.h
-- Installing: /usr/local/include/avisynth/avs/config.h
-- Installing: /usr/local/include/avisynth/avs/win.h
-- Installing: /usr/local/include/avisynth/avs/posix.h
-- Installing: /usr/local/include/avisynth/avs/minmax.h
-- Installing: /usr/local/include/avisynth/avs/alignment.h
-- Installing: /usr/local/include/avisynth/avs/cpuid.h
-- Installing: /usr/local/include/avisynth/avisynth_c.h
steve@Plex-780:~/AviSynthPlus/avisynth-build$

MeteorRain
5th March 2020, 22:42
https://aur.archlinux.org/packages/avisynthplus-git/

done in [AUR]

Note: lots of AVS+ stuff is installed into vapoursynth directories.

sl1pkn07
5th March 2020, 23:01
ooopppssss (done, just reinstall)

pinterf
6th March 2020, 19:15
Just for reference, managed to use avisynth with the CPP interface under Ubuntu
https://github.com/AviSynth/AviSynthPlus/issues/130#issuecomment-595892327
I don't know if it is an achievement or not but I was quite happy :)

MeteorRain
7th March 2020, 06:57
I'm implementing AVS input for x265 and I'm seeing SIGSEGV on _Thrd_yield () from /c/Windows/SYSTEM32/MSVCP140.dll.

[redacted]

Finally figured out. If I recompile avisynth-plus under mingw64, the result DLL works with a mingw64 compiled program.

x265 compiled with mingw64 doesn't work with the DLL (probably msvc) shipped from official.

Guess I would have to use the C interface instead.

pinterf
7th March 2020, 17:29
I'm implementing AVS input for x265 and I'm seeing SIGSEGV on _Thrd_yield () from /c/Windows/SYSTEM32/MSVCP140.dll.

[redacted]

Finally figured out. If I recompile avisynth-plus under mingw64, the result DLL works with a mingw64 compiled program.

x265 compiled with mingw64 doesn't work with the DLL (probably msvc) shipped from official.

Guess I would have to use the C interface instead.
Yep, c++ ABIs are different.

stax76
7th March 2020, 18:46
So x264 does really use the C interface? If there is actually an application that is using the C interface than it might not be impossible to use it directly from managed code too, without a wrapper, that's interesting, I wish I knew this before I had built my wrapper, was a good learning experience though.

Groucho2004
7th March 2020, 19:31
So x264 does really use the C interface?As do Megui (via dimzon's wrapper) and some pipe tools (avs4x26x, avs2yuv).

pinterf
7th March 2020, 19:36
And avspmod and ffmpeg

MeteorRain
8th March 2020, 10:40
Had a very quick testing on avs+ with x265 under Debian buster, and it worked.

I'm working on bring a few other stuff to my repo, and when that's done, I'm gonna start porting common filters.

pinterf
8th March 2020, 17:25
Which are common filters? I have some as well, no need to work twice on the same topic.

stax76
8th March 2020, 20:37
c++ != c

qyot27
8th March 2020, 20:47
c++ != c
Which is this in response to?

x264:
https://code.videolan.org/videolan/x264/-/blob/master/input/avs.c#L49

FFmpeg:
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/avisynth.c;h=55a2efd884e287e8b3aacc8f339235059049a37a;hb=0830e9116f786572865a9c800a9156d0c4294f27#l38

Or better yet, actually look in FFmpeg's compat/avisynth directory: only avisynth_c.h, not the C++ avisynth.h header. (http://git.videolan.org/?p=ffmpeg.git;a=tree;f=compat/avisynth;h=58fb122b62b3cde47d4d629ec16154ecf5663bc0;hb=0830e9116f786572865a9c800a9156d0c4294f27)

And all the AviSynth library functions that get invoked are the avs_func_name type (and AVSC_DECLARE_FUNC/LOAD_AVS_FUNC) that only the C interface exposes.

stax76
8th March 2020, 21:56
Thanks for the links, I'll have a look.

Response to saying megui using C instead of C++ interface.

https://sourceforge.net/p/megui/code/HEAD/tree/AvisynthWrapper/trunk/AvisynthWrapper.cpp#l433

I've built my own wrapper that is similar but I have wondered if I could use avs and vs from .NET directly without building a wrapper, .NET has first class C and COM interop support for sure but maybe it's not worth the trouble and the interop code would be longer and more complicated than building a wrapper with a very simple interface, it's difficult to know what is better without actually trying to build it. MysteryX wrote some vs code but for avs only the vfw route has been taken before.

https://github.com/staxrip/staxrip/tree/master/FrameServer

https://github.com/staxrip/staxrip/blob/master/General/FrameServer.vb

https://github.com/staxrip/staxrip/blob/master/General/VideoRenderer.vb

So far reading the colorspace is the only thing I used the wrapper for which could not be done by vfw.

MeteorRain
8th March 2020, 22:04
Which are common filters? I have some as well, no need to work twice on the same topic.

Unless you plan on packing Debian packages?

If you get your plugins working on any Linux environment, I'll just need to write some meta files (debian packer, docker file, etc) and shouldn't be twice of work.

Groucho2004
8th March 2020, 22:12
Response to saying megui using C instead of C++ interface.I stand corrected. I probably got it mixed up with something else...

MeteorRain
9th March 2020, 02:03
Seems like Linux version doesn't have a default autoload. Maybe we can follow VapourSynth convention and autoload $libdir/avisynth?

For anyone who wants to try x265 and avs+ under Debian buster and Ubuntu bionic: https://yuuki-deb.x86.men/

pinterf
9th March 2020, 08:14
Unless you plan on packing Debian packages?

If you get your plugins working on any Linux environment, I'll just need to write some meta files (debian packer, docker file, etc) and shouldn't be twice of work.
Packaging is O.K. and welcomed, I meant that the source itself needs sometimes heavy refactoring, mainly because of SIMD processor level separation. I experienced it on avs+ source, took quite a lot of time, big codebase takes its toll. So my aim in general to be able to build them on clang and gcc as well, once compilation works I'm finished with my part.

pinterf
9th March 2020, 10:45
Seems like Linux version doesn't have a default autoload. Maybe we can follow VapourSynth convention and autoload $libdir/avisynth?

Good idea, let's see what qyot27 says, we were just happy to make manual AddAutoloadDir working in the final rush.

qyot27
9th March 2020, 16:07
My general assumption was that when autoloading by default was enabled, it would be $libdir/avisynth. When you build with MinGW, that's already where I'd made the plugins (ConvertStacked, ImageSeq, TimeStretch, and VDubFilter) get installed, even if it's sort of pointless on Windows.

What magiblot had mentioned in the plugin loader discussion was having it set up to use an external config file, as is usual on Linux, etc. That is the most portable way to do it (heck, even Windows could use something like that for portable builds).

On Linux, the two most logical places it could go are /etc (for the system, maybe in /etc/avisynth if we want to add more configuration files in the future) and $HOME/.config/avisynth (for a single user). The presence of one in $HOME/.config/avisynth would need to take precedence over the one in /etc, because it would be the one a normal user can override, add to, and edit as they like (it also would be up to the user to create the one in $HOME/.config/avisynth, but we need to be able to read from it first if it exists). The one in /etc would need to restrict itself to just the basic $libdir/avisynth directory, because having it installed with CMake would mean getting overwritten every time we build and install the library. Name-wise, 'avisynth.conf' probably makes the most sense.

The config file would have an autoload_directory= field that can hold a list of directories to autoload from (with the default being $libdir/avisynth, $libdir having been populated by CMAKE_INSTALL_PREFIX when AviSynth+ was built).

MeteorRain
10th March 2020, 00:01
/etc/avisynth
$HOME/.config/avisynth
'avisynth.conf'
with the default being $libdir/avisynth


All make sense.

qyot27
11th March 2020, 04:37
The good news: it didn't take a whole lot to get Clang 9 to compile the source on Ubuntu 19.10.

The not-so-good news: it didn't fix macOS or FreeBSD issues with Clang, even if I grab Clang 9/llvm-9 from pkg or Homebrew rather than trying to use the default versions.

MeteorRain
27th March 2020, 10:42
info.h needs to #include <iomanip> to compile under gcc.

pinterf
27th March 2020, 11:22
Thanks. Good news if that's all. I'm cherry-picking mt and other fixes from Neo branch, so this is only a temporary happyness :) I have almost cherry-picked a whole tree, no, a whole orchard, picked lines depend on other things, if I pull them they needs quadruple times other things; even the merge is huge work, and he created those changes from scratch.

MeteorRain
27th March 2020, 11:46
Yea I tried to pack git~d438bd5 and failed. Adding that include fixed the issue -- at least for compiling. Very appreciate if someone can push a quick fix to that repo.

Meanwhile I was thinking where to put AVS+VS dual interface filters. I'm thinking about a dedicated directory (like /usr/lib/ARCH/avisynth+vapoursynth/) for those filters and then create sym links to both avisynth and vapoursynth directories. Any thoughts?

pinterf
27th March 2020, 12:17
It's there.

real.finder
27th March 2020, 12:21
since there are work on autoload and AddAutoloadDir can we have fix for these? :) https://github.com/pinterf/AviSynthPlus/issues/11

pinterf
27th March 2020, 12:31
I haven't closed the ticket so yes.

qyot27
27th March 2020, 20:15
Yea I tried to pack git~d438bd5 and failed. Adding that include fixed the issue -- at least for compiling. Very appreciate if someone can push a quick fix to that repo.

Meanwhile I was thinking where to put AVS+VS dual interface filters. I'm thinking about a dedicated directory (like /usr/lib/ARCH/avisynth+vapoursynth/) for those filters and then create sym links to both avisynth and vapoursynth directories. Any thoughts?
I've not thought a lot about it in the case of things that are only plugins (LSMASHSource would have been one such test-case, but they're separate as currently implemented).

For normal libraries that happen to have plugin interfaces (like FFMS2) it makes sense to just install them into the normal $libdir and then symlink into the two directories based on whether the plugin interfaces were activated (and which one, if they can be toggled separately).

MeteorRain
27th March 2020, 21:35
I have a few filters that I equipped with dual interface. I'm planning to test compile lsmash works under Linux as one piece. I'm not a fan of having dedicated purpose libraries dangling in lib dir, so I'm heading for libdir/avisynth+vapoursynth if no one objects.

MeteorRain
27th March 2020, 22:28
Pinter, I'm not sure if it's only needed for GCC or should be included for all non-MSVC compilers or all compilers.

You can check the iomanip (https://www.cplusplus.com/reference/iomanip/) header and it seems it should be included regardless.

MeteorRain
28th March 2020, 03:43
Some updates:
Latest AVS+ compiles. I have AviSynth+ 3.5 (r3100, HEAD, x86_64) with me.
HolyWu LSmashWorks compiles with a few tweaks.
I managed to encode using x265-yuuki with lsmashsource into mp4 output, it went smoothly.

I still have to AddAutoloadDir("/usr/lib/x86_64-linux-gnu/avisynth/") because that piece of code hasn't reached there yet.
I ended up putting the filter inside /usr/lib/x86_64-linux-gnu/dualsynth/ and sym linking it to both directories.

qyot27
3rd April 2020, 00:48
With 3.5.1, several things have been fixed:

FreeBSD and macOS can use AddAutoloadDir, although in FreeBSD's case it's required to first mount procfs. FreeBSD does have a different way of gleaning the information needed, but I'm not sure if that's applicable to the other *BSDs as well. In NetBSD and DragonFly BSD, the procfs thing should work, although like FreeBSD, it's not mounted by default and treated as deprecated. OpenBSD out-and-out removed procfs, so I'm not sure what we're going to do there.

I've abandoned the config file to manage autoloading idea for now, and instead hardcoded the two plugin autoload directories: $libdir/avisynth (determined when the core is built, doesn't change) and $HOME/.avisynth. Users will need to create $HOME/.avisynth if they wish to put anything there, but that means that even if some plugin installs don't go to the same /avisynth subdirectory that the core puts ConvertStacked in, an .avsi file using AddAutoloadDir in $HOME/.avisynth can probably remedy them loading without needing it in every script. Provided AVSI autoloading functions.

Native Clang 8 on FreeBSD 12.1 and AppleClang on Catalina can now build AviSynth+, although there are a lot of warnings. High Sierra and Mojave, for those still using them, need to keep using GCC-9 due to the lack of <filesystem> support in the base libc++ from Apple. Even llvm-9 from Homebrew seemed to get hit by this, from what I remember, but I haven't tested it thoroughly.

SONAME and SOVERSION are now set, and yes, it looks weird. The base library bears the release version, so that multiple versions can be installed simultaneously, while the SOVERSION symlink points to AVISYNTH_INTERFACE_VERSION (the closest thing to the ABI compatibility indicators SOVERSIONs are meant to relay). So libavisynth.so.3.5.1, libavisynth.so.7 symlink, and the regular libavisynth.so symlink.

-fpermissive is no longer required.

qyot27
5th April 2020, 05:27
The AviSynth+ switchover patches have landed in upstream FFmpeg, removing the need for using the avsplus_linux2 branch on my dev repo.

stax76
4th May 2020, 22:43
Some tools seem to load avisynth from the path env var enabling portable setup, other tools don't.

works:

av2pipemod
x264


does not work:

mpc be
mpv
ffmpeg


Might there be security concerns or is it simply a missing feature?

Groucho2004
4th May 2020, 22:47
other tools don't.Can you elaborate? What's the error message?

stax76
4th May 2020, 22:57
mpv.net:

starts delayed without showing an error or doing anything


mpc be:

cannot render the file


ffmpeg:

D:\Samples\aaa_temp\aaa.avs: Unknown error occurred

Groucho2004
4th May 2020, 23:00
D:\Samples\aaa_temp\aaa.avsCan you post that script?

Edit - Also, how did you install Avisynth?

stax76
4th May 2020, 23:04
Only source filter, same result with ffms2 and l-smash.

Groucho2004
4th May 2020, 23:16
Only source filter, same result with ffms2 and l-smash.Explicit or implicit load? Again - how did you install Avisynth?

stax76
4th May 2020, 23:25
Explicit load, I've not installed but uninstalled avisynth. :)

I just modify the path env var.


If Not WasInitialized Then
Package.Python.AddToPath()
Package.AviSynth.AddToPath()
Package.VapourSynth.AddToPath()
WasInitialized = True
End If


That was all to make it work for staxrip, av2pipemod and x264, child processes inherit the path.

qyot27
5th May 2020, 03:35
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=compat/w32dlfcn.h;h=bc9bb8c9f51e8a78627bbeabe61348cb42999729;hb=85553b42f92457a581e13edbd3e2c2e6136931eb

28 * Safe function used to open dynamic libs. This attempts to improve program security
29 * by removing the current directory from the dll search path. Only dll's found in the
30 * executable or system directory are allowed to be loaded.

Everything you listed as being affected uses libavformat. In such a case, say you've put AviSynth.dll in the same directory as mpv.com and mpv.exe and a simple Version() script named testver.avs,

In cmd.exe you can do:
mpv.com testver.avs
And it'll spit back the video window with the output of Version().

In bash or PowerShell, however, this will fail because those shells do not silently interpret the current directory as being on the PATH, and while you can execute mpv as a program (because Windows' filesystems and permissions systems don't map to the same execution bits that *nix does, it treats all files as executables), it won't load any other .dlls unless they're in a directory on the $PATH. But when you explicitly call the program's executable path:
./mpv.com testver.avs
It works.

stax76
5th May 2020, 07:56
Thanks for the clarification qyot27. I don't know what I should think about overwriting Windows default behavior, appears to be over-zealous. If somebody made a feature request to enable path search via switch, do you think there is a chance it gets accepted?

If I put the tools in the same directory I confirm that it's working.

qyot27
5th May 2020, 08:38
Thanks for the clarification qyot27. I don't know what I should think about overwriting Windows default behavior, appears to be over-zealous. If somebody made a feature request to enable path via switch, do you think there is a chance it gets accepted?
I highly doubt it.

However, there is a workaround. Just create symlinks in the ffmpeg/mpv/mpc directories using the Windows mklink command.

stax76
5th May 2020, 10:06
I've never used mklink even though it appears to be a useful command. Unfortunately I'm not able to create a hardlink in a cmd admin console.

C:\Users\frank\Desktop\bin>mklink /h .\Apps\Support\mpv.net\AviSynth.dll .\Apps\Support\AviSynth.dll
The system cannot find the file specified.

Same command without /h works.

qyot27
5th May 2020, 10:23
You don't want hard links, so /h not working isn't an issue.

stax76
5th May 2020, 10:56
I successfully created soft links for AviSynth.dll and DevIL.dll in the mpv.net folder but mpv.net still does not open avs.

I think portable vapoursynth has worked in mpv.net even without soft links.

Even if I can get it work it's probably not useful for staxrip users or are soft links portable?

I can offer a portable version putting everything in the same directory, it's just not clean.

ChaosKing
5th May 2020, 11:03
Even if I can get it work it's probably not useful for staxrip users or are soft links portable?



Soft links yes, hard links no. But you can't have relative soft links I think!? So not really portable then.

stax76
5th May 2020, 11:08
If I could get it work with soft links staxrip could recreate the soft links whenever it notices that it was started from a new location.

qyot27
5th May 2020, 11:28
I checked mpv.net portable x64 5.4.6.0 just now with AviSynth.dll in a subdirectory and a symlink to it next to mpvnet.com|exe. No issues opening a Version() script, or with one loading a local FFMS2.dll and invoking FFVideoSource.

ChaosKing
5th May 2020, 11:37
@qyot27 Does it affect the symlink if you copy the whole folder elsewhere?

stax76
5th May 2020, 11:46
And avisynth was not located in system32? Here it's not working. :(

I tested now with vapoursynth, renamed the installed core folder to core- so the installed version cannot work. mpv.net opens vpy using portable vapoursynth (checked in Process Explorer). Even ffmpeg opens vpy using portable vapoursynth, but not mpc be (who cares...).

qyot27
5th May 2020, 11:50
@qyot27 Does it affect the symlink if you copy the whole folder elsewhere?
Yeah, in that case Windows follows the symlink and does a full copy of the DLL.

qyot27
5th May 2020, 12:00
And avisynth was not located in system32? Here it's not working. :(

I tested now with vapoursynth, renamed the installed core folder to core- so the installed version cannot work. mpv.net opens vpy using portable vapoursynth (checked in Process Explorer). Even ffmpeg opens vpy using portable vapoursynth, but not mpc be (who cares...).
What's in system32 is a symlink to E:\Programs\AviSynth+\AviSynth64.dll, so all I have to do to disable it is rename E:\Programs\AviSynth+\AviSynth64.dll and the link can no longer find the DLL, resulting in the same error as if it wasn't installed.

stax76
5th May 2020, 12:19
Thanks for helping! I don't know what I could miss so have to give up for now.

chros
5th May 2020, 12:41
Soft links yes, hard links no. But you can't have relative soft links I think!? So not really portable then.

I use hardlinks in script on Win8/10 as a normal user, but I can't use softlinks as normal user.

stax76
5th May 2020, 17:42
It's working now after a reboot. :o

The German Wikipedia article on symlinks says that Windows soft links support relative paths, I hope that this is portable across machines.

In mpv.net I added a workaround.


bool wasAviSynthLoaded;

void LoadLibrary(string ext)
{
if (!wasAviSynthLoaded && ext == "avs")
{
WinAPI.LoadLibrary("AviSynth.dll");
wasAviSynthLoaded = true;
}
}


It's working, vapoursynth works without such workaround, reason unknown.


edit:

it's probably not portable:

https://superuser.com/questions/756039/can-mklink-make-portable-links

Groucho2004
5th May 2020, 17:52
bool wasAviSynthLoaded;

void LoadLibrary(string ext)
{
if (!wasAviSynthLoaded && ext == "avs")
{
WinAPI.LoadLibrary("AviSynth.dll");
wasAviSynthLoaded = true;
}
}

Did you leave out the error handling or is that the actual function?

Edit - The reason I'm asking: Is there some built-in error handling in .net when for example WinAPI.LoadLibrary("AviSynth.dll") fails?

StainlessS
5th May 2020, 17:58
Well, I'de already written this so posting.


C:\Users\frank\Desktop\bin>mklink /h .\Apps\Support\mpv.net\AviSynth.dll .\Apps\Support\AviSynth.dll
The system cannot find the file specified.


I know dick bout this but should it not be

C:\Users\frank\Desktop\bin>mklink .\Apps\Support\mpv.net\AviSynth.dll ..\..\AviSynth.dll


Relative to the first "Avisynth.dll" link, ie up two parent levels, above the link itself.
:helpful:

EDIT: And I presume that above marked in blue could be an absolute [ie drive relative] path without disrupting anything.

EDIT: Maybe not, I just tried it on Win7 and it converted it to an absolute path in the link.

EDIT: Ignore above, it DOES WORK, it shows as absolute path in link properties box, but move the containing folder and it still works.
(absolute path changes to the changed absolute path when shown in the link properties)

stax76
5th May 2020, 18:23
You got it!!! Working perfectly, tested with ffmpeg as mpv.net already has a workaround.

But if the link is relative, why does the github thread say it's not portable across machines? I've used a cmd terminal without admin rights to create the symlink and it works, this is important as I think a portable app should not bother asking for admin rights.

Looks like we got a solution, thank you qyot27 and StainlessS!

StainlessS
5th May 2020, 18:31
Maybe means not portable to have relative SOFT link on machine A pointing to a file/folder on machine B.

The link shown in Properties [to target] is [on Win7] converted to an absolute path just for the Properties dialog box display,
it must actually still be relative in reality.

EDIT: Probably also not possible to have soft link pointing to a different drive.

EDIT: Changed my mind, can have soft link to another drive, "Send To Desktop" works from any drive,
but suspect in such cases it is an absolute path with drive letter.
Create Shortcut probably makes the decision for you as to relative or not based on whether relative path is possible.

StainlessS
5th May 2020, 19:58
Under Win7, if you just right click and New Shortcut(Soft Link), and create shortcut to where target is in the folder one above the shortcut.
And then you rename the folder containing the target, to something else, then the shortcut still works.
So, at least under W7 (and WXP I think), you dont have to go to the command line [or have admin rights].
(XP has cmd line FsUtil.exe which is related to mklink.exe, and also exists under W7)

From FsUtil on W7

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\root>fsutil
---- Commands Supported ----

8dot3name 8dot3name managment
behavior Control file system behavior
dirty Manage volume dirty bit
file File specific commands
fsinfo File system information
hardlink Hardlink management
objectid Object ID management
quota Quota management
repair Self healing management
reparsepoint Reparse point management
resource Transactional Resource Manager management
sparse Sparse file control
transaction Transaction management
usn USN management
volume Volume management

C:\Users\root>

No idea how to use it [probably need admin rights].
EDIT: RED, Not avilable on XP64.

Hardlink on XP/W7

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\root>fsutil hardlink
---- HARDLINK Commands Supported ----

create Create a hardlink
list Enumerate hardlinks on a file

C:\Users\root>fsutil hardlink list
Usage : fsutil hardlink list <filename>
Eg : fsutil hardlink list c:\foo.txt

C:\Users\root>fsutil hardlink create
Usage : fsutil hardlink create <new filename> <existing filename>
Eg : fsutil hardlink create c:\foo.txt c:\bar.txt

C:\Users\root>

EDIT: fsutil hardlink list, not available on XP [EDIT: XP64].

MeteorRain
5th May 2020, 23:46
Soft links -- Do you mean Symbolic Links? Because shortcuts and symbolic links are different things.

StainlessS
6th May 2020, 03:07
Dont know what I mean't there, I was just bluffing.

qyot27
16th June 2020, 23:50
And FFmpeg 4.3 has been released, so there's now actually a fully qualified point release that contains AviSynth+ on *nix support. Hopefully this means more uptake by distributions.

MysteryX
17th June 2020, 04:33
It would be good to have a document with clear instructions for plugin developers on how to make it cross-platform compatible.

And for the matters -- cross-platform with support for both Avisynth and VapourSynth should be the standard by now. Anyone wants to write clear instructions on how to achieve that the right way?

qyot27
20th June 2020, 04:00
Generally, rather than including avs/win.h, you'd include avs/posix.h (ifdef it). And ideally, use stdint types (int64_t), not the old MSVC ones (__int64). Beyond that, you're dealing with things far more basic to OS differences in how things are coded, not anything specific about the avsplus codebase.

I am mulling the possibility of having a repository solely for a skeleton CMake project so that potential plugin ports can have a jumping off point that lets them build for more than just MSVC.

ChaosKing
20th June 2020, 08:56
It would be good to have a document with clear instructions for plugin developers on how to make it cross-platform compatible.

And for the matters -- cross-platform with support for both Avisynth and VapourSynth should be the standard by now. Anyone wants to write clear instructions on how to achieve that the right way?

"Neo Gradient Mask is the hello-world type of project for dual synth wrapper based source filter."
https://github.com/HomeOfAviSynthPlusEvolution/neo_Gradient_Mask

MeteorRain
21st June 2020, 02:03
However please do note dual synth wrapper is still in pretty early stage, and needs to be polished during the time.

I'd love to share permissions on those repos so you can participate in improving it.

Also Gradient Mask is a source filter project. For regular filter examples, minideen or fft3d may be easier to read.

feisty2
21st June 2020, 02:21
Well, I think there should be no base class (interface) and no virtual functions, it’s definitely possible since it’s how I designed my vs wrapper. Duck typing (via templates) is easier to the user and provides richer type information as there is no goddamn type erasure. You can introspect a filter type and see which members/behaviors are defined and which are not using requires expressions, and play with lots of dynamic-typing-like magic. And the runtime overhead of virtual functions also gets eliminated

edit: and duck typing is more consistent with the core language design of c++, take range-for syntax for example, it's a duck typing syntax, it's automatically enabled for any type that defined begin() and end(), the type does not need to implement any interface or inherent any base class.

magiblot
26th June 2020, 17:49
Is there a list of plugins that are available on Posix platforms? We probably should make one, just like there's one for 64-bit plugins in the wiki.

Well, I think there should be no base class (interface) and no virtual functions, it’s definitely possible since it’s how I designed my vs wrapper. Duck typing (via templates) is easier to the user and provides richer type information as there is no goddamn type erasure. You can introspect a filter type and see which members/behaviors are defined and which are not using requires expressions, and play with lots of dynamic-typing-like magic. And the runtime overhead of virtual functions also gets eliminated

As far as I understand, AviSynth is built without the source code of external filters, and viceversa. How would external filters link against the library?

feisty2
26th June 2020, 18:11
As far as I understand, AviSynth is built without the source code of external filters, and viceversa. How would external filters link against the library?

I only developed an API wrapper for vs but I guess the avs API should be more or less the same. the low level vs API consists of a bunch of (pointers to) C functions and obviously there's no inheritance and virtual functions since everything is written in C. so I'm not sure what you're trying to say.

anyways, here (https://github.com/IFeelBloated/vsFilterScript/blob/master/Examples/EntryPoint.cxx#L9), here (https://github.com/IFeelBloated/vsFilterScript/blob/master/include/Interface.vxx#L68) and here (https://github.com/IFeelBloated/vsFilterScript/blob/master/include/Interface.vxx#L72) are the snippets that are relevant to exposing the plugin and its filters to vs.

qyot27
26th June 2020, 19:20
Is there a list of plugins that are available on Posix platforms? We probably should make one, just like there's one for 64-bit plugins in the wiki.
I'd suggested roughly the same thing a week or so ago (https://forum.doom9.org/showthread.php?p=1915765#post1915765) (plus CPU arch, since there's fewer that run on ARM at the moment), but AFAIK, the closest we have currently is the result of searching for 'avisynth' on the AUR:
https://aur.archlinux.org/packages/?O=0&K=avisynth
(even though the one ffms2 entry that's labelled as my 'fork' isn't really much of the sort, and it's not really necessary to include it since upstream ffms2 now includes AviSynth+ support on POSIX in the regular autotools build system)

And then figuring it out from which ones are actually for avsplus, rather than the core library or actually for VS.

FluxSmooth-pfmod also added *nix support, and I have a test branch that enables the TimeStretch plugin when building the core. There's probably others.

MeteorRain
26th June 2020, 19:55
Not sure if you noticed, but new users probably don't have the permission to create new pages.

We can start copying entries from old external filters to modern external filters, including those that are popular, under active maintenance, or are important and unique.
Old, lack of maintenance filters can be left in the old page just like the old old filters page.

Then we can start adding fields to the table.

== Deband Filters ==

| Name | Description | YV12 | YV16/24 | HBD | Win64 | Linux | macOS | ARM | Download |
| f3kdb | ... | y | y | hacked | y | n | n | n | GitHub |
| Neo f3kdb | ... | y | y | y | ...

Reel.Deel
26th June 2020, 20:05
I'd suggested roughly the same thing a week or so ago (https://forum.doom9.org/showthread.php?p=1915765#post1915765) (plus CPU arch, since there's fewer that run on ARM at the moment), but AFAIK, the closest we have currently is the result of searching for 'avisynth' on the AUR:
https://aur.archlinux.org/packages/?O=0&K=avisynth
(even though the one ffms2 entry that's labelled as my 'fork' isn't really much of the sort, and it's not really necessary to include it since upstream ffms2 now includes AviSynth+ support on POSIX in the regular autotools build system)

And then figuring it out from which ones are actually for avsplus, rather than the core library or actually for VS.

FluxSmooth-pfmod also added *nix support, and I have a test branch that enables the TimeStretch plugin when building the core. There's probably others.

I'll start a page on the wiki if you tell me what to name the page and a few plugins to add (just to start a table like the x64 plugins page).

qyot27
26th June 2020, 22:35
Something like 'AviSynth+ plugins' in a general chart (where even the native x64 support could be noted as well), or extend the existing x64 plugins table with a few extra fields to denote OS and CPU architecture, changing the page title as necessary.

The reason it may not all fit under a catch-all page title including a term like POSIX is that Windows for ARM exists, and in the release for 3.6.1 there's a WinARM test build. Not that any plugins have yet been built for that apart from ConvertStacked (because it's in the main AviSynth+ sources). But it is possible as a configuration.

qyot27
13th December 2020, 22:18
Note: it's a month old at this point, but there's now a thread to track which plugins have been ported to other OSes and CPU architectures (https://forum.doom9.org/showthread.php?p=1930733) (also in my signature). When I get around to rewriting the first post I'll add the link there, too.

qyot27
12th January 2021, 00:34
And with the release of version 3.7, we now support a couple more things: Haiku (https://www.haiku-os.org), and PowerPC CPUs.

Haiku is a re-implementation of BeOS, an OS that had its day in the spotlight in the early-mid 90s as a competitor to Windows and the Classic Mac OS. It's not a Unix-like system like Linux, BSD, or macOS are, but it is largely POSIX compliant and uses Bash as its shell.

PowerPC-wise, the real target here is the potential to use AviSynth+ on Linux or BSD running on the newer (currently POWER9 or POWER10) CPUs, but a side effect is that it can also run on old PPC versions of OSX Tiger and Leopard (with some help). Like the ARM support added in 3.6, PowerPC support is very basic at this point - single-threaded and no AltiVec instructions.

Richard1485
16th March 2021, 16:50
For anyone who wants to try x265 and avs+ under Debian buster and Ubuntu bionic: https://yuuki-deb.x86.men/

I receive an error message on Buster:
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://yuuki-deb.x86.men buster InRelease' doesn't support architecture 'i386'

My /etc/apt/sources.list.d/yuuki-deb.list looks like this:
deb http://yuuki-deb.x86.men/ buster main

EDIT: I have i386 architecture enabled only because of Wine.

MeteorRain
20th March 2021, 21:05
Yea it's x86_64 only. You can safely ignore it.

Also I believe fft3d doesn't work correctly. I may need to look into it at a later time.

Richard1485
20th March 2021, 23:47
You can safely ignore it.

Cool. I don't need fft3d, so no worries there.

Hey, there's some good stuff in this repo, which I didn't know about until recently. It's nice not to have to build some plugins from source, and closer to the way that we're meant to do things on Linux. Thanks!

EDIT: The instructions here (https://github.com/AviSynth/AviSynthPlus/blob/master/distrib/docs/english/source/avisynthdoc/contributing/posix.rst#id1) for building ffmpeg worked fine on Debian. I installed avisynthplus-yuuki-dev in addition to avisynthplus-yuuki.

pokota
26th May 2021, 00:55
You can specify an architecture for a specific repository in your sources.list file - in this case, by using deb [arch=amd64] http://yuuki-deb.x86.men buster main

Are there still no plugin autoload directories, or has that changed? Also are there any Linux-ecosystem players that accept frameserved input, or will I be stuck encoding for preview work?

qyot27
26th May 2021, 01:31
Are there still no plugin autoload directories, or has that changed? Also are there any Linux-ecosystem players that accept frameserved input, or will I be stuck encoding for preview work?
Autoload directories have worked on Linux, macOS, and at least¹ FreeBSD since 3.5.1.

¹requires mounting /proc, which OpenBSD (and possibly others) don't have.

Anything that uses libavformat, so long as it's FFmpeg 4.3 or higher and was configured with --enable-avisynth. If the ffmpeg supplied by the distro doesn't use that configuration flag, you'll have to build it yourself or use a third-party repo.

JunkyardCat
7th September 2023, 18:05
I've run into a wall with getting AviSynth+ running on my Fedora 38 box. I believe I compiled AviSynth+ & and ffmpeg properly, but get the error below when trying to run the test.avs script. Could this be a codec issue? Not sure where to go...any point in the right direction would go most appreciated!

test.avs:


$ cat test.avs
Version()


Error when testing out the test.avs script

$ ./ffplay test.avs
ffplay version N-111974-gfd9bafc85e Copyright (c) 2003-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/ffmpeg_build --enable-gpl --enable-version3 --disable-doc --disable-debug --enable-pic --enable-avisynth
libavutil 58. 19.100 / 58. 19.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 11.100 / 60. 11.100
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
test.avs: Unknown error occurred 0KB vq= 0KB sq= 0B f=0/0
warning: queue 0x3cfab10 destroyed while proxies still attached:
wl_callback@40 still attached
wl_surface@38 still attached


confirmation AviSynthPlus is installed:
$ /home/junkyardcat/ffmpeg_build/bin/ffmpeg -formats | grep avisynth
ffmpeg version N-111974-gfd9bafc85e Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/ffmpeg_build --enable-gpl --enable-version3 --disable-doc --disable-debug --enable-pic --enable-avisynth
libavutil 58. 19.100 / 58. 19.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 11.100 / 60. 11.100
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
D avisynth AviSynth script

qyot27
15th September 2023, 03:13
I really do need to revamp the POSIX page in the docs. But I went ahead and spun up a fresh Fedora 38 VM to confirm my suspicions, and I'm pretty much 100% certain that your issue is with LD_LIBRARY_PATH (that is, unless you did something weird, like try to build AviSynth+ as a static library).

Fedora installs user-compiled things to /usr/local by default (like most distros do), and shared libraries in that situation go into /usr/local/lib64. /usr/local/bin is on the PATH, but /usr/local/lib64 is not on LD_LIBRARY_PATH. /usr/lib64 is on LD_LIBRARY_PATH, so if you install directly into /usr it'll work.

Since there aren't any Fedora-specific instructions in that guide in the docs, here's what you'd ideally be looking at:
Dependencies:
sudo dnf install git ninja-build DevIL g++ DevIL-devel cmake
AviSynth+:
git clone https://github.com/AviSynth/AviSynthPlus.git
cd AviSynthPlus
mkdir avisynth-build
cd avisynth-build
cmake ../ -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
ninja
sudo ninja install

I've become rather partial to making use of $HOME/.local if possible, since it removes the need to use sudo, and $HOME/.local/bin is on the PATH for your user.

avs2yuv:
git clone https://github.com/DJATOM/avs2yuv.git
cd avs2yuv
mkdir build
cd build
cmake ../ -G Ninja -DCMAKE_INSTALL_PREFIX=$HOME/.local
ninja
ninja install
avs2yuv can be used to pipe into the standard Fedora build of ffmpeg-free, so you could run the test check like this:
echo 'Version(pixel_type="YUV420P8")'>test.avs
avs2yuv test.avs -o - | ffplay -

FFmpeg:
sudo dnf install nasm
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
mkdir ffmpeg-build
cd ffmpeg-build
../configure --prefix=$HOME/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth <other configuration options if you want>
make -j$(nproc)
make install
Now you can invoke the AviSynth-supporting FFmpeg using ffmpeg-avs.


Example of the above FFmpeg-avs trying and failing to find AviSynth+ in /usr/local/lib64 (under LXDE):
[qyot27@fedora ~]$ ffmpeg-avs -i test.avs
ffmpeg version N-112081-gc1b6235d41 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/qyot27/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
[in#0 @ 0x30363c0] Error opening input: Unknown error occurred
Error opening input file test.avs.
Error opening input files: Unknown error occurred
[qyot27@fedora ~]$

However, with LD_LIBRARY_PATH:
[qyot27@fedora ~]$ LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg-avs -i test.avs
ffmpeg version N-112081-gc1b6235d41 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/qyot27/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified
[qyot27@fedora ~]$


What this means is that you have several different options:
A) Install AviSynth+ to /usr, so that the library and its symlinks get put in /usr/lib64. This is the most straightforward to make sure that avs2yuv, ffmpeg, etc. can always see it.
B) Use LD_LIBRARY_PATH= to add /usr/local/lib64 (or ~/.local/lib64, if you also install AviSynth+ to $HOME/.local) to the search path when you run avs2yuv or ffmpeg-avs. Alias them in .bashrc if you don't want to keep remembering to override LD_LIBRARY_PATH.
C) Unconditionally add /usr/local/lib64 (and/or ~/.local/lib64) to LD_LIBRARY_PATH in .bashrc. May or may not be a good idea.

JunkyardCat
16th September 2023, 22:57
Thank you so much for the response. This is super helpful. I have a poor understanding of how libraries are shared with local vs system installs, but your explanation helps explain some of that.

I compiled and built everything to your instructions with the exception of the below, had to change --enable-version to --enable-version3.


FFmpeg:
sudo dnf install nasm
git clone git://source.ffmpeg.org/ffmpeg.git
cd ffmpeg
mkdir ffmpeg-build
cd ffmpeg-build
../configure --prefix=$HOME/.local --progs-suffix=-avs --enable-gpl --enable-version --disable-debug --disable-doc --enable-pic --enable-avisynth <other configuration options if you want>
make -j$(nproc)
make install
Now you can invoke the AviSynth-supporting FFmpeg using ffmpeg-avs.


ffmpeg-avs did not return an error when not pointing to LD_LIBRARY_PATH=/usr/local/lib64 per the below. See my output. What are your thoughts?


Example of the above FFmpeg-avs trying and failing to find AviSynth+ in /usr/local/lib64 (under LXDE):
[qyot27@fedora ~]$ ffmpeg-avs -i test.avs
ffmpeg version N-112081-gc1b6235d41 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/qyot27/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
[in#0 @ 0x30363c0] Error opening input: Unknown error occurred
Error opening input file test.avs.
Error opening input files: Unknown error occurred
[qyot27@fedora ~]$

However, with LD_LIBRARY_PATH:
[qyot27@fedora ~]$ LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg-avs -i test.avs
ffmpeg version N-112081-gc1b6235d41 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/qyot27/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified
[qyot27@fedora ~]$


MY OUTPUT:


[junkyardcat@fedora ~]$ ffmpeg-avs -i test.avs
ffmpeg version N-112103-gb5c07a368b Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified

[junkyardcat@fedora ~]$ LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg-avs -i test.avs
ffmpeg version N-112103-gb5c07a368b Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified


To clarify, the instructions you gave provide option B without aliasing LD_LIBRARY_PATH. Is this correct?


What this means is that you have several different options:
A) Install AviSynth+ to /usr, so that the library and its symlinks get put in /usr/lib64. This is the most straightforward to make sure that avs2yuv, ffmpeg, etc. can always see it.
B) Use LD_LIBRARY_PATH= to add /usr/local/lib64 (or ~/.local/lib64, if you also install AviSynth+ to $HOME/.local) to the search path when you run avs2yuv or ffmpeg-avs. Alias them in .bashrc if you don't want to keep remembering to override LD_LIBRARY_PATH.
C) Unconditionally add /usr/local/lib64 (and/or ~/.local/lib64) to LD_LIBRARY_PATH in .bashrc. May or may not be a good idea.

qyot27
16th September 2023, 23:59
I compiled and built everything to your instructions with the exception of the below, had to change --enable-version to --enable-version3.
Oh yeah, that was a typo. Fixed.

ffmpeg-avs did not return an error when not pointing to LD_LIBRARY_PATH=/usr/local/lib64 per the below. See my output. What are your thoughts?
That's because the instructions I gave for AviSynth+ actually do go ahead and have you install it into /usr so you don't have to mess with LD_LIBRARY_PATH.

MY OUTPUT:


[junkyardcat@fedora ~]$ ffmpeg-avs -i test.avs
ffmpeg version N-112103-gb5c07a368b Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified

[junkyardcat@fedora ~]$ LD_LIBRARY_PATH=/usr/local/lib64 ffmpeg-avs -i test.avs
ffmpeg version N-112103-gb5c07a368b Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (GCC)
configuration: --prefix=/home/junkyardcat/.local --progs-suffix=-avs --enable-gpl --enable-version3 --disable-debug --disable-doc --enable-pic --enable-avisynth
libavutil 58. 24.100 / 58. 24.100
libavcodec 60. 26.100 / 60. 26.100
libavformat 60. 12.101 / 60. 12.101
libavdevice 60. 2.101 / 60. 2.101
libavfilter 9. 11.100 / 9. 11.100
libswscale 7. 3.100 / 7. 3.100
libswresample 4. 11.100 / 4. 11.100
libpostproc 57. 2.100 / 57. 2.100
Input #0, avisynth, from 'test.avs':
Duration: 00:00:10.00, start: 0.000000, bitrate: 0 kb/s
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, smpte170m/unknown/unknown), 480x106, 24 fps, 24 tbr, 24 tbn
At least one output file must be specified

If it shows that it detects the input as avisynth with all the normal stats (resolution, pixel format, etc.) then it's seeing libavisynth.so like it's supposed to. If you were to use ffplay-avs test.avs, you'd actually see the script output.

But this also means you now have two copies of AviSynth+ installed, so I'd recommend going into /usr/local and deleting the pertinent files there (the three libavisynth.so* files in /usr/local/lib64, the 'avisynth' directory in /usr/local/lib64, and the 'avisynth' directory in /usr/local/include).

To clarify, the instructions you gave provide option B without aliasing LD_LIBRARY_PATH. Is this correct?
The instructions were for scenario A. The FFmpeg examples I showed (where it doesn't work by default but does with LD_LIBRARY_PATH) were if I let AviSynth+ be installed to /usr/local like it would be if I didn't use -DCMAKE_INSTALL_PREFIX to override the install location.

Basically,

Option A: Install AviSynth+ to /usr
Result: avs2yuv and FFmpeg with --enable-avisynth will *just work*.

Option B: Install AviSynth+ to /usr/local (the default behavior) or literally anywhere else on the system
Result: you need to use LD_LIBRARY_PATH when invoking avs2yuv or ffmpeg-avs so they can see where libavisynth.so is located. The aliasing would be adding a line to .bashrc so that when you use 'avs2yuv' or 'ffmpeg-avs', the bash profile automatically adds the correct LD_LIBRARY_PATH value to the front of the command.

Option C: same as option B, but instead of aliasing anything, you would just add more search paths to LD_LIBRARY_PATH, so that every program looks in those areas, not just avs2yuv or ffmpeg-avs. If you planned to write shell scripts that would be working with encoding from AviSynth scripts, aliased functions don't work; you either have to add LD_LIBRARY_PATH values in the shell script, or rely on the values already having been added by the environment.

belonesox
21st September 2023, 19:20
Hello, just compiled AVISynth+ (+ffmpeg, +mpv) on linux, examples with
«Version»/«ColorBars» works OK.

But I cannot find working source filter for media files,
looks like on Linux we have no internal AVISource.

avisynth: Script error: There is no function named 'AVISource'


If the only way to open media is a plugin, that plugin (FFMS2, BestSource…) works better now for AVS+ on Linux?

And how (without AVISource ) we should open "avs" scripts from AVISynth scripts?

qyot27
21st September 2023, 23:12
FFMS2 (both the C++ and C plugin) and LSMASHSource (https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works) are both able to be used with AviSynth+ on Linux. AVISource (and its sister functions OpenDMLSource, AVIFileSource, and WAVSource) and DirectShowSource are both tied to Windows-specific media frameworks, so they'll only work on Windows - or in AVISource's case if you've set up the codecs correctly, Wine.

And how (without AVISource ) we should open "avs" scripts from AVISynth scripts?
Import(), just like on Windows.

belonesox
23rd September 2023, 12:28
Thank you very much!

Unfortunately still cannot get working sample of MPV + AVS + FFMS2. :(

Here test files to reproduce (https://i.0x1.tv/s/J6iWfFpgxcXwqqa) («Download all files» button on right top corner).

./mpv-avisynth-colorbars-ok.sh — Show MPV with AVS ColorBars, OK.

./mpv-avisynth-ffms-not-ok.sh — MPV did not showing without any errors in log (https://i.0x1.tv/s/qaTroStFEW22ApX)

'''

[ 0.136][d][demux] Trying demuxer: lavf (force-level: unsafe)
[ 0.145][d][file] resize stream to 131072 bytes, drop 0 bytes
[ 0.145][v][lavf] Found 'avisynth' at score=50 size=181.
[ 0.158][d][osc] osc_init
[ 0.158][d][cplayer] Run command: change-list, flags=64, args=[name="shared-script-properties", operation="append", value="osc-margins=0.000000,0.000000,0.000000,0.000000"]
[ 0.158][v][cplayer] Set property: shared-script-properties -> 1
[ 10.831][d][cplayer] Run command: quit, flags=73, args=[code="4"]
'''

Does anyone have an idea what is wrong? :(

qyot27
23rd September 2023, 23:01
FFMS2 doesn't install to any of the autoload directories* by default. You need to either symlink or copy it there, or use LoadPlugin (or AddAutoloadDir, but I wouldn't do that for locations like /usr/local/lib) in the script. I have seen some plugins hook their buildsystems' install function to put the plugin in the system autoload directory, but it's not universal, and in some cases, there is no buildsystem install function, requiring the user to just copy/move the plugin to the right directory.

*On *nix, there are three locations searched for plugins to autoload: $(prefix)/$(libdir)/avisynth, $HOME/.avisynth, and $HOME/.local/lib/avisynth (which can also be overridden when configuring the core). The latter two aren't created automatically, so if you'd rather use one of those, you'll have to create them. $(prefix)/$(libdir)/avisynth is created by the normal install process to hold the core plugins (TimeStretch, Shibatch, ImageSeq, and ConvertStacked).

belonesox
24th September 2023, 09:00
FFMS2 doesn't install to any of the autoload directories* by default. You need to either symlink or copy it there, or use LoadPlugin (or AddAutoloadDir, but I wouldn't do that for locations like /usr/local/lib) in the script.


Yes, I copy it here (I have tried with absolute path and without it, no errors in log), I load FFMS directly (mpv-avisynth-ffms-not-ok.avs (https://i.0x1.tv/s/4NryCfPDPmig5pT))


LoadPlugin("libffms2.so")
FFVideoSource("test.avi")


Please, look at test files (https://i.0x1.tv/s/J6iWfFpgxcXwqqa), probably AVS works OK, but there might be something wrong on the border between AVS, MPV, and FFMS.

qyot27
24th September 2023, 15:43
How did you build FFMS2?

belonesox
24th September 2023, 23:41
How did you build FFMS2?


commit ef243ab40b8d4b6d18874c6cef0da1a2f55a6a45


CPPFLAGS=-I/usr/local/include/avisynth LDFLAGS=-L/usr/local/lib ./configure --enable-avisynth
CPPFLAGS=-I/usr/local/include/avisynth LDFLAGS=-L/usr/local/lib make


Shoud I try other version of FFMS? Can you recommend any version of FFMS that is working for you?

qyot27
25th September 2023, 00:05
The FFmpeg you built - did you build it as shared or as static? And if there are two installs of FFmpeg on the system (one in /usr, and your locally-built one in /usr/local), which one is FFMS2 actually linking against?

belonesox
25th September 2023, 01:05
And if there are two installs of FFmpeg on the system (one in /usr, and your locally-built one in /usr/local), which one is FFMS2 actually linking against?
I did not install any locally builded ffmpegs into my system, so I link FFMS2 against standard system (dynamic) ffmpeg from RPMs for Fedora 37:


ffmpeg-libs-5.1.3-3.fc37.x86_64
ffmpeg-5.1.3-3.fc37.x86_64
ffmpeg-devel-5.1.3-3.fc37.x86_64



rpm -ql ffmpeg-devel

/usr/lib64/libavcodec.so
/usr/lib64/libavdevice.so
/usr/lib64/libavfilter.so
/usr/lib64/libavformat.so
/usr/lib64/libavutil.so
/usr/lib64/libpostproc.so
/usr/lib64/libswresample.so
/usr/lib64/libswscale.so




The FFmpeg you built - did you build it as shared or as static?


Yes, I also build local version of ffmpeg


commit 9b454fdaef413edfc8e0473569462271a64c59fb

./configure --prefix=$HOME/ffmpeg_build --enable-gpl --enable-version3 --disable-doc --disable-debug --enable-pic --enable-avisynth --enable-ffplay


and «ffplay» from that build works with troubled «mpv-avisynth-ffms-not-ok.avs» (that load ffms plugin that i built using system ffmpeg), but I did not use that ffmpeg to build FFMS2.

qyot27
25th September 2023, 20:06
So it's *just* your built mpv that has the problem? Did you install all of its dependencies before trying to build it?
sudo dnf builddep mpv
I could only get SDL2 output to work inside the VM, and that requires explicitly passing -Dsdl2=enabled to meson when you're configuring mpv. Getting any of the other VOs requires grabbing those dependencies, or just grabbing all of the ones flagged in the .rpm by using the builddep command above. Most of them automatically enable themselves if possible, SDL2 is just an outlier.

belonesox
26th September 2023, 16:30
So it's *just* your built mpv that has the problem?


May be.

But «my MPV» works OK with «mpv-avisynth-colorbars-ok.sh»
and somehow failed with «mpv-avisynth-ffms-not-ok.sh».

Looks like my mpv understand AVISynth, but definitely not calling «FFVideoSource» (because .ffindex not generated).
But I have not idea how to effectively troubleshoot it without errors in MPV log.



Did you install all of its dependencies before trying to build it?
sudo dnf builddep mpv


Yes (so no problem with SDL2), but I build MPV not from fedora specs, I use «https://github.com/mpv-player/mpv-build.git»


use-libplacebo-custom v4.208.0
use-mpv-custom v0.35.1
(commit 140ec21c89d671d392877a7f3b91d67e7d7b9239 )
use-ffmpeg-master (commit fa20f5cd9e131f22da06ef57bf5aedd87ff51a90)


Can you confirm that your build of MPV works ok with my example
«mpv-avisynth-ffms-not-ok.sh»?

If so, tell me please what version/commit of MPV, and how you built it (version of ffmpeg, avisynth to link with).

belonesox
26th September 2023, 18:58
I just rebuild standard ffmpeg («ffmpeg-5.1.3-3.fc37.src.rpm»), enabling «--enable-avisynth» in spec file, install it,
and rebuild standart mpv («mpv-0.35.1-2.fc37.src.rpm»), linking to this ffmpeg.

And same issue persists (ok — ColorBars, not OK — FFMS2).

qyot27
26th September 2023, 19:25
What is the output of

ls ~/.avisynth ~/.local/lib/avisynth ~/.local/lib64/avisynth /usr/lib64/avisynth /usr/local/lib/avisynth /usr/local/lib64/avisynth

belonesox
26th September 2023, 20:47
What is the output of

ls ~/.avisynth ~/.local/lib/avisynth ~/.local/lib64/avisynth /usr/lib64/avisynth /usr/local/lib/avisynth /usr/local/lib64/avisynth


$ ls ~/.avisynth ~/.local/lib/avisynth ~/.local/lib64/avisynth /usr/lib64/avisynth /usr/local/lib/avisynth /usr/local/lib64/avisynth
ls: cannot access '/home/stas/.avisynth': No such file or directory
ls: cannot access '/home/stas/.local/lib/avisynth': No such file or directory
ls: cannot access '/home/stas/.local/lib64/avisynth': No such file or directory
ls: cannot access '/usr/lib64/avisynth': No such file or directory
ls: cannot access '/usr/local/lib/avisynth': No such file or directory
/usr/local/lib64/avisynth:
libconvertstacked.so libimageseq.so libshibatch.so libtimestretch.so


strace log (https://i.0x1.tv/s/4z28jtNoAcj8fL4) also shows that not "not found" libs:



2171084 openat(AT_FDCWD, "/home/stas/.avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/home/stas/.avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/home/stas/.local/lib/avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/home/stas/.local/lib/avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 9
2171084 newfstatat(9, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libimageseq.so", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=101808, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/libIL.so.1", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/usr/lib64/libIL.so.1", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=502432, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/libmng.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/usr/lib64/libmng.so.2", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=482128, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/libjasper.so.6", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
2171084 openat(AT_FDCWD, "/usr/lib64/libjasper.so.6", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=344744, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libshibatch.so", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=179600, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libtimestretch.so", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=129944, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libconvertstacked.so", O_RDONLY|O_CLOEXEC) = 10
2171084 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=47008, ...}, AT_EMPTY_PATH) = 0
2171084 openat(AT_FDCWD, "/usr/local/lib64/avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 9
2171084 newfstatat(9, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
2171084 getcwd("/mnt/storage/nextclouds/i/software/bugs/avisynth-mpv", 4096) = 53
2171084 openat(AT_FDCWD, "/mnt/storage/nextclouds/i/software/bugs/avisynth-mpv/libffms2.so", O_RDONLY|O_CLOEXEC) = 9
2171084 newfstatat(9, "", {st_mode=S_IFREG|0755, st_size=260984, ...}, AT_EMPTY_PATH) = 0
2171072 --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---

qyot27
26th September 2023, 21:30
You don't have libffms2 in any of the autoload paths. And implicitly speaking, trying to rely on ensuring you're using the correct absolute path every time with LoadPlugin is rather fragile and very easy to make mistakes with.

ln -s /usr/local/lib64/libffms2.so /usr/local/lib64/avisynth/libffms2.so

belonesox
26th September 2023, 21:32
I just rebuild standard ffmpeg («ffmpeg-5.1.3-3.fc37.src.rpm»), enabling «--enable-avisynth» in spec file, install it,
and rebuild standart mpv («mpv-0.35.1-2.fc37.src.rpm»), linking to this ffmpeg.

And same issue persists (ok — ColorBars, not OK — FFMS2).

+ «ffplay» from rebuilded «ffmpeg-5.1.3-3.fc37.src.rpm» also works
with ColorBars, and not works with FFMS2

belonesox
26th September 2023, 21:45
You don't have libffms2 in any of the autoload paths.


Yes, but I provided absolute path to libffms, and strace logs show that libffms was found.


And implicitly speaking, trying to rely on ensuring you're using the correct absolute path every time with LoadPlugin is rather fragile and very easy to make mistakes with.

Of course, I just wish to make it work somehow


ln -s /usr/local/lib64/libffms2.so /usr/local/lib64/avisynth/libffms2.so

«Libffms» selfinstalled «make install» to «/usr/local/lib», so
I added symlink


ln -s /usr/local/lib/libffms2.so /usr/local/lib64/avisynth/libffms2.so


and nothing changed — it obviously found libffms2.so
(mpv-avisynth-ffms-not-ok-after-symlinking.strace (https://i.0x1.tv/s/kXBrcwMREBGnzi3))



2191774 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=129944, ...}, AT_EMPTY_PATH) = 0
2191774 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libconvertstacked.so", O_RDONLY|O_CLOEXEC) = 10
2191774 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=47008, ...}, AT_EMPTY_PATH) = 0
2191774 openat(AT_FDCWD, "/usr/local/lib64/avisynth/libffms2.so", O_RDONLY|O_CLOEXEC) = 10
2191774 newfstatat(10, "", {st_mode=S_IFREG|0755, st_size=260984, ...}, AT_EMPTY_PATH) = 0
2191774 openat(AT_FDCWD, "/usr/local/lib64/avisynth/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 9
2191774 newfstatat(9, "", {st_mode=S_IFDIR|0755, st_size=4096, ...}, AT_EMPTY_PATH) = 0
2191774 openat(AT_FDCWD, "/usr/local/lib/libffms2.so", O_RDONLY|O_CLOEXEC) = 9
2191774 newfstatat(9, "", {st_mode=S_IFREG|0755, st_size=260984, ...}, AT_EMPTY_PATH) = 0
2191745 --- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---



but something wrong happened.

What versions of AVISynth and FFMS work together for you?

qyot27
26th September 2023, 23:44
git master of both AviSynth+ (r4003 / fc5b9bc41fd47001b7da39ea777d29c0ede2a2a7) and FFMS2 (ef243ab40b8d4b6d18874c6cef0da1a2f55a6a45), as well as the standard HEAD of the FFMS2 C-plugin (https://github.com/qyot27/ffms2_cplugin/commit/d42a696e24a079cc9eba9bdf084669bb30db4828). Fedora 38 x86_64.

https://i.imgur.com/OPl7cbOh.png (https://i.imgur.com/OPl7cbO.png)

(libffms2.so.5.0.0 in /usr/local/lib is the upstream autotools buildsystem, libffms2.so.3.1.1 in /usr/local/lib64 is the C-plugin, built by meson)

belonesox
27th September 2023, 01:22
git master of both AviSynth+ (r4003 / fc5b9bc41fd47001b7da39ea777d29c0ede2a2a7) and FFMS2 (ef243ab40b8d4b6d18874c6cef0da1a2f55a6a45),


I aligned by versions with you on AVS+, FFMS2, MPV — same problem.

Probably something magicly broken on my box, I will try to install FC38 on other laptop, to absolutely reproduce your setup (how did you build MPV?)



as well as the standard HEAD of the FFMS2 C-plugin (https://github.com/qyot27/ffms2_cplugin/commit/d42a696e24a079cc9eba9bdf084669bb30db4828). Fedora 38 x86_64.


Cannot get why we need «FFMS2 C-plugin» → I just tried to use it as AVS+ plugin but get


[ffmpeg/demuxer] avisynth: '/usr/local/lib64/avisynth/libffms2.so' cannot be used as a plugin for AviSynth.
[ffmpeg/demuxer] (./test04.avs, line 4)
[lavf] avformat_open_input() failed
Failed to recognize file format.

qyot27
27th September 2023, 02:12
The meson buildsystem doesn't build any of plugin interfaces by default, it's just the plain library. -Davisynth-c=enabled turns on the C-plugin.

mpv was built by fetching the builddeps, and then just
PKG_CONFIG_PATH=/path/to/ffmpeg-avs/lib/pkgconfig meson setup ../ -Dsdl2=enabled

belonesox
28th September 2023, 01:29
mpv was built by fetching the builddeps, and then just
PKG_CONFIG_PATH=/path/to/ffmpeg-avs/lib/pkgconfig meson setup ../ -Dsdl2=enabled

Thank you very much!

Finally I get my example working!

I build
1) FFMPEG with AVS,

./configure --prefix=$HOME/ffmpeg_build --enable-gpl --enable-version3 --disable-doc --disable-debug --enable-pic --enable-avisynth --enable-ffplay --enable-shared --disable-static


2) MPV

PKG_CONFIG_PATH=/home/stas/ffmpeg_build/lib/pkgconfig meson setup ../ -Dsdl2=enabled


and FFMS2


PKG_CONFIG_PATH=/home/stas/ffmpeg_build/lib/pkgconfig CPPFLAGS=-I/usr/local/include/avisynth LDFLAGS=-L/usr/local/lib ./configure --enable-avisynth


linked to same FFMPEG with AVS.

Looks my problem was because FFMS2 was linked to different version of FFMPEG.

Wilbert
15th August 2026, 18:16
So I build AviSynth and ffms2 on Trixie (using the bash script from the Linux thread). The simple text file containing Version() plays fine with MPV and ffplay.

I can't get ffms2 too work. When playing a script it complains (...) There is no function named 'FFAudioSource'.

The plugin was installed here usr/local/lib/libffms2.so. Should i add usr/local/lib in the path variable (because it's not there when i do echo $PATH)?

qyot27
15th August 2026, 19:45
It doesn't try to load from /usr/local/lib, but one of:
/usr/local/lib/avisynth (actually, $(prefix)/$(libdir)/avisynth, which by default is usually /usr/local/lib/avisynth)
$HOME/.avisynth
$HOME/.local/lib/avisynth

FFMS2 only installs to the main lib dir if you don't specifically override it during configure, but since it is a general-purpose library, arguably the most 'correct' way to do it is leave libffms2.so* in /usr/local/lib, and then create a symlink:
mkdir -p $HOME/.local/lib/avisynth && \
ln -s /usr/local/lib/libffms2.so $HOME/.local/lib/avisynth/libffms2.so

Alternatively, you could also manually load it with LoadPlugin:
LoadPlugin("/usr/local/lib/libffms2.so")

Wilbert
16th August 2026, 16:56
Thanks! LoadPlugin works fine (i didn't try this symlink).

So i general i can move plugins around (copy them to $HOME/.avisynth for autoloading for example), provided they don't depend on other libraries like ffms2?

qyot27
16th August 2026, 18:33
You could copy FFMS2 to any of those directories as well, the symlink was simply the more Unix-y way of keeping things organized. But libffms2 itself is a potential dependency of other programs - Aegisub, for example - that don't use it as an AviSynth (or VapourSynth) plugin, so the reason I said it should stay in /usr/local/lib is purely because of that.

The autoloading directories is something that goes beyond non-Windows support, since AviSynth+ has script functions to designate ostensibly any directory for autoloading - AddAutoloadDir() (to add a directory to the autoload search path) and ClearAutoloadDirs() (to remove all autoload directories) most directly, but when building the library, you actually can specify a custom autoload directory that would be built directly into the library's search paths - on Linux, etc., that custom directory would take the place of $HOME/.local/lib/avisynth in the list I posted above. The reason /usr/local/lib is not an autoloaded directory is because it contains libraries that aren't plugins.