I have seen some examples of CMTime (Three separate links), but I still don't get it. I'm using an AVCaptureSession with AVCaptureVideoDataOutput and I want to set the max and min frame rate of the the output. My problem is I just don't understand the CMTime struct.
Apparently CMTimeMake(value, timeScale) should give me value frames every 1/timeScale seconds for a total of value/timeScale seconds, or am I getting that wrong?
Why isn't this documented anywhere in order to explain what this does?
If it does truly work like that, how would I get it to have an indefinite number of frames?
If its really simple, I'm sorry, but nothing has clicked just yet.
A
CMTime
struct represents a length of time that is stored as rational number (see CMTime Reference).CMTime
has avalue
and atimescale
field, and represents the timevalue/timescale seconds
.CMTimeMake
is a function that returns aCMTime
structure, for example:The last two time values
t3
andt4
represent the same time value, thereforeIf you set the
videoMinFrameDuration
of aAVCaptureSession
is does not make a difference if you setIn both cases the minimum time interval between frames is set to 1/20 = 0.05 seconds.