I'm trying to find the number of frames in a video I've just opened, without decoding all the frames.
I open with AVAsset
and then get an AVAssetTrack
for the video. What next ?
You could do this:
float durationInSeconds = CMTimeGetSeconds(asset.duration);
float framesPerSecond = assetTrack.nominalFrameRate;
float numberOfFrames = durationInSeconds * framesPerSecond;
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