SerpentAI / D3DShot

Extremely fast and robust screen capture on Windows with the Desktop Duplication API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The display will flash quickly for a while after calling d3dshot.create(), and also when exiting the program.

BruceLee569 opened this issue · comments

I don't know when this phenomenon started. It didn't appear when I first used the d3dshot package. It was very strange, and it did not improve after restarting the computer.

bug_video

System version: Windows10 1909
Python version: 3.7.6
d3dshot version: 0.1.5

Through debugging, I located the function where this phenomenon occurred in dxgi_output.DuplicaeOutput, and the display screen will flicker once every time the function is executed.

d3dshot_bug

I just tested another monitor, the model is aoc Q27P1B, it does not support the Monitor Control Command Set / DDC/CI protocol , and this problem does not occur in it.

The monitor with the bug (aoc U2790B, which supports the Monitor Control Command Set) uses the same computer hardware, the cpu is i5-8600k, and the graphics card is RTX 2070. The graphics card has two DP ports and one HDMI port. I usually plug them in at the same time to use dual-screen displays(Q27P1B use HDMI and U2790B use DP). When using d3dshot at the same time, only U2790B will experience screen flickering.

Then I tried reinstall d3dshot throgh pip, the problem still exists, is there anyone who can help me, I am grateful!

Hi @BruceLee569,

I am trying to get your error on 2 differents machines and nothing happened about your problem.
Both of them have Python 3.8.5 and d3dshot 0.1.5.
First one is an MSI GS60 2QE Ghosht (i7-4k; GTX-970M). The second one is an pc-based (i7-6k; GTX-980 Ti).
I am not familiar with the MCCS and I do not know if your problem comes from that.

I saw on the shared video that the flicker happened on call and release. Is your desktops have the same size definition (1920x1080, or ?). From my point of view, it is more a problem of a region definition pointer who a initialized, released.

Hi @BruceLee569,

I am trying to get your error on 2 differents machines and nothing happened about your problem.
Both of them have Python 3.8.5 and d3dshot 0.1.5.
First one is an MSI GS60 2QE Ghosht (i7-4k; GTX-970M). The second one is an pc-based (i7-6k; GTX-980 Ti).
I am not familiar with the MCCS and I do not know if your problem comes from that.

I saw on the shared video that the flicker happened on call and release. Is your desktops have the same size definition (1920x1080, or ?). From my point of view, it is more a problem of a region definition pointer who a initialized, released.

You are awesome, it is really a resolution problem, because the resolution of the main monitor (the one with the problem) is 4K (3840x2160), and the second monitor is 2K (2560x1440),
In order to unify it, and I think the screenshots are taken too many pixels should be slower, so I set the resolution of the main monitor to 2560x1440, so the splash screen problem occurred. After I changed the resolution back, the problem has disappeared.

Just now I wanted to test the secondary monitor and change its resolution to 1920x1080, but the result of the d3dshot screenshot only returned the image of the primary monitor. I wonder if there is a way to capture the two monitors? Thank you again and again for your beautiful answers!☺

You are awesome, it is really a resolution problem, because the resolution of the main monitor (the one with the problem) is 4K (3840x2160), and the second monitor is 2K (2560x1440),
In order to unify it, and I think the screenshots are taken too many pixels should be slower, so I set the resolution of the main monitor to 2560x1440, so the splash screen problem occurred. After I changed the resolution back, the problem has disappeared.

I was thinking the reverse :s. The harmonization of screen display change remove the flicker.
Have you trying to set display before screenshot ?

d = d3dshot.create()
d.display = d.displays[x]  #where x is the display you want to caputre.

You are awesome, it is really a resolution problem, because the resolution of the main monitor (the one with the problem) is 4K (3840x2160), and the second monitor is 2K (2560x1440),
In order to unify it, and I think the screenshots are taken too many pixels should be slower, so I set the resolution of the main monitor to 2560x1440, so the splash screen problem occurred. After I changed the resolution back, the problem has disappeared.

I was thinking the reverse :s. The harmonization of screen display change remove the flicker.
Have you trying to set display before screenshot ?

d = d3dshot.create()
d.display = d.displays[x]  #where x is the display you want to caputre.

After the test, the 2K display has no flicker problem, even if its resolution is changed to 1080P. as long as the main display is not 4K, flicker will occur, will it be a problem with the physical display.

Ok, I just try something with the resolution and I can get your issue :-).

**Test 1 : Flicker happen** 
Screen display 1 : 1600x1024 => on this screen only
Screen display 2 : 1920x1080
**Test 2 : Flicker not happen**
Screen display 1 : 1920x1080
Screen display 2 : 3840x2160
**test 3 : Flicker happen**
Screen display 1 : 1600x1024 => on this screen only
Screen display 2 : 3840x2160

So the issue is more screen display resolution problem. I do not know if it is a problem from the physical display or with the dxgi-d3d11 stack implementation from d3dshot or simply a "limitation" in the d3d11.
d3dshot currently at the dxgi1_2 and I do not know if the dxgi1_5 can resolve this type of issue.

Ok, I just try something with the resolution and I can get your issue :-).

**Test 1 : Flicker happen** 
Screen display 1 : 1600x1024 => on this screen only
Screen display 2 : 1920x1080
**Test 2 : Flicker not happen**
Screen display 1 : 1920x1080
Screen display 2 : 3840x2160
**test 3 : Flicker happen**
Screen display 1 : 1600x1024 => on this screen only
Screen display 2 : 3840x2160

So the issue is more screen display resolution problem. I do not know if it is a problem from the physical display or with the dxgi-d3d11 stack implementation from d3dshot or simply a "limitation" in the d3d11.
d3dshot currently at the dxgi1_2 and I do not know if the dxgi1_5 can resolve this type of issue.

Is this the result of the monitor you tested? So far, my test result is that only this 4K monitor will have Flicker, unless its resolution is set to the original 4K; the other 2K monitor will not have Flicker problems no matter how to modify the resolution.

So what is suspicious now is the physical display's problem, but the problem is that I don’t have another monitor yet, modify its initial resolution to view the test results. Fortunately, other people can also see this issue, and they can give feedback on the testing status of their displays after modify resolution.

Yes, this is the result of my monitor I tested. I do another test where I can say that :

  • The flicker appears only on the you are the main screen definied in the windows parameters.
  • On my side, the flicker appears when the resolution is under 1920x1080 (who is the recommended resolution by Windows).

I am really not sure that the problem comes from the physical display. I think it is more about how the DXGI - D3D11 is implemented. If we look at the DXGI Best Practices (MSDN), and the implementation in c/c++, in case of multi-monitor a swapchain is used.

Yes, this is the result of my monitor I tested. I do another test where I can say that :

  • The flicker appears only on the you are the main screen definied in the windows parameters.
  • On my side, the flicker appears when the resolution is under 1920x1080 (who is the recommended resolution by Windows).

I am really not sure that the problem comes from the physical display. I think it is more about how the DXGI - D3D11 is implemented. If we look at the DXGI Best Practices (MSDN), and the implementation in c/c++, in case of multi-monitor a swapchain is used.

Since fliker appears on your monitor, it should be a software problem.

In the field of GUI, the modification of resolution and percentage scaling of Windows system will always cause various situations and problems, which will affect the actual display of the software. This situation is no surprise to me 😂

Still looking forward to the problem being solved, come on 💪