Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Contact info
 
Other projects
   Altirra

Archives

Blog Archive

BltBlt() from screen seems faster in Windows 7

A while ago, I added the screen capture driver to VirtualDub, which allows you to use capture mode in order to capture the screen instead of from an external video source. One of the special hacks in this module was OpenGL capture mode, which used a quirk in the definition of OpenGL front buffer rendering to achieve hardware accelerated screen capture -- in particular, using the graphics card to do scaling, color conversion, and change detection. Unfortunately, starting with Windows Vista, or more precisely WDDM, this doesn't work anymore due to front buffer redirection. Therefore, the only way you can capture the screen is by turning off OpenGL mode in Video > Video Source, which disables all of the neat features.

Recently, I had to capture the screen in Windows 7, and I was pleasantly surprised by the speed. When OpenGL capture mode is disabled, the screen capture driver works by simply doing a BitBlt() from the screen (i.e. GetDC(NULL)) into a DIB section and then reading that out. On Windows XP, this is dog slow and unusable for capture at any real size and frame rate. It appears that on Windows 7 there has been some major optimization put into this and the BltBlt operation is much faster, as I was able to pull 1024x768x32 at 20 fps. It's still not quite as fast as a hardware accelerated downscale + YCbCr conversion, but it's definitely usable. This might be fast in Vista as well, but I can't tell as I don't even bother having an install of that OS anymore. The cursor blinks a lot during the capture, but VirtualDub has to manually redraw the cursor anyway so this doesn't matter in the output video.

In any case, it's good that at least some 2D operations are getting faster again....

Comments

This blog was originally open for comments when this entry was first posted, but was later closed and then removed due to spam and after a migration away from the original blog software. Unfortunately, it would have been a lot of work to reformat the comments to republish them. The author thanks everyone who posted comments and added to the discussion.