Giter Club home page Giter Club logo

vlcj-player's Introduction

You are currently looking at the development branch of vlcj-player for vlcj-4.0.0, if you want a stable version of vlcj-player that works with vlcj-3 you should switch to the vlcj-3.x branch.

vlcj-player

The vlcj-player is a media player application built using vlcj with a Swing rich-client user interface.

The main goal of the project is to provide an extensive demo application showing how to build media players with vlcj, and to include as many features of vlcj as possible.

Generally the vlcj-player tries to match the Qt interface of VLC with as many of the same features implemented as possible.

However, it is not possible to get a 100% like-for-like implementation since LibVLC, used by vlcj, exposes only a sub-set of the total functionality of VLC.

Screenshot

vlcj-player

Features

  • audio player
  • video player
  • full-screen
  • audio equalizer
  • video adjustments
  • title selection
  • chapter navigation
  • audio track selection
  • video track selection
  • subtitle track selection
  • load external subtitle file
  • change audio device
  • change audio stereo mode
  • change playback speed
  • capture and display native logs
  • capture and display video surface debug messages (e.g. to test mouse and keyboard events still work)
  • volume controls
  • mute
  • zoom/scale
  • aspect ratio
  • crop
  • logo/marquee
  • always on top
  • video snapshots
  • drag and drop local files to the main window
  • drag and drop URLs from web browsers to the main window (e.g. to play a YouTube video)
  • redirect native output streams (on Linux)

...and a whole bunch of other nifty stuff.

Status

This project is currently a work-in-progress.

If you execute "mvn install" or "mvn package", you will get a distribution package that you can unpack. This will give you the vlcj-player application jar and all of the dependencies - you can simply execute java -jar vlcj-player-1.0.0-SNAPSHOT.jar and the application should start.

On the other hand, just run it from an Eclipse project.

License

The vlcj-player project is provided under the GPL, version 3 or later.

vlcj-player's People

Contributors

caprica avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vlcj-player's Issues

Not working on MacOSX 10.9.4

Hey:
I imported project(use vlcj 3.6.0 in maven settings) into eclipse in Mac, and the project requires jdk1.8, which I did not change.
My VLC.app version is 2.2.1
When I try to launch, it simply doesn't work, without showing any GUI, and throw lots of error.
Then I change vlcj version to 3.8.0(which is latest version by now) in maven settings, and now I can launch the application without any error.BUT when I open a video file from the menu, the application crashes with the following error msg:

_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib
JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit

Other info that might be helpful:

2015-07-23 22:44:13 INFO                            Info:77   - vlcj: 3.8.0
2015-07-23 22:44:13 INFO                            Info:78   - java: 1.8.0_31 Oracle Corporation
2015-07-23 22:44:13 INFO                            Info:79   - java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home/jre
2015-07-23 22:44:13 INFO                            Info:80   - os: Mac OS X 10.9.5 x86_64
2015-07-23 22:44:13 INFO                 NativeDiscovery:121  - Discovery found libvlc at '/Applications/VLC.app/Contents/MacOS/lib'
2015-07-23 22:44:13 INFO                   LibVlcFactory:171  - vlc: 2.2.1 Terry Pratchett (Weatherwax), changeset 2.2.1-0-ga425c42
2015-07-23 22:44:13 INFO                   LibVlcFactory:172  - libvlc: /Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib

Unable to change the audio output device

First of all, I would like to thank you for maintaining this beautiful library! Everything was fine until the moment I need to change the audio output device. It looks very simple, but I didn't manage to get it to work, so I decided to have a look at the implementation in vlcj-player, but here again I failed. No matter what device I choose, it still use the default one. The only solution I found was to start the playback, pause it, change the output device and then resume the playback, but it only works once.
Version
I tried different versions of vlcj, from 4.0.5 to 4.2.0, but it makes no difference.
Also, I made a little video in order to not be unfounded :)
https://vimeo.com/375696625
I'd like to provide any additional information if needed.

vlcj : 4.2.0
os : Windows 10 10.0 amd64
java : 1.8.0_222 AdoptOpenJDK

VlcjPlayer crashes when opening a movie on Mac OS X

What I did

1) Launched the player using:

mvn exec:java -Dexec.mainClass=uk.co.caprica.vlcjplayer.VlcjPlayer

This launches the UI as expected with the following output:

[INFO] Scanning for projects...
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building vlcj-player 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced
[INFO]
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ vlcj-player ---
2016-04-18 21:18:18 INFO                            Info:77   - vlcj: 3.10.1
2016-04-18 21:18:18 INFO                            Info:78   - java: 1.8.0_77 Oracle Corporation
2016-04-18 21:18:18 INFO                            Info:79   - java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_77.jdk/Contents/Home/jre
2016-04-18 21:18:18 INFO                            Info:80   - os: Mac OS X 10.11.4 x86_64
2016-04-18 21:18:18 INFO                 NativeDiscovery:121  - Discovery found libvlc at '/Applications/VLC.app/Contents/MacOS/lib'
2016-04-18 21:18:18 INFO                   LibVlcFactory:171  - vlc: 2.2.2 Weatherwax, changeset 2.2.2-3-gf8c9253
2016-04-18 21:18:18 INFO                   LibVlcFactory:172  - libvlc: /Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib

