sskodje / ScreenRecorderLib

A .NET library for screen recording in Windows, using native Microsoft Media Foundation for realtime encoding to h264 video or PNG images.
MIT License
414 stars 94 forks source link

App crash on unhandled exception if a second display is connected during screen recording #225

Closed ranwer-dev closed 1 year ago

ranwer-dev commented 1 year ago

I was recording my screen on the external monitor when I opened the lid of my laptop, app threw this warning

File: ScreenRecorderLibNative\WindowsGraphicsCapture.util.h
Function: CreateCaptureItemForMonitor
Exception thrown at 0x00007FFE9FDE06BC in ScreenCapture.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0000005CE11FE5B0.

Just want to add my external monitor is the main display.

sskodje commented 1 year ago

I reproduced this on a laptop with Intel graphics and hardware encoding enabled using Desktop Duplication api, is this your case also?