caprica / vlcj

Java framework for the vlc media player
http://www.capricasoftware.co.uk/projects/vlcj
1.13k stars 259 forks source link

Error looking up function 'libvlc_video_set_output_callbacks': /usr/lib/libvlc.so: undefined symbol: libvlc_video_set_output_callbacks #1043

Closed lsiem closed 3 years ago

lsiem commented 3 years ago

I'm using vlcj 5 together with lwjgl and I'm getting the following exception:

Error looking up function 'libvlc_video_set_output_callbacks': /usr/lib/libvlc.so: undefined symbol: libvlc_video_set_output_callbacks
Exception in thread "main" uk.co.caprica.vlcj.factory.NativeLibraryMappingException: Failed to properly initialise the native library
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.discoverNativeLibrary(MediaPlayerFactory.java:184)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.<init>(MediaPlayerFactory.java:108)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.<init>(MediaPlayerFactory.java:163)
    ...

Caused by: java.lang.NoClassDefFoundError: Could not initialize class uk.co.caprica.vlcj.binding.LibVlc
Caused by: java.lang.NoClassDefFoundError: Could not initialize class uk.co.caprica.vlcj.binding.LibVlc`

I installed libvlc 5.6.0-6 from the AUR and pointed to the libvlc path: NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), "/usr/lib/");

Is it because of VLC API changes since version 5 of their library or am I missing something here?

caprica commented 3 years ago

There is no such thing as libvlc 5.anything, or if there is, it is definitely not version 5 of LibVLC.

There is only LibVLC 3.x (current release) or LibVLC 4.x (not yet released, but available from VLC's git repo).

You are always going to be better off either installing only the official VLC package for your OS (which includes LibVLC), or for VLC 4.x since you seem to be on Linux, it's not so hard to build it yourself.

I am not aware of any pre-release VLC 4 packages for Linux, but they may exist.

caprica commented 3 years ago

You really no longer should be using NativeLibrary.addSearchPath in any case, check the Javadoc for vlcj's native discovery mechanism.

The simplest way to do it now is to create a file named ~/.config/vlcj/vlcj.config and add something like this:

nativeDirectory=/home/build/install/libvlc-4.x-git
lsiem commented 3 years ago

Thank you for the answer. I uninstalled the AUR package and compiled VLC manually. Unfortunately I'm getting the following VLC error:

main generic debug: no vout display modules matched with name gl
main video output error: video output display creation failed

I could not find any useful information about this error but it's most likely VLCJ unrelated right?

caprica commented 3 years ago

Please run the vlcj LWJGL demo to check if your environment and VLC is OK.

https://github.com/caprica/vlcj-lwjgl-demo

Your error suggests your VLC build does not contain the OpenGL video output plugin, which is surprising. When you built VLC, check the configure logs to see why that might be the case.