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

VB.net nothing from capturing Windows #229

Closed nico579 closed 1 year ago

nico579 commented 1 year ago

Hello,

I am using VB.net and want to record from a Window. Here is my code :

Dim _re As Recorder Dim so As New SourceOptions Dim rs As New List(Of RecordingSourceBase) Dim ro As New RecorderOptions Dim rw = Recorder.GetWindows()

rs.Add(rw.FirstOrDefault()) so.RecordingSources = rs ro.SourceOptions = so _re = Recorder.CreateRecorder(ro) _re.Record("c:\aa.mp4")

No error, but no file is created !

have an explain ?

Thanks a lot

sskodje commented 1 year ago

You can subscribe to the OnRecordingFailed event to see the error. But i can guess that you need to run your application with administrator prvileges to write to c:\ root. Or write to a path in the Users directory instead.

nico579 commented 1 year ago

Thanks a lot !!! The error was : "Windows Graphics Capture requires Windows 10 version 1903 or greater." !!! It is OK with monitor, but failed with Windows ... Your library is very nice !!!