AVCaptureDevice低光提升迅速

时间:2016-10-02 08:47:06

标签: ios swift xcode avcapturedevice

有谁知道如何为你的ios相机应用设置低光增强?这是我的代码,但无法使其工作。

let backCamera = AVCaptureDevice.defaultDevice(withMediaType: AVMediaTypeVideo)
    do {
                try backCamera?.lockForConfiguration()
                if (backCamera?.isLowLightBoostSupported == true) {
                   backCamera?.automaticallyEnablesLowLightBoostWhenAvailable = true
                }
                 backCamera?.unlockForConfiguration()
                 }
                 catch{
                     print(error)
                 }

1 个答案:

答案 0 :(得分:0)

你不需要那个。把它放在didMoveToView:

captureSession!.sessionPreset = AVCaptureSessionPresetPhoto