iOS get video frame rate

vodkhang picture vodkhang · May 11, 2012 · Viewed 7.5k times · Source

I want to get the frame rate for a specific video. I tried to look at APIs in the AVFoundation and AssetsLibrary like AVURLAsset or AVAssetReader. None of them are really helpful. Does anybody know a method in the Apple's frameworks/library to get the frame rate

Answer

Oleg picture Oleg · Jun 21, 2012

The easier option is to obtain an AVAssetTrack and read its nominalFrameRate property. Looks like this can help you.

Nominal frame rate is the frame rate of the track, in frames per second. (read-only) AVAssetTrack Class @property(nonatomic, readonly) float nominalFrameRate