CMTimeMakeWithSeconds explained
CMTime is structure which has two main components, timeScale and value.
CMTIME = VALUE / TIMESCALE
where, TimeScale = fraction of a second each unit in numerator occupies.
CMTIME = Value / TimeScale
1) public func CMTimeMake(_ value: Int64, _ timescale: Int32) -> CMTime
CMTimeMake(6000, 10)
Means, there are 6000 units , each unit occupies 1/10 of a second
2) public func CMTimeMakeWithSeconds(_ seconds: Float64, _ preferredTimescale: Int32) -> CMTime
CMTimeMakeWithSeconds(10.0,500)
10.0 = VALUE /500
Therefore VALUE = 5000
So, there are 5000 units, each occupy 1/500 of a second
Comments
Post a Comment