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

All Monitor Recording Not Working #295

Closed kasirajansfm closed 6 months ago

kasirajansfm commented 6 months ago

SourceOptions = new SourceOptions { RecordingSources = { new DisplayRecordingSource { DeviceName = DisplayRecordingSource.MainMonitor.DeviceName,RecorderApi = RecorderApi.WindowsGraphicsCapture } } },

After changed RecorderApi.WindowsGraphicsCapture, still records first screen only. any one faced this issue,?

sskodje commented 6 months ago

Your code is only recording the main monitor. If you want to record all monitors:

            var sources = new List<RecordingSourceBase>();
            //You can all system monitors with the static Recorder.GetDisplays() function.
            sources.AddRange(Recorder.GetDisplays());
kasirajansfm commented 6 months ago

Thanks for the response. Its working fine.