如何在 Windows 10 应用程序中访问视频文件的帧速率?
我尝试了外部库,例如 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/