public ScreenRecorder(ScreenRecordOutput outputType, ScreencastOptions options, Rectangle captureRectangle) { if (string.IsNullOrEmpty(options.OutputPath)) { throw new Exception("Screen recorder cache path is empty."); } FPS = outputType == ScreenRecordOutput.GIF ? options.GIFFPS : options.ScreenRecordFPS; DurationSeconds = options.Duration; CaptureRectangle = captureRectangle; CachePath = options.OutputPath; OutputType = outputType; Options = options; switch (OutputType) { default: case ScreenRecordOutput.FFmpeg: ffmpegCli = new FFmpegHelper(Options); break; case ScreenRecordOutput.GIF: imgCache = new HardDiskCache(Options); break; } }