c# - Windows 运行时 API : MediaCapture how to limit recording file size

标签 c# windows video-capture

对于 Windows.Media.Capture.MediaCapture,我们能否指定一个大小限制以便触发此事件 (RecordLimitationExceededEventHandler) 并停止录制?

如果不是,监控文件大小的正确方法是什么。

谢谢!

最佳答案

来自 MSDN :

If an app receives a RecordLimitationExceeded event, it is expected to finalize the file it is recording. If it does not finalize, the capture engine will stop sending samples to the file that the app was recording to.

In Windows 8, the current record limit is three hours.

所以平台会为你发起这个事件。

如果您对限制文件大小感兴趣,FileSystemWatcher MSDN page 上有一个很好的示例了解如何监视对文件的更改。查找 Changed 事件,并检查 ChangeType 参数。

关于c# - Windows 运行时 API : MediaCapture how to limit recording file size,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29982153/

相关文章:

windows - 在后台运行批处理文件

c++ - 如何在windows中安装VOGLE图形库

opencv - 视频文件打不开?(opencv 3.1.0 windows)

youtube - 从 YouTube 直播中捕获当前图像

c# - 遍历 View 中的 View 模型属性

c# - 开放通用类型不会在目录中注册

C# .Net Core 利用 DbSet<TEntity>.FromSql 在基本 Controller 类中利用通用属性

从位图和透明度颜色创建蒙版 - Windows GDI

c# - 接收方无法验证签名的 XML 消息

c# - 使用 Accord.net (AForge) 录制视频