Changing the resolution results in "frozen" screenshots - D3D doesn't update to current screen #6
Comments
I think you will have issues with most screen capturing solutions, especially those that are closer to the metal and try to be efficient with resources when changing resolution once the context has been created. The problem here is that by changing the resolution of a display, you invalidate the DXGI Output handle that has been acquired by D3DShot to capture stuff on that display. The handle is still valid for the desktop duplication API to use, but it's effectively a "zombie" display at that point and no new information can be returned (which you observed). The resolution-changed display effectively lives on as a new DXGI Output that you would have to detect and swap to seamlessly. This is not easy at all; not even sure it's possible. Unfortunately, I don't think this is a reasonable issue to try and tackle. Did you accidentally stumble upon the behavior or is it part of your use case to change resolutions while capturing? Just curious. |
I accidentally stumbled upon it. I expected it to be an issue with Desktop
Duplication.
My main reason for posting the issue was to provide documentation for it so
others wouldn't need to waste 3 days like I did :).
…On Tue, Aug 13, 2019, 12:01 PM Nicholas Brochu ***@***.***> wrote:
I think you will have issues with most screen capturing solutions,
especially those that are closer to the metal and try to be efficient with
resources when changing resolution once the context has been created.
The problem here is that by changing the resolution of a display, you
invalidate the DXGI Output handle that has been acquired by D3DShot to
capture stuff on that display. The handle is still valid for the desktop
duplication API to use, but it's effectively a "zombie" display at that
point and no new information can be returned (which you observed). The
resolution-changed display effectively lives on as a new DXGI Output that
you would have to detect and swap to seamlessly. This is not easy at all;
not even sure it's possible.
Unfortunately, I don't think this is a reasonable issue to try and tackle.
Did you accidentally stumble upon the behavior or is it part of your use
case to change resolutions while capturing? Just curious.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6?email_source=notifications&email_token=AB4TUMLOJ2BQXLTOU6JVVADQELSH3A5CNFSM4IJKRMYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4GJYHI#issuecomment-520920093>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB4TUMITEUFVMVRBCIM7TVTQELSH3ANCNFSM4IJKRMYA>
.
|
I'll close this one. It'll remain searchable to help people stumbling upon a similar situation. |
When I change the resolution of my laptop after running my Python code with D3DShot,
screenshot_to_disk_every()
stops returning the current screen and instead returns the screen before resolution change. I don't know if this is an issue with Window's Desktop Duplication or this library.My code:
This issue occurs even with using other screenshot functions.
The text was updated successfully, but these errors were encountered: