Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VLC is unable to open the MRL #601

Closed
ttramb opened this issue Mar 23, 2018 · 22 comments
Closed

VLC is unable to open the MRL #601

ttramb opened this issue Mar 23, 2018 · 22 comments
Labels

Comments

@ttramb
Copy link

ttramb commented Mar 23, 2018

Hi,
I have an issue that have been previously raised: (core audio output error: no suitable audio output module).
I have exactly the same behavior.
I have an application that currently used vlcj 3.9 and VLC 2.1.5 that works fine, but I would like to upgraded VLC to a newer version to improved some video supports.

I have tried vlcj 3.10.1 and VLC 2.2.8 and I have this error when playing media files:

[00007f83cb5f1ba8] core input error: open of `file:///Users/bertrand/test.mp4' failed
[00007f83cb5f1ba8] core input error: Your input can't be opened
[00007f83cb5f1ba8] core input error: VLC is unable to open the MRL 'file:///Users/bertrand/ici/test.mp4'. Check the log for details.

Same issues for vlc 2.2.0 and 2.2.1. So I guess all 2.2.x failed in my case.
I have tested with samples provided in the vlcj distribution with exactly the same error ( uk.co.caprica.vlcj.test.direct.DirectTestPlayer)

Do you have some advices or some clues to fixed this ?
I am running on MacOSX.
Original Input file is without "file://"

Thank you

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

Enable vlcj's debug logging and inspect the log when you play your media - it will show you how it detects whether the input MRL is a local file or URL.

Also, you need to be sure which version of vlcj is actually visible on your classpath first, so check all that to make sure you are using the latest.

@ttramb
Copy link
Author

ttramb commented Mar 23, 2018

I have enable debug logs but I can't figure out how it detect where the input is local file or URL.
here is a sample:

18:07:29.120 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - addMediaPlayerEventListener(listener=com.afp.medialab.vlcj.demo.VLCJDemo.Tutorial$4@72ed1f3d)
18:07:29.213 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - playMedia(mrl=/Users/bertrand/test.mp4,mediaOptions=[])
18:07:29.214 [AWT-EventQueue-0]      DEBUG                           uk.co.caprica.vlcj.player.MediaResourceLocator - encodeMrl(mrl=/Users/bertrand/test.mp4)
18:07:29.214 [AWT-EventQueue-0]      DEBUG                           uk.co.caprica.vlcj.player.MediaResourceLocator - MRL does not contain any Unicode characters
18:07:29.214 [AWT-EventQueue-0]      DEBUG                           uk.co.caprica.vlcj.player.MediaResourceLocator - result=/Users/bertrand/test.mp4
18:07:29.214 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - playMedia(media=SimpleMedia[mrl=/Users/bertrand/test.mp4,mediaOptions=[Ljava.lang.String;@70c67cdb])
18:07:29.215 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - prepareMedia(media=SimpleMedia[mrl=/Users/bertrand/test.mp4,mediaOptions=[Ljava.lang.String;@70c67cdb])
18:07:29.217 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - setMedia(media=SimpleMedia[mrl=/Users/bertrand/test.mp4,mediaOptions=[Ljava.lang.String;@70c67cdb])
18:07:29.217 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - createMediaInstance(media=SimpleMedia[mrl=/Users/bertrand/test.mp4,mediaOptions=[Ljava.lang.String;@70c67cdb])
18:07:29.218 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - Treating mrl as a path
18:07:29.220 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaInstance=native@0x7fbb2951acf0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@29522cab)

...

18:07:29.225 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - mrl(mediaInstance=native@0x7fbb2951acf0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@29522cab))
18:07:29.227 [pool-1-thread-1]       DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaChanged(mediaPlayer=uk.co.caprica.vlcj.player.direct.DefaultDirectMediaPlayer@2a75a147,media=native@0x7fbb2951acf0 (uk.co.caprica.vlcj.binding.internal.libvlc_media_t@29522cab),mrl=file:///Users/bertrand/test.mp4)
18:07:29.227 [pool-1-thread-1]       DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - Raising event for new media
18:07:29.227 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - result=true
18:07:29.227 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - play()
18:07:29.232 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - after play

Visible vlcj is 3.10.1 (set in the logs) so I am sure about the version.

How can I force vlcj to detects my input as a file ? What do I missed ?

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

In your log it says this:

18:07:29.218 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - Treating mrl as a path

Which in fact looks correct.

What does it say about the detected VLC version in those same logs?

@ttramb
Copy link
Author

ttramb commented Mar 23, 2018

Detected is 2.2.8
See the logs below:

18:37:07.046 [main]                  INFO                                                   uk.co.caprica.vlcj.Info - vlcj: 3.10.1
18:37:07.050 [main]                  INFO                                                   uk.co.caprica.vlcj.Info - java: 1.8.0_162 Oracle Corporation
18:37:07.050 [main]                  INFO                                                   uk.co.caprica.vlcj.Info - java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre
18:37:07.050 [main]                  INFO                                                   uk.co.caprica.vlcj.Info - os: Mac OS X 10.12.6 x86_64
18:37:07.052 [main]                  DEBUG                             uk.co.caprica.vlcj.discovery.NativeDiscovery - discover()
18:37:07.052 [main]                  DEBUG                             uk.co.caprica.vlcj.discovery.NativeDiscovery - jnaLibraryPath=/Users/bertrand/Documents/source/vlc-2.2.8/lib
18:37:07.052 [main]                  INFO                              uk.co.caprica.vlcj.discovery.NativeDiscovery - Skipped discovery as system property 'jna.library.path' already set to '/Users/bertrand/Documents/source/vlc-2.2.8/lib'
18:37:07.847 [AWT-EventQueue-0]      DEBUG                  uk.co.caprica.vlcj.component.DirectMediaPlayerComponent - args=[--no-snapshot-preview, --quiet-synchro, --sub-filter=logo:marq, --intf=dummy]
18:37:07.858 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - initX=null
18:37:07.897 [AWT-EventQueue-0]      DEBUG                                    uk.co.caprica.vlcj.runtime.x.LibXUtil - Did not initialise LibX11: Unable to load library 'X11': Native library (darwin/libX11.dylib) not found in resource path ([file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/resources.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/rt.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/jsse.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/jce.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/charsets.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/jfr.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/cldrdata.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/dnsns.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/jaccess.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/jfxrt.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/localedata.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/nashorn.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunec.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar, file:/Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/jre/lib/ext/zipfs.jar, file:/System/Library/Java/Extensions/MRJToolkit.jar, file:/Users/bertrand/Documents/eclipse-workspace/transcription/VLCJDemo/target/classes/, file:/Users/bertrand/.m2/repository/uk/co/caprica/vlcj/3.10.1/vlcj-3.10.1.jar, file:/Users/bertrand/.m2/repository/net/java/dev/jna/jna/4.1.0/jna-4.1.0.jar, file:/Users/bertrand/.m2/repository/net/java/dev/jna/jna-platform/4.1.0/jna-platform-4.1.0.jar, file:/Users/bertrand/.m2/repository/org/slf4j/slf4j-api/1.7.10/slf4j-api-1.7.10.jar, file:/Users/bertrand/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar, file:/Users/bertrand/.m2/repository/ch/qos/logback/logback-classic/1.1.2/logback-classic-1.1.2.jar, file:/Users/bertrand/.m2/repository/ch/qos/logback/logback-core/1.1.2/logback-core-1.1.2.jar])
18:37:07.959 [AWT-EventQueue-0]      INFO                                  uk.co.caprica.vlcj.binding.LibVlcFactory - vlc: 2.2.8 Weatherwax, changeset 2.2.8-2-gf5224a0
18:37:07.959 [AWT-EventQueue-0]      INFO                                  uk.co.caprica.vlcj.binding.LibVlcFactory - libvlc: /Users/bertrand/Documents/source/vlc-2.2.8/lib/libvlc.dylib
18:37:07.960 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - MediaPlayerFactory(libvlc=Proxy interface to Native Library </Users/bertrand/Documents/source/vlc-2.2.8/lib/libvlc.dylib@140429995129984>,libvlcArgs=[--no-snapshot-preview, --quiet-synchro, --sub-filter=logo:marq, --intf=dummy])
18:37:07.960 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - jna.library.path=/Users/bertrand/Documents/source/vlc-2.2.8/lib
18:37:07.960 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - VLC_PLUGIN_PATH=null
18:37:08.124 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - instance=native@0x7fb869906e50 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@6990ee08)

...

18:37:08.140 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - DefaultMediaPlayer(libvlc=Proxy interface to Native Library </Users/bertrand/Documents/source/vlc-2.2.8/lib/libvlc.dylib@140429995129984>, instance=native@0x7fb869906e50 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@6990ee08))
18:37:08.140 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - createInstance()
[00007fb867faebc8] core generic error: option vmem-chroma does not exist
18:37:08.142 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaPlayerInstance=native@0x7fb867faebc8 (uk.co.caprica.vlcj.binding.internal.libvlc_media_player_t@67fb6b80)
18:37:08.142 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - mediaPlayerEventManager=native@0x7fb867c73210 (uk.co.caprica.vlcj.binding.internal.libvlc_event_manager_t@67c7b1c8)
18:37:08.142 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - registerEventListener()

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

I don't know, it looks like a classic case of a mismatch between VLC and vlcj where VLC changed how it interpreted MRLs.

As the other issue relates, at one point in time it was possible to call a simple libvlc_media_new_path for both URL's and local files, but this was changed during the VLC 2.x lifetime. Now you must invoke libvlc_media_new_path for local files, but libvlc_media_new_location (IIRC) for URLs.

vlcj was changed to make this choice automatically and indeed that seems to be working, and indeed it does work generally otherwise I would have certainly heard more about it than just 2 issue reports in over 2 years.

But when you look at your trace log where it dumps the native media instance out, you can see it has changed this to a file:// URL.

I simply don't know why that is happening for you in this particular case.

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

The other thing to check is to enable VLC's native logging, by passing "-vvv" in the MediaPlayerFactory and seeing if there is anything in the native log.

@ttramb
Copy link
Author

ttramb commented Mar 23, 2018

Checking the execution, this is libvlc_media_new_path which is invoked.
So do you mean that it is vlc which add the "file://" in front of the original path ?
Here is what VLC says when trying to play the video. It looks as if the file does not exists.

21:21:41.556 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - play()
[00007fc517dbf1a8] core input debug: Creating an input for 'test.mp4'
[00007fc517dbf1a8] core input debug: using timeshift granularity of 50 MiB, in path '/tmp'
21:21:41.564 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - after play
[00007fc517dbf1a8] core input debug: `file:///Users/bertrand/test.mp4' gives access `file' demux `' path `/Users/bertrand/test.mp4'
[00007fc517dbf1a8] core input debug: specified demux `any'
[00007fc517dbf1a8] core input debug: creating demux: access='file' demux='any' location='/Users/bertrand/test.mp4' file='/Users/bertrand/test.mp4'
[00007fc519087668] core demux debug: looking for access_demux module matching "file": 3 candidates
[00007fc519087668] core demux debug: no access_demux modules matched
[00007fc517dbf1a8] core input debug: creating access 'file' location='/Users/bertrand/test.mp4', path='/Users/bertrand/test.mp4'
[00007fc519087668] core access debug: looking for access module matching "file": 0 candidates
[00007fc519087668] core access debug: no access modules
[00007fc517dbf1a8] core input error: open of `file:///Users/bertrand/test.mp4' failed
[00007fc517dbf1a8] core input error: Your input can't be opened
[00007fc517dbf1a8] core input error: VLC is unable to open the MRL 'file:///Users/bertrand/test.mp4'. Check the log for details.

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

Well, does that file actually exist and you have permissions to access it?

Are there any diacritics in the filename that we're not seeing?

@caprica
Copy link
Owner

caprica commented Mar 23, 2018

I really don't think your MRL should have the "file://" prefix, and if vlcj says treating the file as a path, then it should not be vlcj that adds that prefix.

But something has added it.

@ttramb
Copy link
Author

ttramb commented Mar 24, 2018

Hi, yes I am also pretty sure that it is not vlcj that added that prefix. Maybe there is something in VLC that I don't load (I use -Djna.library.path=).
My VLC 2.2.8 libs structure is like this:
/lib
/lib/vlc/plugins

Compare to 2.1.5 which have structure like this:
/lib
/plugins

I made a test using the same file with vlc 2.1.5 and vlcj 3.10.1 and it works fine.

Here are logs for the same video for 2.1.5 and same with 2.2.8. Maybe you will fine something usefull.
I will make some test on other platforms to see if same thing is happening.

Logs for 2.1.5 (OK)

12:42:02.583 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - play()
[0x7fd33ddeb470] main input debug: Creating an input for 'test.mp4'
[0x7fd33ddeb470] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
12:42:02.588 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - after play
[0x7fd33ddeb470] main input debug: `file:///Users/bertrand/medias/test.mp4' gives access `file' demux `' path `/Users/bertrand/medias/test.mp4'
[0x7fd33ddeb470] main input debug: creating demux: access='file' demux='' location='/Users/bertrand/medias/test.mp4' file='/Users/bertrand/medias/test.mp4'
[0x7fd34010d1a0] main demux debug: looking for access_demux module matching "file": 14 candidates
[0x7fd34010d1a0] main demux debug: no access_demux modules matched
[0x7fd33ddeb470] main input debug: creating access 'file' location='/Users/bertrand/medias/test.mp4', path='/Users/bertrand/medias/test.mp4'
[0x7fd34009c4f0] main access debug: looking for access module matching "file": 18 candidates
[0x7fd34009c4f0] filesystem access debug: opening file `/Users/bertrand/medias/test.mp4'
[0x7fd34009c4f0] main access debug: using access module "filesystem"
[0x7fd33dcecde0] main stream debug: Using stream method for AStream*
[0x7fd33dcecde0] main stream debug: starting pre-buffering
[0x7fd33dcecde0] main stream debug: received first data after 0 ms
[0x7fd33dcecde0] main stream debug: pre-buffering done 1024 bytes in 0s - 6369 KiB/s
[0x7fd33dced090] main stream debug: looking for stream_filter module matching "any": 9 candidates
[0x7fd33dced090] main stream debug: no stream_filter modules matched
[0x7fd343e04d30] main stream debug: looking for stream_filter module matching "record": 9 candidates
[0x7fd343e04d30] main stream debug: using stream_filter module "record"
[0x7fd33ddeb470] main input debug: creating demux: access='file' demux='' location='/Users/bertrand/medias/test.mp4' file='/Users/bertrand/medias/test.mp4'
[0x7fd34010d5d0] main demux debug: looking for demux module matching "mp4": 63 candidates
...

