caprica / vlcj

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

Ubuntu 20.04 Unable to load library 'vlc' using snap package #963

Closed Abu-Abdullah closed 4 years ago

Abu-Abdullah commented 4 years ago

Hi,

i was trying to refresh my app and install it in Ubuntu 20.04 and fedora 32. Fedora 32 was ok but ubuntu has this issue again:

Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'vlc':
libvlc.so: cannot open shared object file: No such file or directory
libvlc.so: cannot open shared object file: No such file or directory
Native library (linux-x86-64/libvlc.so) not found in resource path (AudioCataloger.jar)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:302)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:455)
    at com.sun.jna.Native.register(Native.java:1722)
    at com.sun.jna.Native.register(Native.java:1443)
    at uk.co.caprica.vlcj.binding.LibVlc.<clinit>(LibVlc.java:98)
    at uk.co.caprica.vlcj.support.version.LibVlcVersion.<init>(LibVlcVersion.java:49)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.checkVersion(MediaPlayerFactory.java:195)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.discoverNativeLibrary(MediaPlayerFactory.java:181)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.<init>(MediaPlayerFactory.java:108)
    at uk.co.caprica.vlcj.factory.MediaPlayerFactory.<init>(MediaPlayerFactory.java:132)
    at com.myapp.JVLC.<init>(JVLC.java:517)
    at com.myapp.AudioCataloger.start(AudioCataloger.java:451)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
    at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
    at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(GtkApplication.java:277)
    ... 1 more
    Suppressed: java.lang.UnsatisfiedLinkError: libvlc.so: cannot open shared object file: No such file or directory
        at com.sun.jna.Native.open(Native Method)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:191)
        ... 20 more
    Suppressed: java.lang.UnsatisfiedLinkError: libvlc.so: cannot open shared object file: No such file or directory
        at com.sun.jna.Native.open(Native Method)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:204)
        ... 20 more
    Suppressed: java.io.IOException: Native library (linux-x86-64/libvlc.so) not found in resource path (AudioCataloger.jar)
        at com.sun.jna.Native.extractFromResourcePath(Native.java:1095)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:276)
        ... 20 more

I'm using the normal new NativeDiscovery().discover();

i guess the issue here is with the new 'snap' packaging system that ubuntu is using now by default. vlc is now under /snap/bin/vlc

caprica commented 4 years ago

Where is libvlc.so and the VLC "plugins" directory?

caprica commented 4 years ago

See #916, is the snap package actually correct?

885 #623 #612

Abu-Abdullah commented 4 years ago

yes, it is exactly the same case as in #916 the libvlc.so is loaded only if i set the LD_LIBRARY_PATH before launching java

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/snap/vlc/current/usr/lib

it will not work with -Djna.library.path=/snap/vlc/current/usr/lib

the other problem is that even if it is loaded, the playback is not working and stopped immediently !! i have listeners and the output is

open
seekableChanged
pausableChanged
lengthChanged
playing
lengthChanged
finished
stopped

I'm still investigating the issue

Abu-Abdullah commented 4 years ago

ok here is the uncut logs

