美文网首页
depth data

depth data

作者: 流年易逝_李 | 来源:发表于2018-04-19 10:42 被阅读55次

后置摄像头优先级与types里的顺序有关

private let videoDeviceDiscoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInTrueDepthCamera,

                                                                                            .builtInDualCamera,

                                                                                            .builtInWideAngleCamera],

                                                                              mediaType: .video,

                                                                              position: .unspecified)

一.添加输入,输出

video input

photo output

video data output

depth data output

二.设置outputSynchronizer

三.实现代理方法

func dataOutputSynchronizer(_ synchronizer: AVCaptureDataOutputSynchronizer, didOutput synchronizedDataCollection: AVCaptureSynchronizedDataCollection) {}

注意:开启photoOutput.isDepthDataDeliveryEnabled

并选择.builtInTrueDepthCamera/builtInDualCamera

demo 链接:https://github.com/licl19/DepthDataDemo.git

相关文章

网友评论

      本文标题:depth data

      本文链接:https://www.haomeiwen.com/subject/eogikftx.html