XNA Creators Club Online
Page 1 of 1 (6 items)
Sort Posts: Previous Next

Creating video files directly in code

Last post 11/2/2009 7:33 PM by Raining Talent LLC. 5 replies.
  • 11/2/2009 4:51 PM

    Creating video files directly in code

    I would like to create previews/trailers from my game at high quality. The process i'm trying to achieve is this:

    • Setup the world, events that happen etc
    • Setup the camera movement and target for the whole movie
    • Run the moviegenerater, which runs the game but not in real-time. It will run at a constant speed of 30 fps, but it doesn't matter how long each frame takes.
      So i just update each frame for (1/30) seconds, save the frame, process next frame.

    Is there a way to save the frames as a decent/clean movie format? (i assume there is, but does anybody know an efficient one?)
    Don't play games, create them!
    The Wizards
  • 11/2/2009 5:05 PM In reply to

    Re: Creating video files directly in code

    MHGameWork:
    I would like to create previews/trailers from my game at high quality.

    I wouldn't recommend doing this with code. Take a look at this thread.
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 11/2/2009 5:30 PM In reply to

    Re: Creating video files directly in code

    What you're describing is basically how Alec described how he created the Aquaria trailer.  http://www.bit-blot.com/?p=191

    Instead of writing a movie file, just write out a single bitmap (or png, tga) each frame, and then use a separate program to piece them together into a movie file.  I think Alec used Virtualdub.  (It's free.)

    I like this method alot better than trying to use Fraps or something similar, since you can record full resolution and not have to worry about dropped frames.
    My Blog | My game - Being
  • 11/2/2009 5:41 PM In reply to

    Re: Creating video files directly in code

    If anyone writes up a nice system for this, definitely post it online. I had always wanted to make some sort of system for my games for doing this, but just never got around to it. I guess it also depends on how well you can synchronize the input with the simulation. Aquaria worked by recording the mouse and keyboard input and then having the computer play the game, taking screenshots every frame. If you have a game with a lot of physics influence or don't set up your random number generators in a way that you can easily seed it with the value used during your playthrough (where the input was recorded), the results won't look quite right.

    Definitely tricky, but if your game works out with it, it could be a great way to get a high quality trailer without having to drop the money for a beefy computer or a capture card.
  • 11/2/2009 6:20 PM In reply to

    Re: Creating video files directly in code

    Ok, thanks for the help. I think ill be using virtualdub to mend frames together.
    The only problem of this method is no sound, but thats not much of an issue since the trailer will be cut/pasted and has background music and such. Maybe i could make a no-render mode, that only plays sounds and record that real-time, then we have an all in one :D

    It would've been nice to make the vid in code, but there's not much need for that since you'll be probably spending huge amounts of time on designing the vid. The small inconvenience of running it through an extra program won't be that bad.

    Thanks for the help
    Don't play games, create them!
    The Wizards
  • 11/2/2009 7:33 PM In reply to

    Re: Creating video files directly in code

    You can always just capture it from your PC version as well using some available video capture programs.
Page 1 of 1 (6 items) Previous Next