如何在Windows 10应用程序中访问视频文件的帧速率?
我尝试使用MediaInfoNet或taglib这样的外部库来读取元数据,但这些都不能与UWP兼容(至少nuget告诉我这个)。 MediaElement似乎也很发展,但没有FPS属性。
有没有选择?
答案 0 :(得分:1)
毕竟这很容易。
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
FrameRate乘以1000.