Jump to content
  • Advertisement
Sign in to follow this  
AngryWill

Fast d3d video capture

This topic is 2772 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

Hi there,


I'm writing an application that needs to generate a 1080p video file, (the video needs only to be 10 to 30 seconds long). My program renders at anything between 5fps and 60 fps depending on how much data it's decoding in the background hence the need to generate a video for smooth playback. I'm using video for windows (VfW) to generate the video (using the default windows media uncompressed codec) however I'm finding that it takes upto 400 seconds to generate the video file. (When playing back without recording it typically takes 15-20 seconds). I'd expect a moderate amount of slowdown but this is much more than expected. Having toyed with other app such as fraps I know that it's possible to generate 1080p video on the fly without significant impact on performance.

Does anyone have any pointers as how to generate 1080p video with negligible impact on rendering?

FYI my app is d3d9 and I use D3DXSaveSurfaceToFileInMemory to grab a copy of the current frame, (I use this utility since I have multisampling enabled which prevents me from locking the back buffer and accessing it directly).

Thanks in advance

Will

Share this post


Link to post
Share on other sites
Advertisement
Are you generating the video at the same time as capturing?

Every time I've had to do this, I've written the (uncompressed) frames to disk while the app is running and then generated the video afterwards.

Share this post


Link to post
Share on other sites

Are you generating the video at the same time as capturing?

Every time I've had to do this, I've written the (uncompressed) frames to disk while the app is running and then generated the video afterwards.


I create an AVI file that is uncompressed 1-1.5GB (for ten second clip). There's plenty of ways to compress it afterwards for storage. So yes I'm generating the video at the same time as capturing.

Share this post


Link to post
Share on other sites
The slowest part is probably writing the (uncompressed) frames to disk. If you can perform some kind of quick compression on them it'll likely help.
Even passing the frames to a background thread that performs JPEG compression before writing them would probably help, but obviously would degrade quality.

There's a good page from the outerra guys describing their approach here: http://outerra.com/video/index.html

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!