Log for 2.2.8 (KO)

 12:41:12.043 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - play()
[00007fb9c65a2a28] core input debug: Creating an input for 'test.mp4'
[00007fb9c65a2a28] core input debug: using timeshift granularity of 50 MiB, in path '/tmp'
12:41:12.049 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - after play
[00007fb9c65a2a28] core input debug: `file:///Users/bertrand/medias/test.mp4' gives access `file' demux `' path `/Users/bertrand/medias/test.mp4'
[00007fb9c65a2a28] core input debug: specified demux `any'
[00007fb9c65a2a28] core input debug: creating demux: access='file' demux='any' location='/Users/bertrand/medias/test.mp4' file='/Users/bertrand/medias/test.mp4'
[00007fb9c64a3608] core demux debug: looking for access_demux module matching "file": 3 candidates
[00007fb9c64a3608] core demux debug: no access_demux modules matched
[00007fb9c65a2a28] core input debug: creating access 'file' location='/Users/bertrand/medias/test.mp4', path='/Users/bertrand/medias/test.mp4'
[00007fb9c780b998] core access debug: looking for access module matching "file": 0 candidates
[00007fb9c780b998] core access debug: no access modules
[00007fb9c65a2a28] core input error: open of `file:///Users/bertrand/medias/test.mp4' failed
[00007fb9c65a2a28] core input error: Your input can't be opened
[00007fb9c65a2a28] core input error: VLC is unable to open the MRL 'file:///Users/bertrand/medias/test.mp4'. Check the log for details.

@caprica
Copy link
Owner

caprica commented Mar 24, 2018

I now suspect this may be related the VLC_PLUGIN_PATH, on OSX.

There was another issue posted a while back, I don't remember exactly, that said on OSX the security model was changed for preventing the setting of environment variables inside the process itself. So you need to write a wrapper script that sets VLC_PLUGIN_PATH correctly when launching your process.

@caprica
Copy link
Owner

caprica commented Mar 24, 2018

It was not an issue posted, but nevertheless the suggestion was that this may be to blame:

https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/RuntimeProtections/RuntimeProtections.html

With a potential workaround based on this:

http://mattshomepage.com/articles/2016/May/22/java_home_mac_os_x/

@ttramb
Copy link
Author

ttramb commented Mar 26, 2018

Hi,
Thank you to have taking care of this issue.

I did few more tests trying to set up correctly VLC_PLUGIN_PATH without success, but I have found a workaround that looks like to get plugins correctly. Unfortunately the video is not correctly displayed and crashed few seconds after.

Here is my workaround:
Looking at the logs plugins looks to be founded but not loaded giving the following errors for all:

Library not loaded: @loader_path/../lib/libvlccore.8.dylib

So I copied the lib folder into the same folder that contains plugins directory to be reach by the relative path.
So in this case I have:
/lib
/lib/vlc
/lib/vlc/lib (copy form /lib)
/lib/vlc/plugins

So results for loading looks normal now, except these errors:

[00007f8ddb591948] core libvlc warning: cannot load module `/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib' (dlopen(/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib, 1): Library not loaded: @executable_path/../Frameworks/Growl.framework/Versions/A/Growl
  Referenced from: /Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib
  Reason: image not found)
