Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to play a movie file into an OpenGL texture in a Java application. I am using JOGL and have a basic OpenGL scene, but I have no idea how to play a movie into a texture.

The only thing I could find was this:

It is quite old and uses JOGL 1.1 and Fobs4JMF, which is no longer maintained. I managed to get it to build in eclipse but it wasn't able to read my movie clip. I could probably convert the movie clip to an older codec to see if that works, but I would rather have a modern solution.

I am a professional game developer, so the OpenGL part is no problem, but I am new to Java (coming from a C++ background).

Is there any modern library that wraps this functionality in an easy to use package?

share|improve this question
You can use xuggler to decode vid files but it doesn't provide anything to integrate with JOGL so you'll have to code decoded vid->texture part yourself. – XiaoChuan Yu Jun 21 '13 at 2:05
I have done the opposite, encode a H.264 video from OpenGL rendering with Java, and I can highly recommend xuggler. It took around 4 hours to glue everything together and have a working solution. By transferring the data with Pixel Buffer Objects and encoding in a separate thread the performance hit was unnoticeable. – msell Jun 21 '13 at 5:13
I am currently looking into xuggler. Seems pretty powerful. Thanks for the tip – DaleyPaley Jun 24 '13 at 0:23
up vote 1 down vote accepted

You may use the JogAmp JOGL GLMediaPlayer class

GLMediaPlayer will use the operating system installed codecs to decode the movie, on Android it uses the Android media framework and on desktop systems such as Linux, Windows and Mac it dynamically links to and uses installed libav/libffmpeg libraries. GLMediaPlayer itself only expose a platform neutral API and renders to a texture.

Example code are found to playback a movie on all six sides of a cube and on a rotating rectangle inside the jogamp jogl test codebase:;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/;a=blob;f=src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/

share|improve this answer
Thanks, this seems to be the 'correct' way to do it. Good stuff! – DaleyPaley Jun 24 '13 at 0:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.