public ScreenRecorder(ScreencastOptions options, Rectangle captureRectangle, ScreenRecordOutput outputType) { 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) { case ScreenRecordOutput.AVI: imgCache = new AVICache(Options); break; case ScreenRecordOutput.FFmpeg: ffMpegCli = new FFmpegHelper(Options); break; case ScreenRecordOutput.GIF: imgCache = new HardDiskCache(Options); break; } }