Animated graphics formats in OpenGL Java

So, lately a lot of animated graphic formats have seen support with the popular browsers are are used frequently throughout the web.
Formats such as good old gif, webm, gifv, animated jpg apparently, simple mp4s (@ stuff like VINE) and technically animated pngs, havent seen any of those though.

What kind of libraries (that are hopefully compatible with opengl) do we have to decode those formats?
I consciously want to separate this from the video playback discussion, because while we do have some solutions to play video now, something like this is usually way simpler, and they are usually without sound, disregarding the mp4s.

Stuff like webm really shouldnt have any license problems since its an open standard, right?
On the other hand there really should be a pure java decoder for webm’s anyway in the video playback side of things, because webm video are actually pretty decent; But we dont have that either. I guess there is simply not enough demand for it.

Not sure on the licensing but I can confirm that animated PNGs are ridiculously large in size, hence why you don’t see many.

A simple WebM decoder without any native dependencies would be worth its bits in gold. Heck, even without audio support it’d be useful as hell for playing videos in games.

Well, I was Googling for the link to a part-complete VP8 decoder I saw a few years ago, and this came up. Despite not being included in the README it does seem to have code for VP8.

Mind you, if you’re using OpenGL, why would you want to do video decoding in Java?!

Hmm? Why not? I want prerendered cutscenes, tutorial movies, etc.

That’s not the answer to my question! :stuck_out_tongue:

If you’re using OpenGL, you’re already using native code. So, why not use a native video library? A native video library running on the CPU is likely to perform better, and also not bring all that data into Java memory if you’re uploading directly to OpenGL. And given the right library, you might even be able to get GPU video decoding.

So, my question was not why you might want to play videos, but why you want the decoding done in pure Java?

a couple weeks ago i was looking on https://github.com/artclarke/humble-video … which looks promising. not pure java.

Well, the video playback libraries I’ve seen so far haven’t exactly been crossplatform. Having more 3rd party dependencies isn’t really a good thing, and native code seems to be a lot more tricky to get right.

GStreamer is cross platform, and work is ongoing to get the Java bindings supporting v1.x, though v0.10 works well (try out Praxis LIVE! :wink: )

VLC is cross platform, though Java bindings could be a license issue.

FFMPEG / libAV is cross platform, and there are various bindings, including … ^^ thanks for the link @basil_ - that looks really interesting. EDIT - And AGPL! :emo:

yeah years ago nsigma and I basically released a gstreamer java player which works on linux, mac and windows.
video playback with that is actually fairly beautiful, due to the lack of alternatives @topic I have worked with it again
The player works with lwjgl and libgdx.

Actually you wrote some lines in there too theagentd, since I couldn’t figure out the opengl.

Works really stable and synced and everything.
Right now I am switching to the latest gstreamer and libgdx version but I doubt there will be problems

@Topic so yes I GUESS you can use that for simple short animations, but its heavy weight overkill

Example of simple animations:

6id6s2_YAZU

Skip to 1:33
You can see each in FF13, each time you select a character the background is like a short video, like 2 seconds, making it kinda appealing. Saving that in individual frames and loading into memory and all that… yeah. So streaming an animation would be great.

I don’t! If by latest GStreamer you mean v1.x then it won’t work. As mentioned above, we’re working on v1.x support, but there’s been significant API changes from the 0.10 series.

Oooh, there’s a topic?! :persecutioncomplex:

Sorry, kind of dived in to reply to @theagentd without fully reading your original post. Yes, I’d agree for this purpose it’s possibly overkill.

Of the options you mention I quite like MJPEG. It’s pretty easy to decode in pure Java. I used some code years ago to read from an IP camera, but no idea where that came from. There are a few options if you Google though (eg. jAVIlib - not tested it!)

We use MJPEG a lot with GStreamer too in projects like this, where we used motion tracking and had faces following people around a room. Because all frames in a MJPEG are effectively keyframes, it makes it easy to seek back and forth as you want seamlessly.

Also, I guess you could look at 3D textures for short animations. All depends on your use case.