[00007f314f78a7e0] main libvlc debug: VLC media player - 3.0.10 Vetinari
[00007f314f78a7e0] main libvlc debug: Copyright © 1996-2020 the VideoLAN team
[00007f314f78a7e0] main libvlc debug: revision 3.0.10-0-g7f145afa84
[00007f314f78a7e0] main libvlc debug: configured with ./configure  '--prefix=/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr' '--disable-wayland' '--enable-merge-ffmpeg' 'CFLAGS= -I/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/include -I/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/include' 'LDFLAGS= -L/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/lib -L/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/lib -L/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/lib/x86_64-linux-gnu -L/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/lib/x86_64-linux-gnu -L/builds/videolan/vlc-3.0/extras/package/snap/stage/lib -L/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/lib -L/builds/videolan/vlc-3.0/extras/package/snap/stage/lib/x86_64-linux-gnu -L/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/lib/x86_64-linux-gnu' 'CPPFLAGS= -I/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/include -I/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/include' 'CXXFLAGS= -I/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/include -I/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/include' 'PKG_CONFIG_PATH=:/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/lib/x86_64-linux-gnu/pkgconfig:/builds/videolan/vlc-3.0/extras/package/snap/parts/vlc/install/usr/share/pkgconfig:/builds/videolan/vlc-3.0/extras/package/snap/stage/usr/share/pkgconfig'
[00007f314f78a7e0] main libvlc debug: searching plug-in modules
[00007f314f78a7e0] main libvlc debug: loading plugins cache file /snap/vlc/1620/usr/lib/vlc/plugins/plugins.dat
[00007f314f78a7e0] main libvlc debug: recursively browsing `/snap/vlc/1620/usr/lib/vlc/plugins'
[00007f314f78a7e0] main libvlc debug: plug-ins loaded: 522 modules
[00007f314c9df6e0] main logger debug: looking for logger module matching "any": 3 candidates
[00007f314c9df6e0] main logger debug: using logger module "console"
[00007f314f78a7e0] main libvlc debug: translation test: code is "C"
[00007f314f826ca0] main keystore debug: looking for keystore module matching "memory": 4 candidates
[00007f314f826ca0] main keystore debug: using keystore module "memory"
[00007f314f78a7e0] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2 FPU 
[00007f314f7580f0] main generic debug: creating audio output
[00007f314d37e210] main audio output debug: looking for audio output module matching "any": 6 candidates
[00007f314d37e210] main audio output warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/audio_output/libpulse_plugin.so' (libvlc_pulse.so.0: cannot open shared object file: No such file or directory)
[00007f314d37e210] alsa audio output debug: Available ALSA PCM devices:
[00007f314d37e210] alsa audio output debug: Playback/recording through the PulseAudio sound server (default)
[00007f314d37e210] alsa audio output debug: Default Audio Device (sysdefault)
[00007f314d37e210] alsa audio output debug: 2.1 Surround output to Front and Subwoofer speakers (surround21)
[00007f314d37e210] alsa audio output debug: 4.0 Surround output to Front and Rear speakers (surround40)
[00007f314d37e210] alsa audio output debug: 4.1 Surround output to Front, Rear and Subwoofer speakers (surround41)
[00007f314d37e210] alsa audio output debug: 5.0 Surround output to Front, Center and Rear speakers (surround50)
[00007f314d37e210] alsa audio output debug: 5.1 Surround output to Front, Center, Rear and Subwoofer speakers (surround51)
[00007f314d37e210] alsa audio output debug: Discard all samples (playback) or generate zero samples (capture) (null)
[00007f314d37e210] alsa audio output debug: Rate Converter Plugin Using Samplerate Library (samplerate)
[00007f314d37e210] alsa audio output debug: Rate Converter Plugin Using Speex Resampler (speexrate)
[00007f314d37e210] alsa audio output debug: JACK Audio Connection Kit (jack)
[00007f314d37e210] alsa audio output debug: Open Sound System (oss)
[00007f314d37e210] alsa audio output debug: PulseAudio Sound Server (pulse)
[00007f314d37e210] alsa audio output debug: Plugin for channel upmix (4,6,8) (upmix)
[00007f314d37e210] alsa audio output debug: Plugin for channel downmix (stereo) with a simple spacialization (vdownmix)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Default Audio Device (sysdefault:CARD=I82801AAICH)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Front speakers (front:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 2.1 Surround output to Front and Subwoofer speakers (surround21:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.0 Surround output to Front and Rear speakers (surround40:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.1 Surround output to Front, Rear and Subwoofer speakers (surround41:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.0 Surround output to Front, Center and Rear speakers (surround50:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.1 Surround output to Front, Center, Rear and Subwoofer speakers (surround51:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH IEC958 (S/PDIF) Digital Audio Output (iec958:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct sample mixing device (dmix:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct sample mixing device (dmix:CARD=I82801AAICH,DEV=1)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct sample snooping device (dsnoop:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct sample snooping device (dsnoop:CARD=I82801AAICH,DEV=1)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct hardware device without any conversions (hw:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct hardware device without any conversions (hw:CARD=I82801AAICH,DEV=1)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Hardware device with all software conversions (plughw:CARD=I82801AAICH,DEV=0)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Hardware device with all software conversions (plughw:CARD=I82801AAICH,DEV=1)
[00007f314d37e210] alsa audio output debug: Intel 82801AA-ICH USB Stream Output (usbstream:CARD=I82801AAICH)
[00007f314d37e210] main audio output debug: using audio output module "alsa"
[00007f314f7580f0] main generic debug: keeping audio output
[00007f314f83da70] main generic debug: creating audio output
[00007f314f8aa1f0] main audio output debug: looking for audio output module matching "any": 6 candidates
[00007f314f8aa1f0] main audio output warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/audio_output/libpulse_plugin.so' (libvlc_pulse.so.0: cannot open shared object file: No such file or directory)
[00007f314f8aa1f0] alsa audio output debug: Available ALSA PCM devices:
[00007f314f8aa1f0] alsa audio output debug: Playback/recording through the PulseAudio sound server (default)
[00007f314f8aa1f0] alsa audio output debug: Default Audio Device (sysdefault)
[00007f314f8aa1f0] alsa audio output debug: 2.1 Surround output to Front and Subwoofer speakers (surround21)
[00007f314f8aa1f0] alsa audio output debug: 4.0 Surround output to Front and Rear speakers (surround40)
[00007f314f8aa1f0] alsa audio output debug: 4.1 Surround output to Front, Rear and Subwoofer speakers (surround41)
[00007f314f8aa1f0] alsa audio output debug: 5.0 Surround output to Front, Center and Rear speakers (surround50)
[00007f314f8aa1f0] alsa audio output debug: 5.1 Surround output to Front, Center, Rear and Subwoofer speakers (surround51)
[00007f314f8aa1f0] alsa audio output debug: Discard all samples (playback) or generate zero samples (capture) (null)
[00007f314f8aa1f0] alsa audio output debug: Rate Converter Plugin Using Samplerate Library (samplerate)
[00007f314f8aa1f0] alsa audio output debug: Rate Converter Plugin Using Speex Resampler (speexrate)
[00007f314f8aa1f0] alsa audio output debug: JACK Audio Connection Kit (jack)
[00007f314f8aa1f0] alsa audio output debug: Open Sound System (oss)
[00007f314f8aa1f0] alsa audio output debug: PulseAudio Sound Server (pulse)
[00007f314f8aa1f0] alsa audio output debug: Plugin for channel upmix (4,6,8) (upmix)
[00007f314f8aa1f0] alsa audio output debug: Plugin for channel downmix (stereo) with a simple spacialization (vdownmix)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Default Audio Device (sysdefault:CARD=I82801AAICH)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Front speakers (front:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 2.1 Surround output to Front and Subwoofer speakers (surround21:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.0 Surround output to Front and Rear speakers (surround40:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 4.1 Surround output to Front, Rear and Subwoofer speakers (surround41:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.0 Surround output to Front, Center and Rear speakers (surround50:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH 5.1 Surround output to Front, Center, Rear and Subwoofer speakers (surround51:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH IEC958 (S/PDIF) Digital Audio Output (iec958:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct sample mixing device (dmix:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct sample mixing device (dmix:CARD=I82801AAICH,DEV=1)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct sample snooping device (dsnoop:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct sample snooping device (dsnoop:CARD=I82801AAICH,DEV=1)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Direct hardware device without any conversions (hw:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Direct hardware device without any conversions (hw:CARD=I82801AAICH,DEV=1)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH Hardware device with all software conversions (plughw:CARD=I82801AAICH,DEV=0)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH, Intel 82801AA-ICH - MIC ADC Hardware device with all software conversions (plughw:CARD=I82801AAICH,DEV=1)
[00007f314f8aa1f0] alsa audio output debug: Intel 82801AA-ICH USB Stream Output (usbstream:CARD=I82801AAICH)
[00007f314f8aa1f0] main audio output debug: using audio output module "alsa"
[00007f314f83da70] main generic debug: keeping audio output
[00007f314f8aa1f0] main audio output debug: removing module "alsa"
open
[00007f314d37e210] main audio output debug: removing module "alsa"
[00007f314c37c670] main input debug: Creating an input for '001.rm'
[00007f314c37c670] main input debug: using timeshift granularity of 50 MiB
[00007f314c37c670] main input debug: using default timeshift path
[00007f314c37c670] main input debug: `http://www.maknoon.com/download/audios/alalbani/alnoor/001.rm' gives access `http' demux `any' path `www.maknoon.com/download/audios/alalbani/alnoor/001.rm'
[00007f3134007300] main input source debug: creating demux: access='http' demux='any' location='www.maknoon.com/download/audios/alalbani/alnoor/001.rm' file='(null)'
[00007f31340074d0] main demux debug: looking for access_demux module matching "http": 21 candidates
[00007f31340074d0] main demux debug: no access_demux modules matched
[00007f3134007a10] main stream debug: creating access: http://www.maknoon.com/download/audios/alalbani/alnoor/001.rm
[00007f3134007a10] main stream debug: looking for access module matching "http": 28 candidates
[00007f3134007a10] http stream debug: resolving www.maknoon.com ...
[00007f3134007a10] http stream debug: outgoing request:
GET /download/audios/alalbani/alnoor/001.rm HTTP/1.1
Host: www.maknoon.com
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.10 LibVLC/3.0.10
Range: bytes=0-

