![](/img/trans.png)
[英]How to create a time stamp from nsdate(timeintervalsince1970)
[英]iOS how can I get CMTime from Int64 that create by Date().timeIntervalSince1970
與標題相同,我通過 Date().timeIntervalSince1970 獲得時間戳,如何將其轉換為 CMTime?
extension TimeInterval {
func toCMTime() -> CMTime {
let scale = CMTimeScale(NSEC_PER_SEC)
let rt = CMTime(value: CMTimeValue(self * Double(scale)), timescale: scale)
return rt
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.