简体   繁体   中英

Frame rate of video file in universal windows platform

How can I access frame rate of video file in Windows 10 application?

在此处输入图片说明

I tried external libraries like MediaInfoNet , or taglib for reading metadata, but these are not compactible with UWP (at least nuget is telling me this). Also MediaElement seems pretty evolved, but has no FPS property.

Is there any option?

After all it is easy.

 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"];

Where file is Windows.Storage.StorageFile

FrameRate is multiply by 1000.

More info about Metadata Properties for Media Files .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM