gStreamer in LWJGL

well just

Gst.init("VideoPlayer", new String[]{"--gst-plugin-path='vlib_gst/windows32'"});

doesnt work for me, cannot find gstreamer…
But yeah your LibraryLoader works fine, so I guess we dont have to worry

I just realized you have a Gst.init in LibraryLoaderImpl’s load() and I had my own in my player, we only need one I guess

btw, what do you do on Linux ? just dont use LibraryLoader, and java-gstreamer finds everything on its own on Gst.init() ?

Well, no, it won’t! The path needs to be absolute for a start, formatted for Windows, probably without quotes, and you also need to make sure it’s in the first call to Gst.init() - ie. in my LibraryLoader code.

new String[]{"--gst-plugin-path=" + pluginDir}

might work.

Keep both Gst.init(). The second call will be practically a no-op, but not cause any issues. The call in LibraryLoader is needed prior to the plugin registration, but if you remove it from your code and don’t call the LibraryLoader on Linux then it will fail.

GStreamer-Java works fine on Linux without the library loader code, finding the system installed GStreamer by itself. It also works fine on Windows for me with a system-installed GStreamer (from OSS builds), but I think the bundling is nicer and easier for the end user. Not used a Linux distro in years that doesn’t come with GStreamer by default.

works fine on Ubuntu


File dir = new File("vlib_gst/windows32");
String pluginDir = dir.getAbsolutePath();
System.out.println("--gst-plugin-path=" + pluginDir);

Gst.init("VideoPlayer", new String[]{"--gst-plugin-path=" + pluginDir});

No dice.
path sysout is correct, still doesnt work.

Assuming you’ve put this in my lib loader code, then I’ll have to do some more exploring when I get a chance - which won’t be for a little while. Still, it’s working even with a system installed GStreamer so I guess it’s nothing to stress about! :smiley:

I agree.

As mentioned earlier, GStreamer (webcam), LWJGL and live-coding GLSL fragment shaders in Praxis LIVE. Finally got around to some videos! ;D

This is captured on Ubuntu, but working identically on Windows too.

19RIt9SslfY

There’s another GStreamer (though not LWJGL) example here.

That is pretty amazing! :o

Hey ra4king, thanks, glad you liked it! ;D

This is actually one part of Praxis I hope might have some use for people around here - it makes a fun playground! There’s no syntax highlighting of GLSL yet, but hopefully can get that done soon with some basic code completion.

I’m sorry but using hardware acceleration in Java with video and even shaders is not so new. Good luck with gStreamer and LWJGL. nsigma’s demos are amazing, I agree with ra4king.

?!? Where in the world did he say that this is brand new never-before-seen stuff?!

JogAmp…

As @ra4king says, I’m definitely not claiming that. It’s not even new for me - been playing with this for at least 18 months, and was reading various blog posts about it before I started. I posted the video more as an encouragement to anyone looking at this thread and trying to get it working that it does work!

What is potentially new (I’ll at least claim more unusual ;)) in Praxis LIVE is its architecture (http://praxisintermedia.wordpress.com/2012/07/26/the-influence-of-the-actor-model/), which enables not only editing the shader and controlling the parameters live, but the potential to connect audio to control the shader, or MIDI, or build a custom GUI, or a fragment of (live-compiled) Java code … all while the video is still playing.

Thank you! ;D

PS. Going on holiday in 5 min, so don’t expect much else from me in the near future. There is a thread for Praxis if you’re interested in anything specific about it - I was not intending to spam this useful thread. :slight_smile:

GStreamer in LWJGL “Showcase” package

For now only win32 and 64 libs.

playbin.getVideoSize() return NullPointer
haven’t tried anything but Theora, might be only with Theora, still sucks D=

If you’re calling it before the playback is initiated that would be expected. Anyway, the listener gives you the video dimensions.

Can’t figure it out, only other way I found was Video.getVideoSize and such but it requires a Pad.

I obviously need the info before I play the video to do create the Buffer with BufferUtils.createByteBuffer

Surely you can create the buffer in the listener? Check if null and create. Check if null in update() too and just return. You’ll also have to synchronize on something else. There are other ways, but that’s probably easiest if you don’t know the video size in advance.

Some changes.
Should scale properly now, does not really have resizing in mind, since in a game you have one resolution and video will just adapt to it.

SlickApp http://pastebin.java-gaming.org/89b509a2c2e
GStreamerPlayer http://pastebin.java-gaming.org/9b50a0c3e26

So for linux, I tried to get the libs aswell

I went into /usr/lib and copied everything that seemed useful, and later compared it with out mac and win folders of gstreamer and deleted everything that seemed unrelated… a lot of course
if in /usr/lib there was just a gstreamer folder with everything in there, it wouldnt be a problem, but its kinda like system32 on win
Anyway I’m pretty sure I have a linux32 folder for gstreamer now, which should work and may only contain more unnecessary stuff.
Me personally, I will delete everything but the theora and vorbis decoders later in real usage anyway because of license issues

Haven’t had the chance to test it out though yet.
Does anybody know which linux distro has a live-cd version, java installed, but no gstreamer ?
well propably not =D

going to get just some linux distro, deinstall gstreamer and install java…