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
408 stars 93 forks source link

Snapshot interval doesn't work #237

Closed ranwer-dev closed 1 year ago

ranwer-dev commented 1 year ago

I am using following code to take snapshots, 10 per second. But it takes 1 per second. Even if reduce interval it still takes only one snapshot per second. Am I missing something?

Also is it possible that if I want to only get snapshots, library skips encoding/saving video?

RecorderOptions.SnapshotOptions.SnapshotsWithVideo = true;
RecorderOptions.SnapshotOptions.SnapshotFormat = ImageFormat.PNG;
RecorderOptions.SnapshotOptions.SnapshotsIntervalMillis = 100;
sskodje commented 1 year ago

SnapshotsWithVideo is limited to once per second. If you want to only save the pictures and no video, change RecorderMode in OutputOptions to Slideshow. The SnapshotOptions will still work for these pictures. Using jpeg instead of png will also give better performance.