-
-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Currently we have BitBlt
and BitBlt + PrintWindow
. I can see up to 4 possibilities that can be useful to users:
-
Desktop Duplication API through Direct3D
Fastest, but cannot record overlapping windows. About 3x faster than BitBlt and does not encounter some of the same issues according tod3dshot
. Is also what they use. (See: Capturing window rather than desktop? SerpentAI/D3DShot#7 (comment) ) -
BitBlt
Fast. Allows recording background windows (as long as they still decide to render in background).
Is whatmss
uses I believe. We already have our own implementation, but I'd like to compare performances.
In my (Avasam's) experience, it cannot properly record Hardware accelerated windows, Dolphin, etc. (fixed by PrintWindow)
bitblt also has important problems (for [nbrochu's] use case, at least) with some graphics APIs. For example, you can't give it the handle of a window that uses OpenGL or you can't capture exclusive full screen applications, these will all fail to capture.
-
BitBlt + PrintWindow (aka Force Full Content Rendering)
Extremely slow. 10-15x slower than BitBlt based on window size. Can mess up some applications' rendering pipelines. Our current fallback from BitBlt. -
Windows Graphics Capture API
Is only available in recent windows updates. Allows recording UWP apps. Adds a yellow border around the recorded window. Performance unknown (better than PrintWindow that's for sure). Might solve all of BitBlt issues. Is considered byd3dshot
(Investigate WindowsGraphicsCapture API SerpentAI/D3DShot#22)
More info here:
Windows Graphics Capture: https://blogs.windows.com/windowsdeveloper/2019/09/16/new-ways-to-do-screen-capture/
winrt: https://pypi.org/project/winrt/
from winrt.windows.graphics.capture import *
Windows.Graphics.Capture: https://docs.microsoft.com/en-us/uwp/api/windows.graphics.capture
Note that d3dshot is only available for Windows 8.1+. But Windows 7 is in EOL and windows 8 is a garbage fire. We can always detect user's windows version and offer Capture methods based on that anyway. For example, Windows Graphics Capture
may obsolete PrintWindow
.
We could show the user a dropdown as such:
- Windows Graphics Capture (speed?, most compatible, recommended?)
- BitBlt (fast, least compatible, recommended )
- Direct3D Desktop Duplication (fastest?, no overlapping window)
- Force Full Content Rendering (slowest, only use if nothing else works for you)
And explain the differences in detail in a tooltip. Example tooltip from Dolphin.