使用 Microsoft Expression Encoder 连续录制 5 分钟(x 分钟)的视频
我的软件是连续录制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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论