Hello Guest

Cinematic Movies

  • 7 Replies
  • 9596 Views
Cinematic Movies
« on: August 17, 2011, 16:30:10 »
Hi,

I want to create a cinematic video at parts of my game to explain game play and provide a narrative.

There are two techniques I have thought of so far:

1-The easiest way would have been to simply play a movie file. That way I could use non-game elements like real-life footage and it would also be easiest to replace video. From what I have read you can do this with xuggle but xuggle needs a full install to work (I haven't tried it yet). Ideally I want the game to be stand-alone.

2- Write animation code in-game... like "move sprite from here to here and play sound while doing that, then wait till sound and animation are done and do part two of animation etc..." this seems slow to code. It does seem that most current games are doing cinematics this way. However, I don't like this option since it is hard to change things, and seems a bit sketchy (audio and visual might not sync up).

3- Show full screen screenshot-images and play audio. Then change the screenshot when audio is done. This would be quicker to code, but still might cause problems with sound and video sync. Also would be dull. Seems memory intensive.

Has anyone got ideas?

Thanks,
Guy

Re: Cinematic Movies
« Reply #1 on: August 17, 2011, 19:28:11 »
As to #1, I've been wanting to use Xuggler to do that with LWJGL for quite a while, but I haven't had time to do any full-on development. But yeah, I agree, the way they force you to set up Xuggler is a pain... ideally, you could simply make it work like LWJGL - have the native libraries present on the user's computer, point a Java System property in the right direction, and bang! Xuggler is operational. No idea if this is actually possible with the way they do it, though.

But I really, really, really think LWJGL needs to have cinematic functionality (even if it's through a third-party library), and needs to let people know how to use it. A suite of tutorials would be really nice. Maybe I'll put some together once I get around to making movies in my games.

Re: Cinematic Movies
« Reply #2 on: August 18, 2011, 03:39:05 »
I think this would be easy to do if you know the format of the movie file.

You would just read the move file in, load in each image like you normally would in OpenGL, load in the audio like you normally would in OpenAL, and then try to play it based on the settings (FPS, etc.).  You could possibly do some type of "buffering" also (load in a few images/audio bytes at a time).

Here's some open source video codecs:

http://en.wikipedia.org/wiki/List_of_open_source_codecs

Theora is probably the way to go:
http://theora.org/cortado/

If you already know how to load images/audio, this shouldn't be too difficult.  :)
But I agree, this would be cool to have as a spin-off project connected to LWJGL (like lwjgl-extended or something).

cool story, bro

Re: Cinematic Movies
« Reply #3 on: August 18, 2011, 04:09:17 »
I haven't messed with Xuggler in about a year, but from what I recall, it was pretty straightforward compared to using libav in C, which I had previously been doing a fair amount of at the time.

My $.02

Re: Cinematic Movies
« Reply #4 on: August 18, 2011, 11:24:03 »
Quote
But I agree, this would be cool to have as a spin-off project connected to LWJGL (like lwjgl-extended or something).
Yes. LWJGL needs more extensions. LWJGL-Vid or LWJVL (Light Weight Java Video Library) or something. Just have an additional Jar that gives you built-in methods for playing all supported audio.

Quote
Insert Quote
I haven't messed with Xuggler in about a year, but from what I recall, it was pretty straightforward compared to using libav in C, which I had previously been doing a fair amount of at the time.
That's good to know.

I guess I just want to get in touch with their team and see how easy it is to make it portable, like LWJGL. We'll see from there.

Re: Cinematic Movies
« Reply #5 on: August 19, 2011, 04:17:46 »
I had never heard of Xuggler before this thread, but this is what turned me off:

"The install binaries for Xuggler on Linux are built on Ubuntu Jaunty for Intel 32-bit or 64-bit processors. If you need support for other operating systems, you must build Xuggler binaries yourself..."

So newer versions of Ubuntu won't work, nor will Fedora, etc. (unless you build it yourself; seems like it could be a pain for users/programmers)

It'd be better to have an API that doesn't depend on C/C++ code.  Just have pure Java goodness.  LWJGL has to obviously, but reading/writing media files is generic enough where you don't need to, while doing OpenGL/OpenAL/etc. requires lower-level calls.
« Last Edit: August 19, 2011, 04:25:33 by jediTofu »
cool story, bro

Re: Cinematic Movies
« Reply #6 on: August 19, 2011, 11:27:34 »
Hmm. Good point.

So is the Java Media Framework the next best option? The reason I initially didn't favor using it was because it's apparently not kept as up-to-date as it should be, but it is a pure java solution.

*

Offline Chuck

  • *
  • 42
  • aka sproingie on freenode
Re: Cinematic Movies
« Reply #7 on: August 19, 2011, 17:59:15 »
JMF is seriously ancient and unsuitable for anything resembling modern A/V formats.  About the only reasonable video format it supports is H.263 and it's TERRIBLE at it, supporting only a bare minimum of the spec.  To get anything like decent performance you need native library addons (called "Performance Packs").

You might try FMG (http://fmj-sf.net/) or possibly JavaFX which have much more modern codecs.  Neither are pure java, but then neither is LWJGL.