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
CMTimestruct represents a length of time that is stored as rational number (see CMTime Reference).CMTimehas avalueand atimescalefield, and represents the timevalue/timescale seconds.CMTimeMakeis a function that returns aCMTimestructure, for example:The last two time values
t3andt4represent the same time value, thereforeIf you set the
videoMinFrameDurationof aAVCaptureSessionis does not make a difference if you setIn both cases the minimum time interval between frames is set to 1/20 = 0.05 seconds.