Skip to content

Offer more Capture Methods #134

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Avasam opened this issue Dec 15, 2021 · 4 comments
Closed

Offer more Capture Methods #134

Avasam opened this issue Dec 15, 2021 · 4 comments
Labels
enhancement New feature or enhancement request Included in next release

Comments

@Avasam
Copy link
Collaborator

Avasam commented Dec 15, 2021

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

@pyorot
Copy link

pyorot commented Feb 3, 2022

idk if this has been considered anywhere but ingesting from OBS virtual cam would be a good option to avoid having to run windowed projectors and screen capture at all

@Avasam
Copy link
Collaborator Author

Avasam commented Feb 3, 2022

idk if this has been considered anywhere but ingesting from OBS virtual cam would be a good option to avoid having to run windowed projectors and screen capture at all

Absolutely. It's something I'd like as well. I find it cumbersome to use projectors. I take directly from OBS preview, but sometimes it moves around when OBS opens and I have to re-align.

@Avasam
Copy link
Collaborator Author

Avasam commented Apr 9, 2022

@pyrobot

If you go to https://github.com/Toufool/Auto-Split/actions/workflows/lint-and-build.yml?query=branch%3Acamera-capture-split-cam-option , click on the latest workflow run, then scroll down to "Artefacts". You'll be able to try out this feature (work in progress)

@Avasam Avasam added enhancement New feature or enhancement request Included in next release labels Apr 21, 2023
@Avasam
Copy link
Collaborator Author

Avasam commented Apr 22, 2023

Closed by #211

@Avasam Avasam closed this as completed Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement request Included in next release
Projects
None yet
Development

No branches or pull requests

2 participants