Sign in to follow this  
Storyyeller

replays and video econding

Recommended Posts

I have a completely deterministic game (using SDL for video and SDL Mixer for audio). I want to add the ability to create replays, and then turn the replays into videos. What is the best way to go about this? I'm not sure where to start. I know that I can save a screen capture of each frame in SDL with SaveBMP, but I have no idea what to do about audio, or how to make sure the audio remains in sync with the video. Furthermore, I don't know how to turn a series of bitmaps into a high quality video. My game runs at 62.5 fps, but I think videos normally run at a lower fps, so I guess I'll have to interpolate between frames or blur them together or something. But at 30fps, this is likely to produce aliasing effects.

Share this post


Link to post
Share on other sites
I have not done this before, but I don't think it is efficient to save every single frame !
You could rather store for each frame the objects positions and/or user inputs, so that you can reconstruct the sequence.

Share this post


Link to post
Share on other sites
I use doubles, but the physics engine (Box2d) uses floats internally. I'm not sure why that matters though.

The user input consists of just a couple of booleans each frame.

Share this post


Link to post
Share on other sites
Quote:
Original post by Storyyeller
I use doubles, but the physics engine (Box2d) uses floats internally. I'm not sure why that matters though.

Depending on the computer architecture, floating point computations are not always deterministic. That's why Java has the strictfp keyword, for example.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this