Group Group Group Group Group Group Group Group Group

Video Depth Maps Tutorial for iOS: Getting Started | raywenderlich.com

In this iOS video depth maps tutorial, you’ll harness iOS 13’s video depth maps to apply realtime video filters and create a special effects masterpiece!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5999357-video-depth-maps-tutorial-for-ios-getting-started

Hi, trying to run the final version on Iphone 11 ios13.1.1, the
AVCaptureDevice.default(.builtInDualCamera - throws error, can not get the AVCaptureDevice with that camera.
When changed to builtInWideAngleCamera, the app runs, but no depth can be achieved, only original image.

@owenb Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi async1,
Sorry, I don’t have an iPhone 11 to test with, but what happens if you specify .back for position with .builtInDualCamera?

Also, what is the error?

Hi Owen, thanks for your quick reply.
It is fixed. It turns out on iPhone 11 there’s only a .builtInDualWideCamera - as a default set of cameras for Depth. Hope this answer might help somebody in the future.

As a side note: using the front facing camera with Xcode 11.2 and swift 5, the following code will work.
guard let camera = AVCaptureDevice.default(AVCaptureDevice.DeviceType.builtInTrueDepthCamera, for: AVMediaType.video, position: AVCaptureDevice.Position.front) else {

fatalError(“No depth video camera available”)