[00007f8ddb591948] core libvlc warning: cannot load module `/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib' (dlopen(/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib, 1): Library not loaded: @executable_path/../Frameworks/BGHUDAppKit.framework/Versions/A/BGHUDAppKit
  Referenced from: /Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib
  Reason: image not found)

Here is the full logs for loading steps:

[00007f8ddb591948] core libvlc debug: VLC media player - 2.2.8 Weatherwax
[00007f8ddb591948] core libvlc debug: Copyright © 1996-2017 the VideoLAN team
[00007f8ddb591948] core libvlc debug: revision 2.2.8-2-gf5224a0
[00007f8ddb591948] core libvlc debug: configured with ../extras/package/macosx/../../../configure  '--prefix=/Users/fpk/Desktop/vlc-2.2/release/vlc_install_dir' '--enable-macosx' '--enable-merge-ffmpeg' '--enable-growl' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-shout' '--enable-ncurses' '--enable-twolame' '--enable-realrtsp' '--enable-libass' '--enable-macosx-eyetv' '--enable-macosx-qtkit' '--enable-macosx-avfoundation' '--disable-skins2' '--disable-xcb' '--disable-caca' '--disable-sdl' '--disable-samplerate' '--disable-macosx-dialog-provider' '--with-macosx-version-min=10.6' '--build=x86_64-apple-darwin10' 'build_alias=x86_64-apple-darwin10' 'CC=xcrun clang' 'CFLAGS=' 'LDFLAGS=' 'CXX=xcrun clang++' 'OBJC=xcrun clang'
[00007f8ddb591948] core libvlc debug: searching plug-in modules
[00007f8ddb591948] core libvlc debug: loading plugins cache file /Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/plugins.dat
[00007f8ddb591948] core libvlc debug: recursively browsing `/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins'
[00007f8ddb591948] core libvlc warning: cannot load module `/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib' (dlopen(/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib, 1): Library not loaded: @executable_path/../Frameworks/Growl.framework/Versions/A/Growl
  Referenced from: /Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libgrowl_plugin.dylib
  Reason: image not found)
[00007f8ddb591948] core libvlc warning: cannot load module `/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib' (dlopen(/Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib, 1): Library not loaded: @executable_path/../Frameworks/BGHUDAppKit.framework/Versions/A/BGHUDAppKit
  Referenced from: /Users/bertrand/Documents/source/vlc-2.2.8/lib/vlc/plugins/libmacosx_plugin.dylib
  Reason: image not found)
