public Recorder(RecorderParams Params) { this.Params = Params ?? throw new ArgumentNullException(nameof(Params), "Params was null."); vs = new VideoSaver(Params); screenThread = new Thread(RecordScreen) { Name = typeof(Recorder).Name + ".RecordScreen", IsBackground = true }; screenThread.Start(); }
public VideoSaver(RecorderParams Params) { this.Params = Params; switch (Params.fileFormat) { case FileFormat.GIF: var frameInterval = TimeSpan.FromSeconds(1 / (double)Params.FramesPerSecond); gif = AnimatedGif.AnimatedGif.Create(Params.FileName, frameInterval.Milliseconds, 1); break; case FileFormat.WEBM: vFWriter = new VideoFileWriter(); vFWriter.Open(Params.FileName, Params.Width, Params.Height, Params.FramesPerSecond); break; } }