View Full Version : Avisynthplus and ffms2 on ubuntu linux
emcodem
16th January 2021, 13:59
Hi,
i am trying to get a combination of avisynth+, ffms2 and ffmpeg to work in Ubunutu (windows subsystem). All built from source and using latest git master branch.
So far so good, all compiled well and i can get ffmpeg and avisynth working together with e.g. colorbars().
Unfortunately i fail using ffms2.
LoadPlugin("/usr/local/lib/libffms2.so")
Error:
'/usr/local/lib/libffms2.so' cannot be used as a plugin for AviSynth
Any clues?
qyot27
16th January 2021, 14:24
You have to build FFMS2 with --enable-avisynth passed to autogen/configure. It doesn't enable it by default (and will require using CPPFLAGS to point it at the location of avisynth's include directory).
StainlessS
16th January 2021, 14:50
So all windows style '*.dll"'s will be renamed Linux style "*.so", and base name node may (or maybe sometimes may not) be named differently, yes ?
Lets face the music and dance:- https://www.youtube.com/watch?v=gACCCmFKP80 :)
EDIT:
I don't really feel like doing anything with Mint at the moment, update to Cinnamon Mint 20.01 broke it,
is not un-mounting filesystem properly [oldroot] (no TimeShift backup thing).
Apparently a problem going back 4 or 5 years, Ubuntu based.
EDIT: Maybe I reinstall 20.0 yet again. [some kernel updates on 20.0 also do the 'not un-mount' thing]
qyot27
16th January 2021, 16:11
So all windows style '*dll"'s will be renamed Linux style "*.so", and base name node may (or maybe sometimes may not) be named differently, yes ?
Yes, lib*.so is the standard naming for libraries on Linux (and BSD, and Haiku). On OSX/macOS it's lib*.dylib.
Directory-wise, it depends on where the OS puts user-built/installed stuff by default (often /usr/local, but not always) or where the user has specifically overridden it with the -DCMAKE_INSTALL_PREFIX option.
Autoloading is also available, and on non-Windows AviSynth+ checks three different locations by default:
$(PREFIX)/avisynth. Where $(PREFIX) is the system install location (/usr/local/lib/avisynth, /usr/lib/avisynth, whatever). This is the most obvious one, as it's where ConvertStacked, TimeStretch, ImageSeq, and Shibatch plugins get installed. FFMS2 doesn't put a copy of itself or a symlink into this directory, but the user can.
$HOME/.avisynth. The user has to create this directory first, but it doesn't require admin privileges.
The value of -DLOCAL_PLUGINDIR when you configured CMake. This defaults to $HOME/.local/lib/avisynth. This one also does not require admin privileges, and the again, the user has to create this one themselves first.
The easiest thing for the user to do with FFMS2 is probably to put a symbolic link to it in either $HOME/.avisynth or $HOME/.local/lib/avisynth:
mkdir $HOME/.avisynth
cd $HOME/.avisynth
ln -s /usr/local/lib/libffms2.so.4.0.0 libffms2.so
StainlessS
16th January 2021, 16:25
Great answer, thanks quot27.
EDIT: Anticipating many problematic posts on D9 concerning LoadPlugin(),
maybe LoadPlugin source should retry on failure with conversion to "lib*.so" where target is linux and where case insensitive dll name ends in ".dll",
and similar coersions depending upon other target machines and eg "lib*.so" dll name.
Might obviate a whole helluva lot of trouble. [ie lots of similar threads posing exact same question, and answer]
Could be done in script but [using similar to SysInfo Plugin] but much easier in AVS base code.
[also direct embedding in LoadPlugin rather than having to call some script stub function which calls LoadPlugin]
emcodem
16th January 2021, 17:53
Great, thanks a lot for the quick answer, @qyot27. It worked the way you described :D
FFMS2 compilation:
./configure --enable-avisynth
make -j 16 LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/mnt/c/dev/ffmpeg_latest/AviSynthPlus/avs_core/include"
Fun fact, on my system, as said, using windows subsystem for Linux and Ubuntu 20.something from the windows store, benachmark for this script:
colorbars()
assumefieldbased()
assumetff()
Windows: speed=40.7x
Linux: speed= 112x
Highly unexpected ^^
qyot27
16th January 2021, 18:17
I actually meant /usr/local/include/avisynth, but that works.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.