As same as the title I am get a Timestamp by Date().timeIntervalSince1970 how can I transform it to CMTime?
Asked
Active
Viewed 184 times
extension TimeInterval {
func toCMTime() -> CMTime {
let scale = CMTimeScale(NSEC_PER_SEC)
let rt = CMTime(value: CMTimeValue(self * Double(scale)), timescale: scale)
return rt
}
}