caprica / vlcj

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

Compiled using MacOS IntelliJ for vlcj4.8.3 and vlcj-javafx1.2.0. No problem running on MacOS but have problem on Ubuntu 22.04 vlc 3.0.20 #1238

Closed chrischuah closed 2 months ago

chrischuah commented 3 months ago
Screenshot 2024-07-31 at 2 41 24 PM

testvlc-1.0-SNAPSHOT.jar.zip

Hi attached is a test program that i am using to play RTSP stream using VLCJ on Ubuntu 22.04. VLC is installed using snap instead of apt. somehow using apt can install vlc but cant play RTSP due to some debian issues Hence i install it with snap and the version of VLC installed is 3.0.20

I tried running the RTSP using VLC 3.0.20 and it was able to play the video cam output however when i tried running it on Ubuntu 22.04, the error came out I am able to run this same jar file on macos and it is able to play the RTSP output

please advise

regards chris

chrischuah commented 3 months ago
Screenshot 2024-07-31 at 2 48 08 PM

hi somehow snap installed 3.0.20 which is able to play RTSP however, when executing the vlc from /usr/bin, its 3.0.16

how to clean up such issues

caprica commented 3 months ago

The error you posted is a result of using the Java Module System (JMS) when you launch your application.

This is not really related to vlcj as such.

Just try googling for the specific error message and you will find out how to resolve it.

You can either fully embrace the JMS, or you can load JavaFX a different way to avoid it, the vlcj-javafx-demo does this:

https://github.com/caprica/vlcj-javafx-demo/blob/6f22c6d7e3782e6070f8d2bc815f3f63f246c869/src/main/java/uk/co/caprica/vlcj/javafx/demo/VlcjJavaFxApplication.java#L245

Also, if you're going to post an error message, then it's much better to copy+paste the actual text here rather than a screenshot.

Personally, I despise the JMS because you have to deal with this type of thing.

chrischuah commented 3 months ago

HI Mark I am quite new to java as well as vlcj I downloaded the vlcj.javafx application from GitHub but seems like its different from your 

I will look through this demo and see how to modify my javafx application according to yours.

Seems like there is vlcj 4 and vlcj5

regards chris

On 31 Jul 2024, at 3:13 PM, Mark Lee @.***> wrote:

The error you posted is a result of using the Java Module System (JMS) when you launch your application.

This is not really related to vlcj as such.

Just try googling for the specific error message and you will find out how to resolve it.

You can either fully embrace the JMS, or you can load JavaFX a different way to avoid it, the vlcj-javafx-demo does this:

https://github.com/caprica/vlcj-javafx-demo/blob/6f22c6d7e3782e6070f8d2bc815f3f63f246c869/src/main/java/uk/co/caprica/vlcj/javafx/demo/VlcjJavaFxApplication.java#L245

Also, if you're going to post an error message, then it's much better to copy+paste the actual text here rather than a screenshot.

Personally, I despise the JMS because you have to deal with this type of thing.

— Reply to this email directly, view it on GitHub https://github.com/caprica/vlcj/issues/1238#issuecomment-2259832806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS3Y33GHFFIHJWYUWOLHWPTZPCFCLAVCNFSM6AAAAABLXZTQNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZHAZTEOBQGY. You are receiving this because you authored the thread.

caprica commented 3 months ago

Well, there are multiple branches - one for vlcj 4.8.x, and one for upcoming vlcj 5.x, BUT the solution is the same in both cases to solve this particular error.

Just add the wrapper code as per the link, and run that "launcher" class when you start the application instead of what you run now.

chrischuah commented 3 months ago

Hi markYes I did the wrapper to create a launcher class to call the main classWill try again laterThanksChris Sent from my iPhoneOn 31 Jul 2024, at 15:22, Mark Lee @.***> wrote: Well, there are multiple branches - one for vlcj 4.8.x, and one for upcoming vlcj 5.x, BUT the solution is the same in both cases to solve this particular error. Just add the wrapper code as per the link, and run that "launcher" class when you start the application instead of what you run now.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

chrischuah commented 3 months ago

 Hi Mark, When I tried to add the vlci 5.0.0 snapshot into the global library in IntelliJ, it state that there is no files downloaded Do I need to manually download from GitHub and then add it manually to the global library?

regards chris

On 31 Jul 2024, at 3:22 PM, Mark Lee @.***> wrote:

Well, there are multiple branches - one for vlcj 4.8.x, and one for upcoming vlcj 5.x, BUT the solution is the same in both cases to solve this particular error.

Just add the wrapper code as per the link, and run that "launcher" class when you start the application instead of what you run now.

— Reply to this email directly, view it on GitHub https://github.com/caprica/vlcj/issues/1238#issuecomment-2259845157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS3Y33E5IL2NTE2ZZ7UZ57TZPCGCFAVCNFSM6AAAAABLXZTQNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZHA2DKMJVG4. You are receiving this because you authored the thread.

chrischuah commented 3 months ago

Hi Mark I am quite confused about the versioning in VLCJ

vlcj-5 requires VLC 4.0 as a minimum baseline - VLC 4.0 is currently in development and it may be some time before it is released.

The VLC used in ubuntu is 3.0.20 (from snap install)

Can the demo that you provided me able to run on 5.0 SNAPSHOT? Also I am having some problem in downloading the 5.0 SNAPSHOT.jar

Please advise

regards chris

On 31 Jul 2024, at 3:22 PM, Mark Lee @.***> wrote:

Well, there are multiple branches - one for vlcj 4.8.x, and one for upcoming vlcj 5.x, BUT the solution is the same in both cases to solve this particular error.

Just add the wrapper code as per the link, and run that "launcher" class when you start the application instead of what you run now.

— Reply to this email directly, view it on GitHub https://github.com/caprica/vlcj/issues/1238#issuecomment-2259845157, or unsubscribe https://github.com/notifications/unsubscribe-auth/AS3Y33E5IL2NTE2ZZ7UZ57TZPCGCFAVCNFSM6AAAAABLXZTQNCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENJZHA2DKMJVG4. You are receiving this because you authored the thread.

caprica commented 3 months ago

Use LibVLC 3.x and vlcj 4.8.3.

Anything else is pre-release development versions, for both LibVLC and vlcj.

Generally, you need to use Maven or Gradle projects in IntelliJ and manage your dependencies that way. You should not be manually downloading jars and adding them to your project. But really, this is all outside the scope of vlcj.

chrischuah commented 3 months ago

Yes I know its outside the scope of vlcj.

Ok I will try to use back the LibVLC 3.x and VLCJ 4.8.3

Will try to figure it out on how to use your library for ubuntu 22.04 with VLC 3.0.20

chrischuah commented 3 months ago

I just found out the problem why when i use apt to install vlc and snap install vlc. apt install vlc (version 3.0.16) is able to play the video files but could not play the RTSP from my webcam under javafx.

Maybe this is due to debian disallow RTSP. I also get the same problem when i run VLC application (3.0.16) directly.

However, when i uninstall the vlc using apt and re-install using snap snap install vlc gives me 3.0.20 However, i encountered that error because it could not find the libvlccore,so and libvlc.so

So i set the LD_LIBRARY_PATH to /snap/vlc/current/usr/lib:/snap/vlc/current/lib/x86_64-linux-gnu

the javafx program can show the screen however, when i tried to play an mp4 file, it return error whereby it could not find the Codec. May i know where are the codec library files used so that i can try to find and set it in the LD_LIBRARY_PATH

caprica commented 2 months ago

I can only suggest you look inside your Snap package to find libvlc.so, and the plugins are usually in a "plugins" sub-directory.