Selur's Little Message Board
vsViewer reveals problem with vapoursynth.so (I think) - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: vsViewer reveals problem with vapoursynth.so (I think) (/thread-3553.html)



vsViewer reveals problem with vapoursynth.so (I think) - drfear - 20.01.2024

Still on the trail of testing plugins but I have yet to get past first base ...

I've installed vsViewer from github, but when I run it (standalone) it shows, as I would expect, just two lines of code
import vapoursynth as vs
core = vs.core
and then, unexpectedly, a red error message
2024-01-20 15:59:02.574
Failed to initialize VapourSynth environment!
Failed to initialize VapourSynth environment!
If I run those two code lines in a console python session, there is no complaint, however, see what happens with the 4th code line below:
>>> import vapoursynth as vs
>>> vs
<module 'vapoursynth' from '/home/myname/opt/vapoursynth/lib/python3.11/site-packages/vapoursynth.so'>
>>> core = vs.core
>>> core
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "src/cython/vapoursynth.pyx", line 2750, in vapoursynth._CoreProxy.__repr__
  File "src/cython/vapoursynth.pyx", line 2715, in vapoursynth._CoreProxy.core.__get__
  File "src/cython/vapoursynth.pyx", line 2701, in vapoursynth._get_core
  File "src/cython/vapoursynth.pyx", line 2705, in vapoursynth.vsscript_get_core_internal
  File "src/cython/vapoursynth.pyx", line 2681, in vapoursynth.createCore
vapoursynth.Error: Failed to obtain VapourSynth API pointer. System does not support SSE2 or is the Python module and loaded core library mismatched?
(By the way, the problem is definitely not due to lack of SSE2, checked that with 'cat /proc/cpuinfo | grep flags' just to be sure.)

This seems like it might be related to a problem relating to passing pointers as integers reported as fixed a few years ago, https://github.com/vapoursynth/vapoursynth/issues/468 but I am completely baffled.  Also, if it is actually a bug in the source code of vapoursynth, why doesn't everyone in the world have the same problem?

I've tried compiling with both system and local Cython 3.0.8-1 - no difference.

On the plus side, this would explain why absolutely none of my plugin testing has been successful so far :-)

Any clues?


RE: vsViewer reveals problem with vapoursynth.so (I think) - Selur - 20.01.2024

if you call:
vspipe --version
Does it work and properly show the Vapoursynth version info?
If not, your setup probably doesn't load the Vapoursynth libraries.
(see: point 4 in https://github.com/Selur/hybrid-vapoursynth-addon/blob/master/README.md)


Cu Selur


RE: vsViewer reveals problem with vapoursynth.so (I think) - drfear - 20.01.2024

Oh I can't believe I be so dumb.  Of course.  I've been having a lot of trouble with setting $ LD_LIBRARY_PATH="/home/vsimon/opt/vapoursynth/lib" globally - it breaks tons of things, notably mpv (oddly, because as far as I can see, the libavcodec in vapoursynth and /usr/lib are the same).  So I had added /usr/lib:..., partially masking vapoursynth.

So yes that's a great help, thanks, at least now I get the environment set ok.  However I still have a problem - no lsmas component:
$ LD_LIBRARY_PATH="/home/vsimon/opt/vapoursynth/lib" python
Python 3.11.6 (main, Nov 14 2023, 09:36:21) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vapoursynth as vs
>>> core = vs.core
>>> core
<vapoursynth._CoreProxy object at 0x00007FBBC87848E0 core=<vapoursynth.Core object at 0x00007FBBC84ECB80 core_version=R66, api_version=R4.1, num_threads=8, max_cache_size=4096, used_cache_size=0>>
>>> core.lsmas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "src/cython/vapoursynth.pyx", line 2741, in vapoursynth._CoreProxy.__getattr__
  File "src/cython/vapoursynth.pyx", line 2564, in vapoursynth.Core.__getattr__
AttributeError: No attribute with the name lsmas exists. Did you mistype a plugin namespace?

... so I can't load any clips .-(

Actually give me an hour before taking any time to respond.  It occurs to me I might have had /usr/lib first in my path when I compiled ... I'll try a recompile

well no, it wasn't that.  I had re-run config.txt so I did everything by the book. I have
>>> dir(core)
['__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', 'add_log_handler', 'api_version', 'clear_cache', 'core', 'core_version', 'create_video_frame', 'flags', 'get_video_format', 'grain', 'log_message', 'max_cache_size', 'num_threads', 'plugins', 'query_video_format', 'remove_log_handler', 'resize', 'std', 'text', 'timings', 'used_cache_size', 'version', 'version_number']



RE: vsViewer reveals problem with vapoursynth.so (I think) - drfear - 20.01.2024

NOW SOLVED

Initial problem was of course the LD_LIBRARY_PATH issue, second problem with core.lsmas solved when I brought in ALL the plugins (I had been trying to test them one by one, but I guess one of them being called libbestsource should have been a clue ...).


RE: vsViewer reveals problem with vapoursynth.so (I think) - Selur - 20.01.2024

bestsource atm. is 'still in the extremely experimental phase' according to its author, so I would recommend to keep that in mind when using it.