[00007f3134007a10] http stream debug: incoming response:
HTTP/1.1 206 Partial Content
Server: nginx/1.16.1
Date: Thu, 21 May 2020 07:19:29 GMT
Content-Type: application/vnd.rn-realmedia
Content-Length: 7848059
Connection: keep-alive
Last-Modified: Tue, 19 Jun 2007 03:36:18 GMT
Accept-Ranges: bytes
Content-Range: bytes 0-7848058/7848059

[00007f3134007a10] main stream debug: using access module "access"
[00007f3134009020] main stream debug: looking for stream_filter module matching "prefetch,cache_block": 26 candidates
[00007f3134009020] prefetch stream debug: using 7848059 bytes buffer, 7848059 bytes read
[00007f3134009020] main stream debug: using stream_filter module "prefetch"
[00007f313400a0e0] main stream debug: looking for stream_filter module matching "any": 26 candidates
[00007f313400a0e0] main stream warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/lua/liblua_plugin.so' (liblua5.2.so.0: cannot open shared object file: No such file or directory)
[00007f313400a0e0] main stream debug: no stream_filter modules matched
[00007f313400ddb0] main stream_directory debug: looking for stream_directory module matching "any": 1 candidates
[00007f313400ddb0] main stream_directory debug: no stream_directory modules matched
[00007f3134007300] main input source debug: attachment of directory-extractor failed for http://www.maknoon.com/download/audios/alalbani/alnoor/001.rm
[00007f313400a0e0] main stream debug: looking for stream_filter module matching "record": 26 candidates
[00007f313400a0e0] main stream debug: using stream_filter module "record"
[00007f3134007300] main input source debug: creating demux: access='http' demux='any' location='www.maknoon.com/download/audios/alalbani/alnoor/001.rm' file='(null)'
[00007f31340074d0] main demux debug: looking for demux module matching "any": 56 candidates
[00007f313401a7b0] main xml reader debug: looking for xml reader module matching "any": 1 candidates
[00007f313401a7b0] main xml reader debug: using xml reader module "xml"
[00007f31340074d0] webvtt demux debug: subtitle demux discarded
[00007f31340074d0] mod demux debug: MOD validation failed (ext=)
[00007f31340074d0] ts demux debug: TS module discarded (lost sync)
[00007f31340074d0] main demux warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' (libva-drm.so.2: cannot open shared object file: No such file or directory)
[00007f31340074d0] ps demux warning: this does not look like an MPEG PS stream, continuing anyway
[00007f31340074d0] main demux debug: using demux module "ps"
seekableChanged
pausableChanged
lengthChanged
[00007f313400b430] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[00007f313400b430] main demux meta warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/lua/liblua_plugin.so' (liblua5.2.so.0: cannot open shared object file: No such file or directory)
[00007f313400b430] main demux meta debug: no meta reader modules matched
[00007f314c37c670] main input debug: `http://www.maknoon.com/download/audios/alalbani/alnoor/001.rm' successfully opened
playing
[00007f31340074d0] ps demux warning: garbage at input, trying to resync...
[00007f3134007a10] http stream debug: resolving www.maknoon.com ...
[00007f3134007a10] http stream debug: outgoing request:
GET /download/audios/alalbani/alnoor/001.rm HTTP/1.1
Host: www.maknoon.com
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.10 LibVLC/3.0.10
If-Unmodified-Since: Tue, 19 Jun 2007 03:36:18 GMT
Range: bytes=7648059-

[00007f3134007a10] http stream debug: incoming response:
HTTP/1.1 206 Partial Content
Server: nginx/1.16.1
Date: Thu, 21 May 2020 07:19:30 GMT
Content-Type: application/vnd.rn-realmedia
Content-Length: 200000
Connection: keep-alive
Last-Modified: Tue, 19 Jun 2007 03:36:18 GMT
Accept-Ranges: bytes
Content-Range: bytes 7648059-7848058/7848059

[00007f31340074d0] ps demux warning: found sync code
[00007f31340074d0] ps demux warning: garbage at input, trying to resync...
[00007f3134009020] prefetch stream debug: end of stream
[00007f3134007a10] http stream debug: resolving www.maknoon.com ...
[00007f3134007a10] http stream debug: outgoing request:
GET /download/audios/alalbani/alnoor/001.rm HTTP/1.1
Host: www.maknoon.com
Accept: */*
Accept-Language: en_US
User-Agent: VLC/3.0.10 LibVLC/3.0.10
If-Unmodified-Since: Tue, 19 Jun 2007 03:36:18 GMT
Range: bytes=177-

[00007f3134007a10] http stream debug: incoming response:
HTTP/1.1 206 Partial Content
Server: nginx/1.16.1
Date: Thu, 21 May 2020 07:19:31 GMT
Content-Type: application/vnd.rn-realmedia
Content-Length: 7847882
Connection: keep-alive
Last-Modified: Tue, 19 Jun 2007 03:36:18 GMT
Accept-Ranges: bytes
Content-Range: bytes 177-7848058/7848059

[00007f314c37c670] main input debug: selecting program id=0
[00007f313407f770] main packetizer debug: looking for packetizer module matching "any": 25 candidates
[00007f313407f770] main packetizer warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' (libva-drm.so.2: cannot open shared object file: No such file or directory)
[00007f313407f770] main packetizer debug: using packetizer module "mpegaudio"
[00007f313407ee60] main decoder debug: looking for audio decoder module matching "any": 21 candidates
[00007f313407ee60] mpg123 decoder debug: mpga->f32l, bits per sample: 32
[00007f313407ee60] main decoder debug: using audio decoder module "mpg123"
lengthChanged
[00007f31340074d0] ps demux warning: found sync code
[00007f31340074d0] ps demux debug: es id=0xbded format unknown
[00007f31340074d0] ps demux warning: garbage at input from 281643, trying to resync...
[00007f31340074d0] ps demux warning: found sync code
[00007f31340074d0] ps demux warning: garbage at input from 4340995, trying to resync...
[00007f31340074d0] ps demux warning: found sync code
[00007f31340074d0] ps demux debug: contains a PSM
[00007f313407ee60] main decoder debug: killing decoder fourcc `mpga'
[00007f313407ee60] main decoder debug: removing module "mpg123"
[00007f313407f770] main packetizer debug: removing module "mpegaudio"
[00007f313407f770] main packetizer debug: looking for packetizer module matching "any": 25 candidates
[00007f313407f770] main packetizer warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' (libva-drm.so.2: cannot open shared object file: No such file or directory)
[00007f313407f770] main packetizer debug: using packetizer module "mpegaudio"
[00007f313407ee60] main decoder debug: looking for audio decoder module matching "any": 21 candidates
[00007f313407ee60] mpg123 decoder debug: mpga->f32l, bits per sample: 32
[00007f313407ee60] main decoder debug: using audio decoder module "mpg123"
[00007f3134009020] prefetch stream debug: end of stream
[00007f314c37c670] main input debug: video is disabled, not selecting ES 0x7
[00007f314c37c670] main input debug: video is disabled, not selecting ES 0x8
[00007f314c37c670] main input debug: video is disabled, not selecting ES 0x9
[00007f31340074d0] ps demux warning: garbage at input from 7810833, trying to resync...
[00007f314c37c670] main input debug: EOF reached
finished
[00007f313407ee60] main decoder debug: killing decoder fourcc `mpga'
[00007f313407ee60] main decoder debug: removing module "mpg123"
[00007f313407f770] main packetizer debug: removing module "mpegaudio"
[00007f31340074d0] main demux debug: removing module "ps"
[00007f314c37c670] main input debug: Program doesn't contain anymore ES
[00007f313400a0e0] main stream debug: removing module "record"
[00007f3134009020] main stream debug: removing module "prefetch"
[00007f3134007a10] main stream debug: removing module "access"
stopped

the issue might be from

cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/audio_output/libpulse_plugin.so' (libvlc_pulse.so.0: cannot open shared object file: No such file or directory)

i did export plugins path with no luck as well

export VLC_PLUGIN_PATH=/snap/vlc/1620/usr/lib/vlc/plugins
caprica commented 4 years ago

All of those plugins/warnings come from VLC's module loader - there is nothing that can be done from the vlcj side to make that work properly. This is why in #916 I was questioning whether the snap package was actually valid for LibVLC apps or not. I don't use snap, so I don't know.

The only thing that could be done from the vlcj side is to tweak native discovery to look for LibVLC in a particular directory. That's why I was asking if you know for sure where libvlc.so and the plugins directories were.

The cleanest way to do add a new search path for discovery is to provide your own implementation of a DiscoveryDirectoryProvider - have a look at the Javadoc or the implementations of that interface already in the vlcj sources.

caprica commented 4 years ago

This native error is pretty explicit, did you verify if this file is missing and is actually needed or not?

libva-drm.so.2

[00007f313407f770] main packetizer warning: cannot load module `/snap/vlc/1620/usr/lib/vlc/plugins/codec/libavcodec_plugin.so' (libva-drm.so.2: cannot open shared object file: No such file or directory)
Abu-Abdullah commented 4 years ago

