as so many others I hunted after a way to play a video in a java application across the platforms mac osx, linux, win. The frameworks like Xuggle, JMF etc are either outdated, dead or plainly do not work properly. I now came across a suggestion to use SWT and just load via its browser component a webpage that embedds a video. I tried an example using the windows SWT and loaded a youtube page - it worked flawlessly.Now there are two questions coming to my mind: what is SWT using that it can display e.g. the youtube video stream without problems and can I use this library on its own to just embed a video and not a whole webpage?

Now there are two questions coming to my mind: what is SWT using that it can display e.g. the youtube video stream without problems and can I use this library on its own to just embed a video and not a whole webpage?

It would appear to be this? http://www.eclipse.org/swt/faq.php#whatisbrowser. So, theoretically possible to use, but you'd need the SWT binaries. JavaFX's WebView is similar. You could embed one video by just creating a webpage that has the YouTube embed code and nothing else.

However, unless you have a very particular reason to want to use YouTube, don't! Take Riven's advice and check out that thread. There's also this. Use whichever works best for you - there are pros and cons of both.

Actually, not that different to the old, seen as it's a wrapper to a locally installed GStreamer! Having said that, having GStreamer code accessible in any Java install by default would be great and save all that library loading nonsense I ported from Processing. Lets just hope there's a way to access all the power underneath, as at the moment a lot of it is locked away in JavaFX.

So if you search this forum you will come across a lot of threads by me, since I really wanted this feature and looked everywhere.

Today, the best 3 options are- aforementioned YUNPM - which has mild license issues with the codecs, you may have to recompile FFMPEG- VLCJ - which is still LGPL, so again a legal issue- and gstreamer-java, in this thread we created a player for lwjgl that uses gstreamer and, if you delete the plugin files / codecs, has no license issuesand it works beautifully

- there is of course Xuggler which is... very complicated to say the least and not sure about legal problems - and I have yet to see "long" action videos, played and synced with Xuggler

- JTheora should be the default option, if it didnt suck so hard, since its a pure java way of decoding theora and vorbis, the codecs you would wantYou CAN play theora video alone with it, but video AND audio, just doesnt work anyway near reliable... it will crap-out 8 out of 10 times...

This is in this package, it relies on LibAV and FFMPEG as far as I know.

Presumably LibAV or FFMPEG?!

From looking at the code it seems that this doesn't yet support audio playback? It's also not bundling the libs, though I assume that's fairly easy to set up - JavaDoc mentions system install?

At the moment this would seem to be offering less than either the YUNPM or GStreamer-Java solutions. I'm not keen on solutions tied to a particular output either. Direct access to the native video buffers is far more useful across the board. The GPU based YUV conversion is good, but it would still be possible to achieve this using direct buffer access.

From looking at the code it seems that this doesn't yet support audio playback? It's also not bundling the libs, though I assume that's fairly easy to set up - JavaDoc mentions system install?

It's wrong. Sven made a demo of it as Siggraph 2012 with an extract of a famous movie and the audio playback worked just fine I'm really sorry for the lack of documentation. You can run our demos to check it out.

At the moment this would seem to be offering less than either the YUNPM or GStreamer-Java solutions. I'm not keen on solutions tied to a particular output either. Direct access to the native video buffers is far more useful across the board. The GPU based YUV conversion is good, but it would still be possible to achieve this using direct buffer access.

It works out-of-the-box even on a Raspberry Pi and nobody prevents you from porting the code to LWJGL.

It's wrong. Sven made a demo of it as Siggraph 2012 with an extract of a famous movie and the audio playback worked just fine I'm really sorry for the lack of documentation. You can run our demos to check it out.

I haven't tried the demos, so sorry if this does work. I was going off the FFMPEG code in the JOGL repo which has the audio code commented out and a big "TODO: audio output"!

That misses my point, and assumes my only interest is getting video into LWJGL. A useful video library will provide direct access to the video data through a native buffer or alternative pointer. That data can then be used however you want, which may not involve OpenGL at all!

Given that I've got GStreamer code that works fine cross-platform, and offers far more than libAV, I don't have much interest in this myself! However, as a lightweight option it could offer some benefits over the YUNPM approach by linking in-process rather than externally (particularly for seeking / syncing), if at the same time bringing up licensing issues.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org