I get a CVPixelBuffer from ARSessionDelegate:
func session(_ session: ARSession, didUpdate frame: ARFrame) {
frame.capturedImage // CVPixelBufferRef
}
The sampleTiming mainly contains the presentationTimeStamp
, You can easy create it by following codes:
let scale = CMTimeScale(NSEC_PER_SEC)
let pts = CMTime(value: CMTimeValue(frame.timestamp * Double(scale)),
timescale: scale)
var timingInfo = CMSampleTimingInfo(duration: kCMTimeInvalid,
presentationTimeStamp: pts,
decodeTimeStamp: kCMTimeInvalid)