all files are in place, i checked that. i have found another information here: https://trac.videolan.org/vlc/ticket/20191

VLC snap relies on a number of shared libraries shipped inside the snap package - you need to set LD_LIBRARY_PATH accordingly so those libraries would be picked up. You can use /snap/vlc/current/command-vlc.wrapper and /snap/vlc/current/bin/vlc-snap-wrapper.sh for the reference. 

so i checked those files and here they are:

oracle@oracle-VirtualBox:/snap/vlc/current$ more ./bin/vlc-snap-wrapper.sh 
#!/bin/bash
case "$SNAP_ARCH" in
    "amd64") ARCH='x86_64-linux-gnu'
    ;;
    "i386") ARCH='i386-linux-gnu'
    ;;
    *)
        echo "Unsupported architecture for this app build"
        exit 1
    ;;
esac

VENDOR=$(glxinfo | grep "OpenGL vendor")

if [[ $VENDOR == *"Intel"* ]]; then
  export VDPAU_DRIVER_PATH="$SNAP/usr/lib/$ARCH/dri"
  export LIBVA_DRIVERS_PATH="$SNAP/usr/lib/$ARCH/dri"
fi

if [[ $VENDOR == *"NVIDIA"* ]]; then
  export VDPAU_DRIVER_PATH="/var/lib/snapd/lib/gl/vdpau"
