我在设置自定义曝光持续时间时遇到问题。
根据Apple documentation设置曝光持续时间的唯一方法是使用方法 setExposureModeCustomWithDuration:ISO:completionHandler:
。但是,当我设置任何高于 0.07 的值并且拍摄图像时,曝光时间的值为 0.06666666666666667,尽管 AVCaptureDevice
的 maxExposureDuration 属性返回最大值可以是 0.5 秒。
曝光持续时间是否会与其他相机属性发生冲突? 还是我做错了什么?
代码:
@try
{
NSError* error;
[self.captureDevice lockForConfiguration:&error];
if (!error)
{
// Setup of other properties
if ([self.captureDevice isExposureModeSupported:selectedExposureMode])
{
if (selectedExposureMode == AVCaptureExposureModeCustom) {
[self.captureDevice setExposureModeCustomWithDuration:exposureTimeValue ISO:isoValue completionHandler:^(CMTime syncTime) {}];
}
}
}
}
@catch (NSException *exception)
{
NSLog(@"%@",exception);
}
@finally
{
[self.captureDevice unlockForConfiguration];
}
最佳答案
我测试了曝光持续时间 = 0.5,这是有效的,我在更改持续时间之前执行了setExposureMode。
[self.captureDevice setExposureMode:AVCaptureExposureModeCustom];
[self.captureDevicesetExposureModeCustomWithDuration:CMTimeMake( 1, 2 ) ISO:iso completionHandler:^(CMTime syncTime) {}];
关于ios - iPhone相机无法设置长时间曝光,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35717821/