BitBlt performance with Aero enabled
Asked Answered
B

2

9

I'd like to get more performance out of BitBlt for capturing the screen. When Aero remains enabled, capturing only a 400x400 pixel area of the screen reduces capture time from an average of 50ms (full 1920x1200) to about 33ms (for 400x400) on my machine. This is a disappointingly low improvement.

Is my only option disabling Aero? I do know that i can get a blinding fast 3ms capture on the full screen when Aero is disabled.

Bub answered 22/8, 2011 at 22:56 Comment(0)
V
13

A screen capture in Aero mode is very expensive because it requires synchronization with the DWM (think about waiting for everyone not blink their eyes to take a group photo), and locking the entire GPU pipe on Vista. On Windows 7 GDI performance is improved by accelerate common GDI operations and reduce GDI locking)

There are attempts of either using undocumented DWM functions or hooks to get the shared surface used by DWM. But you still need to pay the price to move data from video memory to system RAM via the sometimes slow FSB if you plan to process the image data (e.g. send to a network or save to file).

Viniculture answered 23/8, 2011 at 1:35 Comment(1)
Do you know if it is possible to access the shared surface to do operations on the GPU with it (shaders)? Or is BitBlt basically the fastest way to get this data?Bub
C
1

disable aero for now I guess. I can't seem to get really above 15 fps out of it, presumably because it's locking on 30 fps boundaries, and I can't "get in" to get a frame until after the next boundary starts, and then have to wait for the whole time to elapse.

Cabdriver answered 16/4, 2012 at 18:51 Comment(2)
Looks like a lot of screen capture apps on windows use this API to get their job done. I agree it seems like a video capture card is necessary to reliably get above 15 or so fps.Bub
windows 8 provides a "new api" (not BitBlt) that is said to be performant. that may be an option...Cabdriver

© 2022 - 2024 — McMap. All rights reserved.