2

I'm trying to play videos within a LibGDX application. I've managed to load the individual video frames sequentially into a java.awt.BufferedImage using Xuggler.

Now I'm stuck trying to get that into a LibGDX Texture. Anyone know a way to do this?

I managed to find these two LibGDX files that happen to use BufferedImage's, however can't see how to use this to get my data into a Texture :(

aaronsnoswell
  • 6,051
  • 5
  • 47
  • 69
  • Footnote: AFAIK no-one has successfully managed to get video playback from within LibGDX yet. If someone already has, feel free to post that as an answer :) – aaronsnoswell Feb 02 '13 at 10:34
  • 2
    [Have a look here](http://gamedev.stackexchange.com/questions/30607/play-videos-with-libgdx). – Stefan Hanke Feb 02 '13 at 17:34
  • the JOGL files you list are part of the libGDX backend. They are how libGDX implements its API on the desktop, when using JOGL. – P.T. Feb 06 '13 at 23:57

2 Answers2

2

as soon as you transformed your bufferedImage to a pixmap just use the Texture constructor passing in a pixmap:

 Texture newTexture = new Texture(myPixmap);

There are methods to construct an empty Pixmap and draw onto it. Use this pixmap then as described above

yesyoor
  • 96
  • 8
0

If you are using LibGDX, I have to say that I don't recommend also using BufferedImages (from Java2D), instead you could use a Pixmap, or if you really do need BufferedImages, then I guess you could use ImageIO to save the image to a file, bring the file back in as a texture, then delete the file, but that seems quite hacky and inefficient.

genaray
  • 1,080
  • 1
  • 9
  • 30