I work with AvFoundation. I need to measure accurately frame rate from ios camera.
Frame rate =
You need to call
Something like this (in swift, a little awkward because I couldn't find a
let delta = CMTimeSubtract(CMSampleBufferGetPresentationTimeStamp(buf2), CMSampleBufferGetPresentationTimeStamp(buf1)) // awkward 1/x, beware that delta.value may overflow as a timescale // what's the right way? let frameRate = CMTime(value: CMTimeValue(delta.timescale), timescale: CMTimeScale(delta.value)) // maybe you want floating point instead of CMTime: let frameRateAsFloat64 = CMTimeGetSeconds(frameRate)