During SceneKit: what a new presentation at WWCD2017 (44:19) it was indicated that we can now use AVCaptureDeviceas the background for SCNScene.
Fragment from the presentation:
let captureDevice: AVCaptureDevice = ...
scene.background.contents = captureDevice
However the following code
let captureDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back)!
scene.background.contents = captureDevice
creates an error:
[SceneKit] Error: Cannot get pixel buffer (CVPixelBufferRef)
I also tried creating and starting AVCaptureSessionand then using the device, but it gives the same result.
What could be the problem here?
source
share