Open leumasme opened 3 months ago
From looking at _nvspcaps64.dll
strings, the log message for DRM content should be
CaptureSession::LogProtectedContentAppDetails : Protected content is played through secure channel eg. netflix in browser
Impressive work, I'll look into it!
I did some research on why Shadowplay even turns off when viewing some content, in an effort to figure out if this could be circumvented. Shadowplay internally uses
NvFBC
(which is part of the Nvidia Capture SDK) to capture frames. NVIDIA Capture SDK Programming Guide.pdf Because of how NvFBC works, it would presumably be able to capture content that normally is not recordableWDA_EXCLUDEFROMCAPTURE
orMONITOR
flag, see SetWindowDisplayAffinityNvFBC will detect such "Protected Content" and refuse to capture frames if any is present, returning a
NVFBC_ERROR_PROTECTED_CONTENT
error.Logs about this happening can be found in
C:\ProgramData\NVIDIA Corporation\ShadowPlay\CaptureCore.log
, where ShadowPlay will log the Errors that NvFBC is returningExerpt from CaptureCore.log
```log CVideoCaptureFbc::CaptureFrame: CVideoFrameProvider::CaptureFrame failed 0XA CVideoCapture::Process: CaptureFrame failed 0XFFFFFFFC CVideoCapture::NvFBCH264GrabFrame: nvfbc grab frame failed CVideoCapture::Capture: NvFBCH264GrabFrame failed with error = NVFBC_ERROR_PROTECTED_CONTENT CCaptureCore::OnError: dwErrorType[121], uiErrorContext[0], hr[0X80004005], m_CaptureCoreCallback[0XAC97E7D2] CCaptureSession::HandleCapCoreCB: CAPCORE_CBTYPE_ERROR CCaptureSession::HandleErrorCB: error(0x00000079) CCaptureSession::HandleError: uiErrorType[121], uiSubType[0], hr[0X80004005] CCaptureSession::LogProtectedContentAppDetails: Protected Content is running by PID: 6060 App: CCaptureSession::IsDVRDisableRequired YES : err(121:0) hr(0X80004005) CCaptureSession::StopDVRCapture: IN CircularBufferManager::Release: 0 CVideoCaptureFbc::CaptureFrame: CVideoFrameProvider::CaptureFrame failed 0XA CVideoCapture::Process: CaptureFrame failed 0XFFFFFFFC CVideoCapture::NvFBCH264GrabFrame: nvfbc grab frame failed CVideoCapture::Capture: NvFBCH264GrabFrame failed with error = NVFBC_ERROR_PROTECTED_CONTENT ```Note that this is also logging which PID contains the protected content
This means that it should be possible to detect the application that is blocking ShadowPlay, notify the user about it (of course resolve PID to something more readable first), and automatically whitelist it (optional). As a simple approach, this could be done by monitoring the logfile for log messages of the right format and parsing them.
Related references:
C:\Program Files (x86)\NVIDIA Corporation\NvNode\NvShadowPlayAPI.js
into the first line of the functionEmitNotification
add this:if (data && data.windowMsg == "showHotkeyMessage") return