-
-
Notifications
You must be signed in to change notification settings - Fork 260
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
Comments
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. |
I have enable debug logs but I can't figure out how it detect where the input is local file or URL.
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 ? |
In your log it says this:
Which in fact looks correct. What does it say about the detected VLC version in those same logs? |
Detected is 2.2.8
|
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. |
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. |
Checking the execution, this is libvlc_media_new_path which is invoked.
|
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? |
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. |
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=). Compare to 2.1.5 which have structure like this: 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. Logs for 2.1.5 (OK)
Log for 2.2.8 (KO)
|
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. |
It was not an issue posted, but nevertheless the suggestion was that this may be to blame: With a potential workaround based on this: http://mattshomepage.com/articles/2016/May/22/java_home_mac_os_x/ |
Hi, 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:
So I copied the lib folder into the same folder that contains plugins directory to be reach by the relative path. So results for loading looks normal now, except these errors:
Here is the full logs for loading steps:
I am not really an expect on MacOSX so very hard to find why it crashed now. |
I really think you need to focus on getting the VLC_PLUGIN_PATH environment variable set correctly, rather than copying files around. |
Ok I have setup VLC_PLUGIN_PATH as global system environment and change vlc structure to: 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. So next step is to figure out how can I set up VLC_PLUGIN_PATH through java code for VLC to take it. |
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. |
Adding LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", "/Users/bertrand/Documents/source/vlc-2.2.8/plugins", 0); make it all working. |
Did you ever try vlcj's NativeDiscovery class?
This should do that LibC call for you automatically. |
Yes, I used the Tutorial class set on the tutorial website that started with this line. |
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. |
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. |
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. |
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:
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
The text was updated successfully, but these errors were encountered: