How to get FPS of video in iOS SDK. I have tried below line of code but it does not seems perfect to me.
AVAssetTrack *videoAssetTrack = [myAsset tracksWithMediaType:AVMediaTypeVideo].firstObject;
NSLog(@"FPS is : %f ",videoAssetTrack.nominalFrameRate);
Any help will be appreciated.
I got correct FPS with below line of code :
AVAsset * myAsset = [[AVURLAsset alloc] initWithURL: _videoUrl options: nil];
AVAssetTrack * videoAssetTrack = [myAsset tracksWithMediaType: AVMediaTypeVideo].firstObject;
NSLog(@"FPS is : %f ", videoAssetTrack.nominalFrameRate);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With