public void RecordScreen(RecorderParams recorderParams)
        {
            string videoPath       = recorderParams.FileName;
            var    recorderOptions = new RecorderOptions();

            recorderOptions.VideoOptions             = new VideoOptions();
            recorderOptions.VideoOptions.BitrateMode = BitrateControlMode.Quality;
            recorderOptions.VideoOptions.Quality     = recorderParams.Quality;
            _rec = Recorder.CreateRecorder(recorderOptions);

            //_rec.OnRecordingComplete += Rec_OnRecordingComplete;
            //_rec.OnRecordingFailed += Rec_OnRecordingFailed;
            // _rec.OnStatusChanged += Rec_OnStatusChanged;
            //Record to a file
            _rec.Record(videoPath);
        }
Exemplo n.º 2
0
        public void RecordScreen(RecorderParams recorderParams)
        {
            Params = recorderParams;
            writer = Params.CreateAviWriter();

            // Create video stream
            videoStream = Params.CreateVideoStream(writer);
            // Set only name. Other properties were when creating stream,
            // either explicitly by arguments or implicitly by the encoder used
            videoStream.Name = "Captura";

            screenThread = new Thread(_recordScreen)
            {
                Name         = typeof(ScreenRecorderHelper).Name + ".RecordScreen",
                IsBackground = true
            };

            screenThread.Start();
        }