Save depth images from TrueDepth camera

I am trying to save depth images from the iPhoneX TrueDepth camera. Using the AVCamPhotoFilter sample code, I am able to view the depth, converted to grayscale format, on the screen of the phone in real-time. I cannot figure out how to save the sequence of depth images in the raw (16 bits or more) format.


I am looking at line 1030 of CameraViewController.swift of the sample code.


let depthData = syncedDepthData.depthData


Now, depthData.depthDataMap is the object of type CVPixelBuffer and image format type kCVPixelFormatType_DisparityFloat16. Is there a way to save it to the phone?

Replies

I wonder if you found a solution to this problem. Please share if you did. Thank you!