gpt4 book ai didi

swift - AVCaptureDeviceType.builtInDualCamera 的作用是什么

转载 作者:搜寻专家 更新时间:2023-10-31 22:12:24 27 4
gpt4 key购买 nike

我正在玩 swift 和 iPhone 7 Plus。我正在使用 builtInWideAngleCamera 和 builtInTelephotoCamera。这太棒了,即使我无法同时获取 2 张图像。

我在苹果文档中看到 AVCaptureDeviceType 包含一个 builtInDualCamera 条目。这个设备在 avfoundation 中的目的是什么,因为我们不能用苹果 API 做任何事情(缩放、深度效果)?

换句话说,在使用 AVCaptureDeviceType、avcapturesession 和东西时,我看不出 builtInDualCamera 和 builtInWideAngleCamera 之间的区别

谢谢

最佳答案

Duel-Camera options 是选择像 Camera app 这样的行为,让系统自动决定在拍摄过程中选择使用哪个相机,并且可以结合两个相机的数据以提高输出。此外,它不支持任何 RAW 照片拍摄、OIS、HFR 和 Slo mo。

更多信息请查看iOSDeviceCompatibility

来自文档:

Dual Camera

Some iOS devices contain a dual camera—two separate back-facingcameras that can work together as a single capture device. Whensetting up a capture session on a device with an dual camera, you canchoose to use only the wide-angle camera, only the telephoto camera,or the dual camera. Choosing the dual camera capture device providesbehavior similar to the built-in Camera app—the system automaticallychooses which camera to use during capture, and can combine data fromboth cameras to improve capture output.

The AVCaptureDevice devices and devicesWithMediaType: methods aredeprecated in iOS 10 and do not provide access to the dual cameradevice (instead, they provide only the wide-angle camera device). Todetermine whether a device contains a dual camera and select it forcapture, you may either:

  • Call the AVCaptureDevicedefaultDeviceWithDeviceType:mediaType:position: method, passing thebuiltInDuoCamera device type. If this method returns non-nil, the iOSdevice contains a dual camera. (If this method returns nil, you cancall it again, passing the builtInWideAngleCamera device type, toobtain the default back camera.)
  • Create anAVCaptureDeviceDiscoverySession object, passing the device attributesyou want to use for capture, and enumerate its devices list to choosea device for your capture session.

When you use the dual cameracapture device, Optical Image Stabilization (OIS), RAW Photo Capture,High Frame Rate (HFR) / Slow Motion Video, and most manual controlsare not available. To use these features, specifically select eitherthe wide or telephoto capture device. (For OIS, specifically selectthe wide-angle camera; the telephoto camera does not support opticalimage stabilization.)

关于swift - AVCaptureDeviceType.builtInDualCamera 的作用是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41482277/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com