elif [[ $VENDOR == *"X.Org"* ]]; then
  export VDPAU_DRIVER_PATH="/usr/lib/$ARCH/vdpau/"
fi

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/usr/lib/vlc"

# KDE specific
## Do not start slaves through klauncher but fork them directly.
export KDE_FORK_SLAVES=1
## Neon PATCH! make KIO look for slaves in a dynamic location depending on $SNAP
export KF5_LIBEXEC_DIR=$SNAP/usr/lib/$ARCH/libexec/kf5

exec $SNAP/usr/bin/vlc --config=$SNAP_USER_COMMON/vlcrc "$@"
oracle@oracle-VirtualBox:/snap/vlc/current$ more command-vlc.wrapper 
#!/bin/sh
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$SNAP/lib:$SNAP/usr/lib:$SNAP/lib/x86_64-linux-gnu:$SNAP/
usr/lib/x86_64-linux-gnu"
export LD_LIBRARY_PATH="$SNAP/lib/x86_64-linux-gnu:$SNAP/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
exec "desktop-launch" "$SNAP/bin/vlc-snap-wrapper.sh" "$@"
caprica commented 4 years ago

Also, which version of vlcj are you using?

You really don't need to explicitly do NativeDiscovery yourself anymore.

Abu-Abdullah commented 4 years ago