2) Attempt to open a movie using the Media -> Open File menu item.

This crashes the app with:

_NSJVMLoadLibrary: NSAddLibrary failed for /libjawt.dylib
JavaVM FATAL: lookup of function JAWT_GetAWT failed. Exit

Other Notes

I know VLC4J works on my development machine as I have a test player based on your vlc-javafx project that runs just fine. I'm just reporting this bug for your information.

Also, nice work on VLC4J!! Very well done!

How do I set the desired subtitle track?

Hello!
How do I set the desired subtitle track?
I have been looking for an answer for several days, but without any result.
I looked in the documentation, searched the Internet, but alas.
This:
embeddedMediaPlayer.media().info().textTracks();
Gives me a list of tracks, but how do I turn on the right one?

Thank you in advance!

Ilya Rudnitsky

It compiles but doesn't launch

log4j:WARN No appenders could be found for logger (uk.co.caprica.vlcj.Info).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
    at uk.co.caprica.vlcjplayer.VlcjPlayer.<init>(VlcjPlayer.java:105)
    at uk.co.caprica.vlcjplayer.VlcjPlayer$1.run(VlcjPlayer.java:83)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.util.MissingResourceException: Can't find bundle for base name strings/vlcj-player, locale en_US
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:773)
    at uk.co.caprica.vlcjplayer.Application.<clinit>(Application.java:46)
    ... 16 more

Transforme and transpose video

Hi,
I'm implemented vlc player with clvj library, so i integrated an EmbedMediaplayer into a JPanel , i can control it easily without any problem, sometimes i have to load some video with specific dimension that gives a bad view, so i thought that i can transpose the video to get wide screen and best view, this is easy to do in real time with VLC Player but when i tried to do it in my application i can't find out, Please is there any suggestion that i can add to my code to be ready to transpose my videos in playing time without needs to create another vlcj application with another concept.

best regards

throws an exception when open and play mp4 file on windows

I can open and play mp4 file on MacOSX now, but it throws an exception as below when on windows
that's why?

java.lang.ClassCastException: java.awt.image.DataBufferUShort cannot be cast to
java.awt.image.DataBufferInt
at uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent$Defa
ultRenderCallback.setImageBuffer(CallbackMediaPlayerComponent.java:368)
at uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent$Defa
ultRenderCallback.access$600(CallbackMediaPlayerComponent.java:365)
at uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent.newV
ideoBuffer(CallbackMediaPlayerComponent.java:357)
at uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent.acce
ss$500(CallbackMediaPlayerComponent.java:50)
at uk.co.caprica.vlcj.player.component.CallbackMediaPlayerComponent$Defa
ultBufferFormatCallback.getBufferFormat(CallbackMediaPlayerComponent.java:337)

Cannot launch VlcjPlayer - NullPointerException on AudioDeviceMenu.java file

I have downloaded, compiled, and ran the VlcjPlayer application from this link: https://github.com/caprica/vlcj-player. However, it throws the following exception when I launch it in Eclipse:

2015-12-09 16:00:21 INFO Info:77 - vlcj: 3.6.0
2015-12-09 16:00:21 INFO Info:78 - java: 1.8.0_66 Oracle Corporation
2015-12-09 16:00:21 INFO Info:79 - java home: /usr/lib/jvm/java-8-oracle/jre
2015-12-09 16:00:21 INFO Info:80 - os: Linux 3.19.0-37-generic amd64
2015-12-09 16:00:21 INFO NativeDiscovery:121 - Discovery found libvlc at '/usr/lib'
2015-12-09 16:00:22 INFO LibVlcFactory:171 - vlc: 2.1.6 Rincewind, changeset 2.1.6-0-gea01d28
2015-12-09 16:00:22 INFO LibVlcFactory:172 - libvlc: /usr/lib/libvlc.so.5.4.0
2015-12-09 16:00:24 WARN DefaultMediaPlayer:921 - Audio output device enumeration requires libvlc 2.2.0 or later
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at uk.co.caprica.vlcjplayer.view.main.AudioDeviceMenu.onCreateMenu(AudioDeviceMenu.java:48)
at uk.co.caprica.vlcjplayer.view.OnDemandMenu.(OnDemandMenu.java:43)
at uk.co.caprica.vlcjplayer.view.OnDemandMenu.(OnDemandMenu.java:35)
at uk.co.caprica.vlcjplayer.view.main.AudioDeviceMenu.(AudioDeviceMenu.java:41)
at uk.co.caprica.vlcjplayer.view.main.MainFrame.(MainFrame.java:316)
at uk.co.caprica.vlcjplayer.VlcjPlayer.(VlcjPlayer.java:107)
at uk.co.caprica.vlcjplayer.VlcjPlayer$1.run(VlcjPlayer.java:83)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

