LWJGL 3 Video Player

Started by darkfrog, February 05, 2016, 14:51:11

Previous topic - Next topic


Hey guys, my company has been developing a video player built on libVLC for the past few months that uses shaders exactly the same way that VLC does to render video in OpenGL.  It is currently built to work with libGDX, but it should be quite easy to port.  I've spent thousands of dollars having this framework developed to the place it is in now, but it still has some bugs and needs some work before it's stable.  If someone on the LWJGL team would be willing to commit to bringing the functionality into the fold quickly I would be willing to contribute this closed-source project in an effort to both enhance LWJGL 3 as well as not having to maintain it myself going forward.

The video quality and performance is nearly identical to using VLC with OpenGL.  It is by far the best video playing experience in Java.

I simply need a commitment that this will be integrated quickly or I need to pursue other options to get this done.


Hey darkfrog,

This is certainly interesting. We've talked about libVLC bindings before and it's something that's probably going to happen in the future. However, LWJGL avoids high-level frameworks/functionality, it would introduce maintenance overhead that we cannot afford. I would need to know more technical details about your implementation before deciding if it's a good match for LWJGL.


I would actually recommend FFmpeg bindings instead of libVLC. The advantage with FFmpeg is that it is somewhat lower level, and it can be compiled without patent infringing codecs. You could configure it in such a way so only demuxers and decoders which are needed for WebM playback are available: VP8, VP9, Vorbis, Opus, and MKV. You also comply with the LGPL license because you dynamically link against the library.


Hello all

I'd like to followup on this thread with some questions / thoughts:

- What are the general requirements / needs on media decoding for LWJGL users?
- What formats are acceptable?

Generally, I'd be in favour of a "minimal" solution in the spirit of the STB image readers / writers:

- Being able to decode videos that under control of the developer, i.e. don't support weird formats, corrupt videos etc.
- Restrict support to a minimal set of common containers / codecs. E.g. support MP4/MOV & H.264 (eventually H.265).
- Minimal metadata support (dimensions, framerate).
- Camera input support.


- IMHO the main goal should be to basically decode frames and get them into Buffers easily, so they can be loaded without big overhead into OpenGL textures. Similar for encoding.


- libvlc and ffmpeg are great frameworks, but also quite big (although they can be configured minimally). Also quite a heavy dependency, including license issues.
- I'd rather handcraft a JNI interface with a small c library that then maps to the OS native media libraries, i.e. AV Foundation on OS X, Windows Media Foundation, or (likely) ffmpeg on Linux. I've done this before for OS X, it's just a few lines of code.

Since moste earlier solutions (xuggler etc) are stale, I'll start hacking on this at some point, and will be happy to consider your inputs.

Any opinions on this?