the newest version 4.5.2

You really don't need to explicitly do NativeDiscovery yourself anymore.

ok, good to know

caprica commented 4 years ago

That snap wrapper stuff looks like a mess IMO, the implication being you need to use that wrapper script (or one very like it) to invoke your vlcj application when using LibVLC from a snap package.

So rather than running "java -jar ......" you need to use a wrapper script like the one you posted.

Looks ridiculous to me.

caprica commented 4 years ago

I'll also add, since you say you're using 4.5.2, that the 4.5.x series (Java11 and modules) has been abandoned (because modules is so much hot garbage frankly). It's very unfortunate with the version numbers currently but 4.4.4 is actually the newest version.

I may make a 4.6.x release series to clean this mess up at some point, but I was expecting 5.0.0 to make 4.6.x moot.

Abu-Abdullah commented 4 years ago

please have a look at: https://trac.videolan.org/vlc/ticket/21558

I'm not sure if this means vlcj will not work with ubuntu from now on

caprica commented 4 years ago

I don't agree with your conclusion.

VLC can be installed using "apt" as normal, I don't ever see that changing. Has there been an announcement that Ubuntu will no longer use "apt"?

From what I can tell, using the snap like this is to get a newer version of VLC than the one that ships with the distribution.

It may still be possible to have vlcj+VLC+snap working, but it may require you to mess around with launch scripts like that wrapper you found. But none of those issues are for vlcj to solve.