[00007f8ddb591948] core libvlc debug: plug-ins loaded: 394 modules
[00007f8ddb591948] core libvlc debug: translation test: code is "C"
[00007f8ddb591948] core libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU 
11:47:40.427 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - instance=native@0x7f8ddb591810 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@db59979d)
11:47:40.428 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - equalizerAvailable=true
11:47:40.428 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - createEqualizerBandFrequencies()
11:47:40.428 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - numBands=10
11:47:40.431 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - result=[31.25, 62.5, 125.0, 250.0, 500.0, 1000.0, 2000.0, 4000.0, 8000.0, 16000.0]
11:47:40.431 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - createEqualizerPresetNames()
11:47:40.431 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - numPresets=18
11:47:40.432 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - result=[Flat, Classical, Club, Dance, Full bass, Full bass and treble, Full treble, Headphones, Large Hall, Live, Party, Pop, Reggae, Rock, Ska, Soft, Soft rock, Techno]
11:47:40.433 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.MediaPlayerFactory - newDirectMediaPlayer(formatCallback=vlcj.demo.VLCJDemo.Tutorial$3@31a90911,renderCallback=vlcj.demo.VLCJDemo.Tutorial$TutorialRenderCallbackAdapter@202c3923)
11:47:40.462 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - DefaultMediaPlayer(libvlc=Proxy interface to Native Library </Users/bertrand/Documents/source/vlc-2.2.8/lib/libvlc.dylib@140247276789136>, instance=native@0x7f8ddb591810 (uk.co.caprica.vlcj.binding.internal.libvlc_instance_t@db59979d))
11:47:40.462 [AWT-EventQueue-0]      DEBUG                             uk.co.caprica.vlcj.player.DefaultMediaPlayer - createInstance()

