Hi,
I’ve got a problem. Can I take an .avi file and texture it in jogl?
I’ve found this tutorial, http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35, but there isn’t the java porting.
Someone can help me?
Thanks a lot!
Hi,
I’ve got a problem. Can I take an .avi file and texture it in jogl?
I’ve found this tutorial, http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=35, but there isn’t the java porting.
Someone can help me?
Thanks a lot!
The short answer is yes you can get it to work. A lot of the nehe code can be easily ported to JOGL because the method names are basically the same. Try looking at the source code for the demos or getting a simpler nehe tutorial ported before doing this one if you’re struggling so much.
My problem isn’t porting that code to java, but the way to load and texture frame by frame an avi file.
Can you help me?
that lesson is a head ache. I ended up dropping it, and writing my own video loader. that takes a lists of jpegs, and syncs it to an .ogg file
if you really want to load avi’s in opengl.
the challenge is that you need to load a video, so you will have to get and work out how to use a video library for java (maybe try JMF). then (on the fly) get each frame, or group of frames, get the byte data for the frame, then load it into a texture object then draw it to the screen. As you can guess it would be extremely slow.
Have you thought about just loading the video into a seperate window?
You could try using glDrawPixels(), the data buffer is formatted like the data for a texture, except it draws it directly to the screen. This could be faster, especially if you don’t have to do that much data conversion for each frame of the video (I don’t know the avi format).
I have to load avi in opengl because I will draw some textured quads with rotation and blending.
The greatest problem for me is to capture the frame; I’ve tryed with JMF, but I didn’t found any methods to do it.
:-\
Thanks for help me
I’m doing it using JMF and FOBS4JMF which is using native FFMPEG bindings to do the decoding.
Have a look at the VideoRenderer and VideoDemo classes of the Video Demo on the following page:
http://www.blackspirit.ch/projects/bsgraphics/demo_en.html
This shows how to register FOBS4JMF at runtime and get the frames from JMF.
Setting up FOBS4JMF is quiet hard, read their instructions on their page carefully and
make sure to have the right jmf.properties (some distributions contain a crappy one… they say that themselves)
http://fobs.sourceforge.net/
You would mainly have to change the process(Buffer buffer) method in the VideoRenderer
to write to your TextureData in the correct way (depending on what buffer type you use)
and then update the Texture with it.
The performance is not too bad.