Abu-Abdullah commented 4 years ago

thank you. this is the workaround i need now. it is working if i install vlc manually using apt-get and remove the snap one.

from the link that i posted, it seems (not sure) that API interface is only available for other snaps (sort of sandboxing) and not from normal binaries like what im doing now. it needs a lot of work and customization that I'm off with it now.

so my solution is just to notify the user on ubuntu to install vlc from apt-get

thank you again

caprica commented 4 years ago

Do not rule out providing your own application as a package for apt, deb, whatever, it might be better than prompting your users.

For your own package you can add a dependency on VLC and Java and that should work.

So in principle you could do "apt install your-cool-app" (or however you want to install packages) and it should do the dependencies for you as well, without involving the user.

left4dead commented 3 years ago

Just want to add some additional analysis I did at the time when I opened #916.

I had tested our application on Ubuntu 16.04.6 LTS, 18.04.4 LTS, and 20.04 LTS. VLC 3.0.10 now requires GLIBC 2.27 library version which is a system core library. Ubuntu 16 comes with the 2.23 version of it. 2.27 version of it is only available from Ubuntu 18 by default. It is not recommended to upgrade GLIBC to 2.27 in Ubuntu 16.04.x.

GLIBC availability by OS versions in ReadMe: https://github.com/wheybags/glibc_version_header

So, if anybody has installed VLC 3.0.10 (or newer) on Ubnutu 16.04.x (and older versions) through apt somehow (I doubt the new versions are available in apt for Ubuntu 16.04.x (or older), it will still not work through VLCJ even after setting LD_LIBRARY_PATH as the other system libraries are not available. We decided to set LD_LIBRARY_PATH to /snap/vlc/current/usr/lib in our application shell (not affecting user's shell) for newer VLC versions and Ubuntu 18.04.x (and newer), and defined a PreRequisite to upgrade from Ubuntu 16.04.x to newer versions if users want to upgrade VLC.

caprica commented 3 years ago

It's great that you find a solution that worked. I do want to point out however that you really shouldn't need to set LD_LIBRARY_PATH.

The "proper" solution is to plugin to the native discovery mechanism provided by vlcj. There are a number of ways you can do this.

With recent versions, you can provide/edit a config file: ~/.config/vlcj/vlcj.config and set the directory location there.

Or, you can you add your own implementation of a DiscoveryDirectoryProvider to the classpath (no config needed) that does whatever you want to set the right directory.

The point is you only need to provide vlcj with the directory location, then vlcj will take care of loading the library.

If settings "/snap/vlc/current/usr/lib" is the only thing you need to do, and this really is a standard directory name, then it can certainly be added to vlcj's list of standard search paths. Is that the case?

kshitijgarg2609 commented 2 years ago

I am using vlcj 4 version and I found libvlc.deb files from http://ftp.debian.org/debian/pool/main/v/vlc/. Manually downloaded the files libvlccore.so and libvlc.so similarly libvlccore.dll and libvlc.dll manually, I came to know that first libvlccore is loaded using System.load() then libvlc. On windows it's working fine and some linux versions like raspberry pi desktop but I am unable to load libvlc on kali linux as well as ubuntu. I am receiving errors like this, image

kshitijgarg2609 commented 2 years ago

I have shared the jar file with it's dependencies on https://drive.google.com/drive/folders/1ZNJ4QPzu3Pp6aYlyFqtPyRsnTQfueY4c?usp=sharing, pls check, download extract and run libvlctest6.jar file, It is working on linux but not on kali live