§ ¶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
Comments posted:
I keep reading phenomenal reviews of Direct2D in terms of its efficient operation but very little about actually using it. I would love to hear your thoughts on it if you ever experiment using the API. I unfortunately do not have access to Vista or Windows 7 in order to play with it.
George (link) - 09 12 09 - 14:49
Maybe you just use new graphics card or update video drivers?
AFAIK BitBlt operation perform at adapter side and speed is relate from driver.
kesar - 09 12 09 - 21:47
Have you tried using DXVA (DXVA2) interfaces for such purposes ? It works much faster.
jakor - 10 12 09 - 17:23
Windows 7 use Direct3D on all screen operation, even on BitBlt and GDI. That why it is much faster than XP. Also it use single buffer for all open windows, unlike Vista (that eat more memory).
Please read
http://blogs.msdn.com/e7/archive/2009/04..
Also
http://msdn.microsoft.com/en-us/library/.. - "The GDI Hardware Acceleration feature introduced with Windows 7 provides accelerated core graphics device interface (GDI) operations on a graphics processing unit (GPU)."
djonline - 16 12 09 - 18:25
Would it be possible for you to provide a solution to this
http://stackoverflow.com/questions/21544..
Thanks.
binarybug - 11 02 10 - 21:34
Screen Caputure doesn't work for me in Windows 7 - as soon as I select "Screen Capture" in the Device menu, it freezes the app. I have to go into the registry and clear "Startup Driver" to get access again to capture from another device (like a webcam). Tried the 32 and 64 bit versions - have no idea what's wrong.
jonesy - 25 04 10 - 19:03
I figured it out! It looks like the newest versions of VirtualDub don't install anything in the "VirtualDub\Capture\Screen Capture" paths in the registry - there were no settings. I copied over some from my last computer and presto it worked.
I
jonesy - 25 04 10 - 19:30
love vdub
jonesy - 25 04 10 - 19:30
On Vista it is actually even slower:
http://blogs.msdn.com/b/greg_schechter/a..Yuhong Bao (link) - 16 10 11 - 06:59
Out of curiosity, do you know of any other screen capture filters/programs that use the OpenGL front buffer method to capture the screen?
Shizuka - 17 10 11 - 16:32
Comment form
Please keep comments on-topic for this entry. If you have unrelated comments about VirtualDub, the forum is a better place to post them.