interpreter icon indicating copy to clipboard operation
interpreter copied to clipboard

Unable to capture hardware accelerated windows

Open ASleepyCat opened this issue 2 years ago • 6 comments

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.

ASleepyCat avatar Jul 10 '22 07:07 ASleepyCat

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

bquenin avatar Jul 10 '22 16:07 bquenin

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 avatar Jul 10 '22 18:07 bquenin

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

bquenin avatar Jul 10 '22 19:07 bquenin

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

ASleepyCat avatar Jul 11 '22 08:07 ASleepyCat

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

bquenin avatar Jul 11 '22 16:07 bquenin

The issues comes from the capture library so I've opened an issue there https://github.com/bquenin/captured/issues/2

bquenin avatar Jul 11 '22 17:07 bquenin