Jump to content
  • Advertisement
Sign in to follow this  
Storyyeller

replays and video econding

This topic is 3004 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!