I don't know what is the cause of the problem. Any help?

Intermittent issue with the MouseMovementDetector component

Seems to be caused when using the recent files menu to start video.

e.g.

java.lang.IllegalStateException: Already started
at uk.co.caprica.vlcjplayer.view.MouseMovementDetector.start(MouseMovementDetector.java:65)
at uk.co.caprica.vlcjplayer.view.main.MainFrame$13.playing(MainFrame.java:431)
at uk.co.caprica.vlcj.player.events.standard.MediaPlayerPlayingEvent.notify(MediaPlayerPlayingEvent.java:42)
at uk.co.caprica.vlcj.player.base.EventService.raiseEvent(EventService.java:94)
at uk.co.caprica.vlcj.player.base.EventService$MediaPlayerEventCallback.callback(EventService.java:107)
at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)

Need to check threading here too as the event is now (with vlcj-4) delivered on the native thread.

It compiled but its not running

This is the error coming:

parth@parth-Inspiron-5521:~/Desktop/vlcj-player-1.0.0-SNAPSHOT$ java -jar vlcj-player-1.0.0-SNAPSHOT.jar
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
NativeDiscovery cannot be resolved to a type
The method run() of type new Runnable(){} must override a superclass method

at uk.co.caprica.vlcjplayer.VlcjPlayer.main(VlcjPlayer.java:76)

Deploy not possible

The current version can't be deployed with maven, because it is pointing to the vlcj version 3.3, which isn't published yet.

rtsp stream delay

I connect ip camera with rtsp , but the stream is delay about 5 second , how to set it low delay?

Some problem with fullscreen

Good day!

Sorry for my english! :)

I made javafx application and use VCLJ. My application worked good. But Can I ask a question?
I need swith to fullscreen.
I read documentation, and see:
mediaPlayer.fullScreen().strategy(new AdaptiveFullScreenStrategy(window));
This "window" - is awt.window

All rigth. But my application is javafx. And I have window only from javafx. And there need AWT.
Help me please! Where I can to find information? How I can convert fx to awt?

Google carefully hides the answer to this question :(((

Can you to help me?

I will be grateful for any help!

Thank you!

Iliya Rudnitsky

Code usage request

Hi, I would like to use some of your code (https://github.com/caprica/vlcj-player) in a desktop app Im creating to download and play videos from internet, I need to play the videos in a separated window and your code is perfect for that , but I need you approbation for that. Im not going to sell the app , Its just a personal project and Im planning to release it. And I will never forget to give you the credit.
If its ok to let me use it , let me know pls. Thanks

display image?

Hi,

is it possible to diplay just image instead of video?

Thanks

missing artifact

Hello
When trying to compile with maven, I receive a message about missing artifact uk.co.caprica:vlcj:jar:4.0.7-SNAPSHOT

Of course, removing the -SNAPSHOT part, fixes the problem.
Maybe this should be the default?
(I am willing to have a pull request if you accept it).

Not adjusting Video Effects

I am trying to adjust the video Brightness / contrast etc. but the vlcj Player does not change the visible video.
I am using mp4 (converted from h264) video. I also tried other sample Videos from the internet but had no success.

Edit: vlc Version 3.0.10

can not run in max os

what's wrong with my player?

vlcj : 4.0.7
os : Mac OS X 10.12.6 x86_64
java : 1.8.0_45 Oracle Corporation
java.home : /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
jna.library.path :
java.library.path: /Users/xxxx/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
PATH : /usr/bin:/bin:/usr/sbin:/sbin
VLC_PLUGIN_PATH : /disks/data/build/install/libs-3/plugins
DYLD_LIBRARY_PATH :
DYLD_FALLBACK_LIBRARY_PATH :
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'vlc':
dlopen(libvlc.dylib, 9): image not found
dlopen(libvlc.dylib, 9): image not found
Native library (darwin/libvlc.dylib) not found in resource path

Problem running the code from jar file

Hi @caprica

I am trying to run the project locally.
I can build the project without any issue but when trying to run it I got the following errors:

$java -jar target/vlcj-player-2.0.0-SNAPSHOT.jar 
Error: Could not find or load main class uk.co.caprica.vlcjplayer.VlcjPlayer
Caused by: java.lang.NoClassDefFoundError: uk/co/caprica/vlcj/player/renderer/RendererDiscovererEventListener

My system is Linux
Library used: vlcj-4.7.2-SNAPSHOT.jar (build from source)

openjdk version "11.0.9" 2020-10-20 LTS
OpenJDK Runtime Environment Zulu11.43+21-CA (build 11.0.9+11-LTS)
OpenJDK 64-Bit Server VM Zulu11.43+21-CA (build 11.0.9+11-LTS, mixed mode)

I try also with vlcj-4.4.2.jar and the same error as above.

Any idea/suggestion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.