jME: Movies are coming!

The ability to load movies in jME is coming soon to a cvs near you. Many people have asked for this and some attempts to do it with 3rd party packages such as jmf have been done to varying degrees of success. But I've always wanted to see some kind of native support (no extra libraries needed) in jME for playing movies to a texture. After reading up on Id software's Quake3 movie format called RoQ (also used in other games such as American McGee's Alice) I decided it was simple enough to start off with. You can read up on the format and find some related C code over at the website of Dr. Tim Ferguson. I used his work heavily to learn the file format. My implementation makes good use of nio and memory mapped files, bringing the loading and parsing time of the files to less than 12ms per frame on my machine (p4 3.2GHz.)

Here are a few screenshots of my loader code in action running the demo movie from the Alice demo:
RoQ on a cube 1
RoQ on a cube 2
RoQ on a cube 3

I'm now working on loading audio from the format as well as making a generic API around the code so we can write conversion tools for other formats as well. Stay tuned for more!

4 comments:

DarkProphet said...

Since you decided to copy me, i'll give you a few pointers ;)

Use glTexSubImage2D instead of glTexImage2D, although RoQ specifies full frames, i.e. no offsets. Its faster on my machine, it probably doesn't hault the pipeline as much because the internal format must be the same.

Use shaders for the YUV to RGB conversion and mind the endianness of the file. Use a matrix multiplication for the conversion because that takes only 1 operations on the GPU, very nice.

With the above, 190FPS (5.26 ms) is possible. With no shaders, we're doing 130 FPS (7.69 ms).

Thats pretty much it, enjoy :)

DP

Renanse said...

LOL, cute, considering I know where you learned some of that... but in case you didn't notice my frame rate, I'm not very worried about performance with my implementation. Thanks though. And geez, if you really have a working RoQ decoder relax dude, I'm sure lots of people do and newsflash they aren't all copying yo. In fact they, me, and YOU are all copying Dr. Tim Ferguson's work.

Not sure why you have to worry about it on your "implementation". When you have something that should only update once every 30 frames and takes a few ms to update...

POP said...

AWESOME DUDE!!!

p.s. when can i be a JME beta tester?

Renanse said...

Thanks, Pop! Best wishes on your wedding tonight.