I am not really an expect on MacOSX so very hard to find why it crashed now.
Good news it that there is no issues on Windows ...

@caprica
Copy link
Owner

caprica commented Mar 26, 2018

I really think you need to focus on getting the VLC_PLUGIN_PATH environment variable set correctly, rather than copying files around.

@ttramb
Copy link
Author

ttramb commented Mar 27, 2018

Ok I have setup VLC_PLUGIN_PATH as global system environment and change vlc structure to:
vlc-path/lib
vlc-path/plugins
Then it work ! at least. So plugins are able to load lib as relative path.

So far it is just a workaround. Setting VLC_PLUGIN_PATH throw System.setProperty does not works and the logs that show the value of VLC_PLUGIN_PATH is misleading when the property is set.
With global setting log for VLC_PLUGIN_PATH is null but it works.

So next step is to figure out how can I set up VLC_PLUGIN_PATH through java code for VLC to take it.
If someone have a clue it is welcome.

@caprica
Copy link
Owner

caprica commented Mar 27, 2018

I am no expert on SIP on OSX, but there must be a way to set the VLC_PLUGIN_PATH for your process when you launch it - I totally get why System.setProperty does not work in this case, but when you launch your app you must be able to set the variable via some sort of wrapper script.

On Linux at least you can do something like:

VLC_PLUGIN_PATH=/usr/lib/vlc java -jar my-cool-app.jar

I think the answer lies in the SIP documentation or related articles.

@ttramb
Copy link
Author

ttramb commented Mar 27, 2018

Adding LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", "/Users/bertrand/Documents/source/vlc-2.2.8/plugins", 0); make it all working.
thank to old issue: #349

@caprica
Copy link
Owner

caprica commented Mar 27, 2018

Did you ever try vlcj's NativeDiscovery class?

new NativeDiscovery().discover()

This should do that LibC call for you automatically.

@ttramb
Copy link
Author

ttramb commented Mar 27, 2018

Yes, I used the Tutorial class set on the tutorial website that started with this line.

@caprica
Copy link
Owner

caprica commented Mar 27, 2018

Well that is supposed to do the LibC call that you said fixed your problem, so I don't understand why it didn't work.

@caprica
Copy link
Owner

caprica commented Mar 27, 2018

Oh I get it, if you install VLC to a non-standard location the default NativeDiscovery won't find it.

You could extend NativeDiscovery to provide an additional search path to your custom directory and that should have worked.

@ttramb
Copy link
Author

ttramb commented Mar 27, 2018

I my case vlc is embedded in an eclipse fragment by os, so yes this is not the standard installation. So anyway thank you for the support and your great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants