rendering video on a texture in LibGDX
Asked Answered
B

3

6

i am new to LibGDX
i'm building a game and i have an animated background that has about 10 seconds of animation (250 frames aprox.) since it's useless to try and build a sprite sheet for this (large background of course) is there a way to render video files are png sequence to a texture so i can have my animated background drawn in the game?

Baerl answered 27/2, 2012 at 16:2 Comment(0)
N
3

There is now an extension for video playback gdx-video.

Nonu answered 14/3, 2012 at 1:13 Comment(1)
this library is not working/available now, do you any library which available and works now.Wingback
W
1

If your idea is to put a texture on background and render the image and timely replace it to give the animation frame, then a good start is having a look here: How to draw a texture into a quad with OpenGL ES 2?

Windle answered 29/2, 2012 at 11:46 Comment(0)
O
-1

I is the way to play, libname is "indiespot-media-0.8.09.jar" site

How to use:

  1. dowload full zip
  2. copy lib folder in the root of proj (ffmpeg will be opened by lib with path ./lib/ffmpeg/ffmpeg@os postfix@)
  3. player = new MoviePlayer(videoFile);
    Texure playerTexture = new Texture(player.movie.width(), player.movie.height(), Pixmap.Format.RGBA8888) {
      @Override
      public void bind() {
          Gdx.gl.glBindTexture(0, player.textureHandle);
      }
    };
    
  4. use playerTexture as usual texture
Odyssey answered 1/12, 2015 at 14:10 Comment(1)
What does exactly statement 4 mean?Thorax

© 2022 - 2024 — McMap. All rights reserved.