增加.continuousAutoExposure模式

时间:2018-02-20 16:00:52

标签: ios swift avfoundation avcapturesession ios-camera

我使用AVCaptureDevice.Preset.High预设实现了自定义相机,我正在使用.continuousAutoExposure。一切都按预期工作,但是,图片的亮度有时很低。

我研究过官方文档并发现,我可以使用setExposureModeCustomWithDuration设置自定义ISO。不幸的是,这样做会导致失去希望的曝光自动化。

我现在的问题是,有没有办法提高.continuousAutoExposure模式的整体亮度百分比?我需要它才能将曝光率提高到5%左右,但我还需要坚持使用.continuousAutoExposure模式。

2 个答案:

答案 0 :(得分:3)

诀窍是设置exposureTargetOffset实例的AVCaptureDevice属性。您需要使用KVO观察captureDevice.exposureTargetOffset值的变化并将其更改为您所需的曝光级别。有关详细信息,请查看此answer

答案 1 :(得分:0)

您是否尝试过使用automaticEnablesLowLightBoostWhenAvailable,https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624610-automaticallyenableslowlightboos