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
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...
While promising, Xuggler has been deprecated in favor of humble-video.
The succesor to Xuggler, but Licensing may be incompatible.
vlcj (GPL 3.0)
A native vlc player instance to be embedded in Java applications.
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
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.
Java bindings for GStreamer.
The requirements
- a video player GUI component to be used in ingame UI
- a cut scene screen, a.k.a. a full screen video player
- resource management for videos
- codec support for the most common codecs
- H.264
- MPEG-4
- DivX
- MPEG-2
- HEVC (H.265)
- container support for the most common file containers
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