Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (7 posts)

Render XNA Game to Video

Last post 4/21/2009 5:21 AM by jameswelle. 6 replies.
  • 4/20/2009 6:32 PM

    Render XNA Game to Video

    Hello,

    I'm just getting started with XNA and am interested in using it to create an application that provides functionality similar to what you can do here: http://www.xtranormal.com/

    Basically, I want to allow the user to set up a 3D scene with some animations, maybe voice recording, etc. and then "record" that out to a video.

    From what I have learned so far, XNA can handle all the rendering of the scene and animations, but there is no support for the "record" functionality.

    Some other similar threads suggested that DirectShow could be used for this. I have a question about this approach.

    Would the basic workflow of using DirectShow to do this be that I would render frames to a RenderTarget2D, get a Texture2D from that, and then pass the frame data into whatever video capture API I decided to use? This seems like the intuitive way of doing it, but I'm worried about the performance limitations of doing this and wondering if there is a better way.

    Thanks!
  • 4/20/2009 6:51 PM In reply to

    Re: Render XNA Game to Video

    Anyone that wants to grab video of a game would be better served by doing it the "professional" way as discussed here. I wouldn't recommend trying to do it via in-game code
  • 4/20/2009 6:57 PM In reply to

    Re: Render XNA Game to Video

    I think that is a different scenario. I don't want to personally take a video of my XNA application. I want to allow the user of the application to record a video.
  • 4/20/2009 7:32 PM In reply to

    Re: Render XNA Game to Video

    I understand that. What I'm saying is that you're probably not going to be able to get as good a video as what they can get doing it using a dedicated capture card.
  • 4/20/2009 8:04 PM In reply to

    Re: Render XNA Game to Video

    So, assuming additional hardware is not an option, is rendering frames to images and then passing those images to DirectShow how this would be done? I have been skimming through the XNA APIs and I haven't come across anything that jumps out as an additional way to do this.
  • 4/21/2009 3:56 AM In reply to

    Re: Render XNA Game to Video

    There's nothing in XNA to help you here - you need to be looking at other windows APIs. You would use XNA to capture the back buffer and then save each frame out but there's many things to be concerned about. Pulling each frame from the back buffer instantly creates some latency, compressing the images (if you choose to compress on the fly) is CPU heavy, saving to a file adds latency.

    DirectShow is one API you can use to do the compression - there's many others. Off/MP4 etc. SOund recording has DSound and I think DShow can use DSound to grab the audio output too. They are failry specialist APIs so you might want to seek out other forums.
  • 4/21/2009 5:21 AM In reply to

    Re: Render XNA Game to Video

    OK, thanks. That is what I was wondering - if using RenderTarget2D and Texture2D and having XNA render to those was the way to supply the data to DirectShow or whatever video API I decide to use. It sounds like that is the way to do it. I will have to do some performance testing to see if this is feasible or not. Thanks.
Page 1 of 1 (7 posts) Previous Discussion Next Discussion
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG