Log in

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


Pages : 1 2 [3]

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.