曝光模式不会保持锁定状态

发布于 2024-11-14 21:22:47 字数 717 浏览 2 评论 0原文

问题:我可以设置 AVCaptureDevice 的 ExposureMode 属性,但它不会保持锁定状态。

这是我的代码:

NSArray *devices = [AVCaptureDevice devices];
NSError *error;
for (AVCaptureDevice *device in devices) {
    if (([device hasMediaType:AVMediaTypeVideo]) && 
        ([device position] == AVCaptureDevicePositionBack) ) {
        if ([device isExposureModeSupported:AVCaptureExposureModeLocked]) {
            device.exposureMode = AVCaptureExposureModeLocked;
            NSLog(@"Exposure locked");
        }
        [device unlockForConfiguration];
    }
}

我以编程方式一张一张地拍摄 4 张照片。前两张照片中的曝光保持锁定,但在后两张照片中曝光解锁。当在锁定曝光之前我点击相机视图的黑暗部分以使图片的部分曝光过度时,就会发生这种情况。看起来 iOS 决定在图片曝光过度时进行自动曝光并覆盖曝光锁定模式。

感谢您的帮助,

Problem: I can set the exposureMode property of AVCaptureDevice, but it does not stay locked.

Here is my code:

NSArray *devices = [AVCaptureDevice devices];
NSError *error;
for (AVCaptureDevice *device in devices) {
    if (([device hasMediaType:AVMediaTypeVideo]) && 
        ([device position] == AVCaptureDevicePositionBack) ) {
        if ([device isExposureModeSupported:AVCaptureExposureModeLocked]) {
            device.exposureMode = AVCaptureExposureModeLocked;
            NSLog(@"Exposure locked");
        }
        [device unlockForConfiguration];
    }
}

I take 4 pictures one after another programmatically. The exposure stays locked in the first two pictures, but becomes unlocked in the last two. This happens when before locking the exposure I tap on a dark portion of the camera view so that part of the picture is over-exposed. It looks like iOS decides to do auto-exposure and override the exposure lock mode when the picture is overexposed.

thanks for the help,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱格式化 2024-11-21 21:22:47

我没有对此进行测试,但走的是同样的道路。为什么不尝试保持锁定直到完成这一系列照片。一旦您释放锁定,系统就可以自由更改设置。

I did not test this, but going down this same path. Why not try holding the lock until you are done the series of photos. Once you release the lock the system is free to change the setting.

耀眼的星火 2024-11-21 21:22:47

这个问题似乎在 iOS 5 中已经得到解决。

this problem seem to have been fixed in iOS 5.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文