Closed DeadNews closed 4 years ago
Compilation was successful, but cmake can't find the lib of VapourSynth API, you may need to build VapourSynth of Linux first, or get a prebuild version of VapourSynth with SDK. Then you need to set -D VapourSynth_SDK_PATH = your sdk path
And make sure that the directory structure of VapourSynth SDK is like
somepath
- sdk
- include
-VapourSynth.h
- lib64
-libVapourSynth.a
cmake . -D Build_VapourSynth_plugin=ON -D Build_GUI=OFF -D Build_CLI=OFF -D VapourSynth_SDK_PATH = somepath/sdk
What do you mean by “VapourSynth SDK”? Vapoursynth installed from repo: https://www.archlinux.org/packages/community/x86_64/vapoursynth/
Package Contents: usr/ usr/bin/ usr/bin/vspipe usr/include/ usr/include/vapoursynth/ usr/include/vapoursynth/VSHelper.h usr/include/vapoursynth/VSScript.h usr/include/vapoursynth/VapourSynth.h usr/lib/ usr/lib/libvapoursynth-script.so usr/lib/libvapoursynth-script.so.0 usr/lib/libvapoursynth-script.so.0.0.0 usr/lib/libvapoursynth.so usr/lib/pkgconfig/ usr/lib/pkgconfig/vapoursynth-script.pc usr/lib/pkgconfig/vapoursynth.pc usr/lib/python3.8/ usr/lib/python3.8/site-packages/ usr/lib/python3.8/site-packages/vapoursynth.so usr/lib/vapoursynth/ usr/lib/vapoursynth/libeedi3.so usr/lib/vapoursynth/libimwri.so usr/lib/vapoursynth/libmiscfilters.so usr/lib/vapoursynth/libmorpho.so usr/lib/vapoursynth/libocr.so usr/lib/vapoursynth/libremovegrain.so usr/lib/vapoursynth/libsubtext.so usr/lib/vapoursynth/libvinverse.so usr/lib/vapoursynth/libvivtc.so usr/share/ usr/share/licenses/ usr/share/licenses/vapoursynth/ usr/share/licenses/vapoursynth/ofl.txt usr/share/mime/ usr/share/mime/packages/ usr/share/mime/packages/vapoursynth.xml
directory structure of VapourSynth SDK
There's no such directory structure.
VapourSynth.h
Without "export CPATH=/usr/include/vapoursynth" the build will end with error:
/home/deadnews/Anime4KCPP/VapourSynth/src/Anime4KCPPVS.cpp:2:10: fatal error: VapourSynth.h: No such file or directory
2 | #include <VapourSynth.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
It's kind of been resolved (thx to google).
libVapourSynth.a
There is no such file. There's "libvapoursynth.so". I tried with:
export LIBRARY_PATH=/usr/lib/ && \
export LD_LIBRARY_PATH=/usr/lib/ && \
export LDFLAGS="-L/usr/lib/" && \
But it's not helping...
This directory structure is what VapourSynth do in the Windows, in Linux, you may need to create a directory like that, and copy files to it, then specify VapourSynth_SDK_PATH
Create a dir like what I showed, then copy usr/lib/libvapoursynth.so
and usr/include/vapoursynth/VapourSynth.h
to the corresponding dir.
Specify VapourSynth_SDK_PATH
to the dir.
I tried that (with copy of libvapoursynth.so). It's not helping.
I will test it in the Manjaro Linux. What's error info if try to link libvapoursynth.so
libAnime4KCPP_VapourSynth.so is not created with this error. If remove these lines from "./Anime4KCPP/cmake/ThirdPartyForVS.cmake":
target_link_directories(${PROJECT_NAME} PRIVATE ${VapourSynth_SDK_PATH}/lib64)
target_link_libraries(${PROJECT_NAME} VapourSynth)
Then libAnime4KCPP_VapourSynth.so is created.
What's error info if try to link libvapoursynth.so
Like that ~ >>> ld --library-path=/usr/lib --library=vapoursynth /home/deadnews/my/downloads/Anime4KCPP/bin/libAnime4KCPP_VapourSynth.so
?
ld out: link
Then libAnime4KCPP_VapourSynth.so is created.
Does the libAnime4KCPP_VapourSynth.so work?
The lines you removed will find the VapourSynth SDK lib then link it.
From your error info it looks like if your try to link a shard lib of VapourSynth, there are too many other libs need be linked.
Does the libAnime4KCPP_VapourSynth.so work?
Doesn't look like it.
src = core.anime4kcpp.Anime4KCPP(src = src, GPUMode = 1, ACNet = 1, zoomFactor = 2, HDN = 1)
File "src\cython\vapoursynth.pyx", line 1546, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name anime4kcpp exists. Did you mistype a plugin namespace?
I have just tested it, the problem is the file name. Copy usr/lib/libvapoursynth.so
, then you need rename it to libVapourSynth.so
or you need change the ./Anime4KCPP/cmake/ThirdPartyForVS.cmake
to
target_link_libraries(${PROJECT_NAME} vapoursynth)
Windows is not case sensitive, but Linux is.
Finally just copy libAnime4KCPP_VapourSynth.so
to /usr/lib/vapoursynth/
, it works fine.
Well, then why not replace
https://github.com/TianZerL/Anime4KCPP/blob/aab869bf42b06068995f4861044ffec9ec1e0c9b/cmake/ThirdPartyForVS.cmake#L5
with this target_link_libraries(${PROJECT_NAME} vapoursynth)
?
After this replacement, this works [1]. But the end result is the same as with manual linking:
src = core.anime4kcpp.Anime4KCPP(src = src, GPUMode = 1, ACNet = 1, zoomFactor = 2, HDN = 1)
File "src\cython\vapoursynth.pyx", line 1546, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name anime4kcpp exists. Did you mistype a plugin namespace?
copy libAnime4KCPP_VapourSynth.so
to /usr/lib/vapoursynth/
, then vapoursynth can find it
this is my test vpy, it works fine in Manjaro Linux:
import vapoursynth as vs
core = vs.get_core()
core.anime4kcpp.listGPUs()
My /usr/lib/vapoursynth/
:
$ ls /usr/lib/vapoursynth/
libAnime4KCPP_VapourSynth.so libeedi3.so libimwri.so libmiscfilters.so libmorpho.so libocr.so libremovegrain.so libsubtext.so libvinverse.so libvivtc.so
There's no mistake in the location of the file.
Your vapoursynth doesn't find libAnime4KCPP_VapourSynth.so
. Make sure you didn't move other .so files or delete them.
I mean, do not move or delete the sdk dir that you created.
Something else is required other than libAnime4KCPP_VapourSynth.so:
import vapoursynth as vs
core = vs.get_core()
core.std.LoadPlugin(path=r'/home/deadnews/my/bin/vpy-plugins/libAnime4KCPP_VapourSynth.so')
src = core.anime4kcpp.listGPUs()
↓
File "src\cython\vapoursynth.pyx", line 1862, in vapoursynth.Function.__call__
vapoursynth.Error: Failed to load /home/deadnews/my/bin/vpy-plugins/libAnime4KCPPCore.so. Error given: libhdf5.so.200: cannot open shared object file: No such file or directory
First warning here:
ld: warning: libhdf5.so.200, needed by /usr/lib//libopencv_hdf.so.4.3, not found (try using -rpath or -rpath-link)
libAnime4KCPPCore.so
is not required by libAnime4KCPP_VapourSynth.so
, but camke will build it by default for CLI and GUI.
So, do not copy libAnime4KCPPCore.so
to plugin dir of vapoursynth.
All you need is libAnime4KCPP_VapourSynth.so
, and beacuse you linked it to libvapoursynth.so
which is a shard lib, you need make sure libAnime4KCPP_VapourSynth.so
can find it.
And what's that warning is? Its actually from OpenCV.
I copied the wrong output. It should have been:
core.std.LoadPlugin(path=r'/home/deadnews/my/bin/vpy-plugins/libAnime4KCPP_VapourSynth.so')
File "src\cython\vapoursynth.pyx", line 1862, in vapoursynth.Function.__call__
vapoursynth.Error: Failed to load /home/deadnews/my/bin/vpy-plugins/libAnime4KCPP_VapourSynth.so. Error given: libhdf5.so.200: cannot open shared object file: No such file or directory
Instead of this:
core.std.LoadPlugin(path=r'/home/deadnews/my/bin/vpy-plugins/libAnime4KCPPCore.so')
File "src\cython\vapoursynth.pyx", line 1862, in vapoursynth.Function.__call__
vapoursynth.Error: Failed to load /home/deadnews/my/bin/vpy-plugins/libAnime4KCPPCore.so. Error given: libhdf5.so.200: cannot open shared object file: No such file or directory
So, do not copy
libAnime4KCPPCore.so
to plugin dir of vapoursynth.
This does not change anything.
No such file or directory
? How could it be, I tried the same code, it just works.
Does it have the right permissions, did you use root user to build it then it only can be readed by root?
it seems i just don't have:
hdf5 (optional) - for the HDF5 module and the Python bindings vtk (optional) - for the viz module
Because they are optional dependencies for opencv, and opencv was installed as a dependency for another package ...
well, I see. I install opencv by pacman directly, everything is fine. Maybe you need reinstall opencv.😂
After installing them, at first glance, everything works.
OS: Manjaro
How build Vapoursynth plugin under Linux? «Solutions from google» didn't help me :)