Skip to content
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

Unable to capture hardware accelerated windows #6

Open
ASleepyCat opened this issue Jul 10, 2022 · 6 comments
Open

Unable to capture hardware accelerated windows #6

ASleepyCat opened this issue Jul 10, 2022 · 6 comments
Labels
bug Something isn't working

Comments

@ASleepyCat
Copy link

ASleepyCat commented Jul 10, 2022

Using this image as a test, the program fails to recognise any of the text in the browser.

I checked what the screenshot comes out as, and it's a completely black image. The dimensions seem correct though.

OS Build is 22622.290 (22H2).

Edit: In mpv, the screenshots actually show something but they don't capture the window correctly. It instead shows my browser and a part of Windows Terminal that were beneath the window. It's extra weird since the tab that's showing was closed when the screenshot was taken, and I had also closed Terminal as well. At least the text recognition is working.

Edit 2: The screenshot appears to take what was underneath the window the moment the target program was opened, but it doesn't update what's displayed on the windows underneath, which explains my situation above. But sometimes it does take a correct screenshot, but it still doesn't show the updated window. Idk, I have no experience with Win32 APIs so my fiddling around hasn't really accomplished much.

@bquenin
Copy link
Owner

bquenin commented Jul 10, 2022

Ok thanks for the feedback. I haven't tested on windows 11 and it shows :) I'll look into it

@bquenin
Copy link
Owner

bquenin commented Jul 10, 2022

I'll add a debug flag to save the screenshots in order to see what's been captured.
@ASleepyCat if you're capturing your browser, did you try disabling the hardware acceleration? It might help even though it's not a fix

@bquenin
Copy link
Owner

bquenin commented Jul 10, 2022

@ASleepyCat I've added a debug mode. You can check the README for instructions.

@ASleepyCat
Copy link
Author

In Chrome Canary, disabling hardware acceleration makes the screenshots function correctly (and I assume it works the same in Edge).

@bquenin
Copy link
Owner

bquenin commented Jul 11, 2022

I will have to look into it. I've seen that there are other ways to capture screenshots on windows.

@bquenin
Copy link
Owner

bquenin commented Jul 11, 2022

The issues comes from the capture library so I've opened an issue there bquenin/captured#2

@bquenin bquenin changed the title Fails to recognise text on Windows 11 Unable to capture hardware accelerated windows Jul 11, 2022
@bquenin bquenin added the bug Something isn't working label Jul 11, 2022
@bquenin bquenin assigned bquenin and unassigned bquenin Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants