c# - 通用Windows平台下视频文件的帧率

标签 c# video metadata mediaelement win-universal-app

如何在 Windows 10 应用程序中访问视频文件的帧速率

enter image description here

我尝试了外部库,例如 MediaInfoNet ,或taglib用于读取元数据,但这些不能与 UWP 兼容(至少 nuget 告诉我这一点)。 此外,MediaElement 似乎相当进化,但没有 FPS 属性。

有什么选择吗?

最佳答案

毕竟这很容易。

 List<string> encodingPropertiesToRetrieve = new List<string>();
 encodingPropertiesToRetrieve.Add("System.Video.FrameRate");
 IDictionary<string, object> encodingProperties = await file.Properties.RetrievePropertiesAsync(encodingPropertiesToRetrieve);
 uint frameRateX1000 = (uint)encodingProperties["System.Video.FrameRate"];

哪里 文件Windows.Storage.StorageFile

帧速率乘以 1000。

有关 Metadata Properties for Media Files 的更多信息.

关于c# - 通用Windows平台下视频文件的帧率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31770082/

相关文章:

c# - 使用 c# 使用 youtube api 添加缩略图?

c++ - OpenCV 中的轮廓?

go - 向贡献者指定在 go 项目中使用的 go 版本

c# - 委托(delegate)指向具有不同签名的多个函数

c# - 未找到 MongoDB C# 驱动程序方法 MongoDB.Bson.Serialization.BsonSerializationInfo ByRef

c# - 适当的形式应用程序设计

mysql - 在 Doctrine 模式中,当我添加新字段时无法更新

c# - 如何从多个网站RSSFeeds

jquery - 使用 jQuery 通过按钮播放 Wistia 视频

SEO 元标记 NOOPD 和 NOODP。使用哪一个?