question

RangeshGupta-6867 avatar image
0 Votes"
RangeshGupta-6867 asked RangeshGupta-6867 edited

Desktop Duplication API skip frame issue and slowness issue

Setup Details: Windows 2016, NVIDIA Quadro P4000, Driver Version: 465.89 , CUDA Version: 11.3.

We are trying below example where it captures windows screen using DDA, do h264 encoding using nvenc and output to a video file.

https://github.com/NVIDIA/video-sdk-samples/tree/master/nvEncDXGIOutputDuplicationSample

Issue 1:

While recording the video I have a timer on the screen, After screen recording if we watch the video, there is skip of frames. Time jumps from 10.21.53 to 10.22.07.



Issue 2:

While calling AcquireNextFrame with wait time 5 milliseconds, sometime I observer higher accumulated frame.


“frameNo: 108 | Accumulated: 68 | PTS: 8007481246593 | PTSInterval: 13918215000”

Issue 3:

Even with AcquireNextFrame with wait time 5 milliseconds, some time it take more than a second to come out of the function AcquireNextFrame



Any help is this area will be helpful.

remote-desktop-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RangeshGupta-6867 avatar image
0 Votes"
RangeshGupta-6867 answered RangeshGupta-6867 edited

Able to solve the issue. While encoding it was doing MotionEstimation, after removing it, skip frame issue is resolved.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered RangeshGupta-6867 commented

Hello @RangeshGupta-6867 ,

Thanks for your query.

1.Is there any error message in the event log?

2.Please refer to the following post for troubleshooting:
(1) DirectX Screen Capture - Desktop Duplication API - limited frame rate of AcquireNextFrame: https://stackoverflow.com/questions/44403173/directx-screen-capture-desktop-duplication-api-limited-frame-rate-of-acquire

(2) Desktop Duplication API by design accumulates monitor ("output" in DXGI terms) updates until you request them via AcquireNextFrame. The API is not designed to capture every update in first place. Calling ReleaseFrame earlier or later affects internal behavior of the API. It is either accumulating updates in general or also keeps replicating the actual payload data into duplicated frame resources.
DXGI Desktop Duplication Screen Capture Speed: https://stackoverflow.com/questions/48278207/dxgi-desktop-duplication-screen-capture-speed


Best regards,
Leila


If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @LeilaKong-MSFT,

Thanks for the reply!

I checked the event logs, there is no related error.

Also the second post which suggest to call AcquireNextFrame just after the ReleaseFrame, thats exactly what we are doing.

0 Votes 0 ·
LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered

Hello @RangeshGupta-6867 ,

Just checking in to see if the information provided was helpful.
If you would like further assistance do let us know.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered

Hello @RangeshGupta-6867 ,

Thanks for your response.

From below picture we can see that NVIDIA Quadro P4000 doesn't support Windows server 2016, which may cause some problem.
https://www.nvidia.cn/Download/index.aspx?lang=cn

113686-nvidia-%E9%A9%B1%E5%8A%A8%E7%A8%8B%E5%BA%8F%E4%B8%8B%E8%BD%BD.png


Please consult the manufacturer of NVIDIA Quadro P4000. If the manufacturer cannot give a reply, we sincerely recommend that you open a premier case to Microsoft for further help: https://hubstaticsite.z5.web.core.windows.net/
http://www.microsoft.com/en-us/microsoftservices/support.aspx


Please "Accept as Answer" if it helped, which might be beneficial to other community members reading this thread. Thanks for your cooperation!


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RangeshGupta-6867 avatar image
0 Votes"
RangeshGupta-6867 answered

Hello @LeilaKong-MSFT,

Windows 2016 is supported, if you click on Show all operating system you can see windows 2016 option.

113619-image.png



image.png (223.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered

Hello @RangeshGupta-6867 ,

Please try to update the Driver Version from 465.89 to 471.11 and check if the problem still persists:
113668-r470-u1-47111.png


https://www.nvidia.cn/Download/driverResults.aspx/176986/us


r470-u1-47111.png (130.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LeilaKong-MSFT avatar image
0 Votes"
LeilaKong-MSFT answered

Hello @RangeshGupta-6867 ,

Just checking in to see if the information provided was helpful.

Please "Accept as Answer" if it helped, which might be beneficial to other community members reading this thread. Thanks for your cooperation!

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.