-
-
Notifications
You must be signed in to change notification settings - Fork 94
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Implement video player GUI component #291
Comments
Nevermind it's GPL |
Progress on gurkenlabs#291
Just a note: VLCJ has an incompatible license (GPL). OpenJFX however is compatible (GPL with Classpath Exception) |
It looks like the video player in jcodec's repository is unfinished. It doesn't exist on maven central and has some... interesting method names. |
Hahaha, what the hell😅 |
So I reached out to the developers of vlcj to see if by any chance we could use their product despite incompatible licensing, here's what they said:
So while they are not entirely reluctant to let us use their product, they have legitimate concerns about the legal viability of such an endeavour. It would require a way of us redestributing vlcj while making sure that any derivations of our work would comply with GPL, and I honestly do not see such a way. Does anyone have any expertise on this field? |
GPL was intentionally designed to be incompatible with MIT, so it's not possible. GStreamer seems like the best alternative. This might be helpful: https://github.com/gstreamer-java/gst1-java-examples/blob/master/src/main/java/org/freedesktop/gstreamer/examples/SimpleVideoComponent.java |
I thought so... |
I was able to get something sort of working with GStreamer, but there are many bugs with the GStreamer java bindings. For example, you can't seek to a specific point in the video unless it is playing. And you have to wait ~120 milliseconds after playing before you can seek. Anything more complex than pausing/playing the video doesn't really work at all. My fork is here: https://github.com/Gamebuster19901/litiengine/tree/video Also the fork is largely untested, there may be memory leaks etc. |
Great to hear you've managed to make some progress on this! |
As long as video support is not in the engine, I want to advertise using vlcj in your game (keep licensing in mind). MediaPlayerFactory mediaPlayerFactory = new MediaPlayerFactory();
EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.mediaPlayers().newEmbeddedMediaPlayer();
mediaPlayer.videoSurface().set(mediaPlayerFactory.videoSurfaces().newVideoSurface(Game.window().getRenderComponent()));
mediaPlayer.media().play("path/to/video.mp4"); |
A bit late in the discussion, but I remember a similar issue had happened with Minecraft's server overlays, namely bukkit, craftbukkit, and spigot. This is only a vague outline from what I remember and requires further investigation, but perhaps a similar approach could work in your case. |
Don't do this, just respect the wishes of the developer(s). Currently, both GStreamer and JavaFX have working implementations and have compatible licenses so there are alternatives. You should only use vlcj if you are fine with licensing your code under the GPL. |
Perhaps we should take a look at https://github.com/bytedeco/javacv. It's licenced under apache so it's compatible. It is a pretty big dependency though, and contains a lot of stuff litiengine doesn't need. |
This looks promising and has a compatible license: https://github.com/bramp/ffmpeg-cli-wrapper I'll see if I can get something working soon. |
looks good indeed! |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Many games play more or less important videos at some point, e.g. for in-game skill showcases, cut scenes, intros, and many more.
So far, we have neither Resource management nor playback capabilities for video files.
With pure java, this is not exactly a trivial thing to do, so we might need to use some external libraries for this.
Potential candidates
JavaFX (GPL)
It is possible to play back video in a JavaFX scene wrapped into a JPanel, but we need to consider this carefully, since JavaFX is not needed anywhere else in the engine right now and LITIengine is an AWT framework by design. Using JavaFX at one point would imply switching other internals such as rendering and UI to JavaFX as well, but that would entail completely changing LITIengine's scope...
Xuggler (LGPL-3.0)
While promising, Xuggler has been deprecated in favor of humble-video.
Humble-Video (AGPL-3.0)
The succesor to Xuggler, but Licensing may be incompatible.
vlcj (GPL 3.0)
A native vlc player instance to be embedded in Java applications.
Java Media Framework (JMF)
Truly an antiquity, the JMF may be a bit dated and lack support for many modern containers and formats. Still, it may be enough for our needs. example 1 example 2
Freedom for Media in Java (FMJ) (LGPL-3.0)
This library addresses some of the shortcomings of the JMF (e.g. codecs and containers), while retaining a fully JMF compatible API.
jcodec (BSD-2-Clause)
An implementation of the most common video and audio codecs.
GStreamer (LGPL-3.0)
Java bindings for GStreamer.
The requirements
The text was updated successfully, but these errors were encountered: