My game outputs a replay file for each individual game and allows the player to watch past games.

Just a quick example of what our replay files look like:

m 6 2098.25 917.125 -1 0 224 56ööööö843949615
m 2 1715.25 1835.25 1 0 224 44ööööö843949621
m 11 1661.125 1890.875 1 0 224 56ööööö843949627
m 5 1818.125 929.0 0 1 224 56ööööö843949633
death 9 3 4 5ööööö843949663
hit 9 3 4 48 26 2114 1987 2.8266926 1865 1891ööööö843949663

Some info on the identifiers:

Movement: // m (player id) (x coord) (y coord) (x-movement) (y-movement) (remaining health) (shot energy remaining) (timestamp)

Death: // death (dead player id) (killer player id)

Hit: // hit (hit player id) (hitter player id) (weapon (1-4)) (damage dealt) (life remaining ) (x coord) (y coord) (angle of hit) (total damage dealt) (total damage taken)

There are a lot more than what I listed, but you get the idea.

What's in the replay files are essentially the same as what is sent to the server during a live game.

Right now, if we want to take a video of the game, we just go into our replay system and record it with Fraps, but I'd like to convert our replays into some kind of video format.

I know this may be a bit far-fetched, but I thought I'd give it a shot here.

The game is written in Java and is sprite based.

  • \$\begingroup\$ Not sure if I understand your question: "...record it with Fraps, but I'd like to convert our replays into some kind of video format". Doesn't Fraps create videos for you? Or do you want to be able to create a video from your replays without Fraps (eg. directly from your replay system)? \$\endgroup\$
    – bummzack
    Feb 12, 2012 at 21:52
  • \$\begingroup\$ From what I understand the OP doesn't want the intermediate step of Fraps. They want to convert the reply file directly into video, without the need to load it up in the game and play through it. The only thing I could think is rendering frames to images then compiling those into video. But then you're missing sound. Overall it sounds very difficult. I'm not sure of any games that currently do this. \$\endgroup\$
    – House
    Feb 12, 2012 at 22:28
  • \$\begingroup\$ Ya, I'd like to just do it directly without using a 3rd party program. \$\endgroup\$
    – Kyle
    Feb 12, 2012 at 22:45

1 Answer 1


Building a good video capturing system into your game is going to be quite challenging. Especially if you want to record in real-time. If your replay system allows for a slower playback, then it's going to be easier to avoid frame skips etc., but then you'll have a problem with audio recording.

You should test if you have enough CPU cycles to record in real-time, or if you need to capture video with a lower frame-rate and then "record" audio separately.

I don't know what technology you use for rendering, but getting rendered frames shouldn't be too hard. When using OpenGL you could use a render-to-texture approach. In any case I suggest you have a look at an existing recording API like Xuggler. It will allow you to add separate frames to a buffer that will then be encoded to a video file. They also have some tutorials that might help you getting started.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .