Skip to content

Offer more Capture Methods #134

@Avasam

Description

@Avasam

Currently we have BitBlt and BitBlt + PrintWindow. I can see up to 4 possibilities that can be useful to users:

  1. 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 to d3dshot. Is also what they use. (See: Capturing window rather than desktop? SerpentAI/D3DShot#7 (comment) )

  2. BitBlt
    Fast. Allows recording background windows (as long as they still decide to render in background).
    Is what mss 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.

  1. 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.

  2. 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 by d3dshot (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.
image

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions