Record continuously 5min (x-minutes) of video with Microsoft Expression Encoder

615 Views Asked by At

My Software is to record continuously 5min of video. Example: the software should start the recording on program-start and hold continuously 5min of video in buffer. When I stop the recording the last 5min of recording should save to disk

private void CaptureMoni()
        {

            try
            {
                Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;
                _screenCaptureJob = new ScreenCaptureJob();
                _screenCaptureJob.CaptureRectangle = _screenRectangle;
                _screenCaptureJob.ShowFlashingBoundary = true;
                _screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
                _screenCaptureJob.CaptureMouseCursor = true;

                _screenCaptureJob.OutputScreenCaptureFileName = string.Format(@"C:\test.wmv");
                if (File.Exists(_screenCaptureJob.OutputScreenCaptureFileName))
                {
                    File.Delete(_screenCaptureJob.OutputScreenCaptureFileName);
                }
                _screenCaptureJob.Start();
            }
            catch(Exception e) { }
        }

something like that:

private void SaveRecord(int cntMinutes)
        {

            try
            {
                _screenCaptureJob.Stop();
                // something like that
                _screenCaptureJob.SaveLastXMinutes(cntMinutes);
            }
            catch(Exception e) { }
        }
0

There are 0 best solutions below