使用 Microsoft Expression Encoder 连续录制 5 分钟(x 分钟)的视频

发布于 2024-11-18 23:27:23 字数 1305 浏览 3 评论 0原文

我的软件是连续录制5分钟的视频。 示例:软件应在程序启动时开始录制,并在缓冲区中连续保存 5 分钟的视频。当我停止录制时,最后 5 分钟的录制内容应保存到磁盘,

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) { }
        }

如下所示:

private void SaveRecord(int cntMinutes)
        {

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

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) { }
        }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文