AVCaptureDevice's isLowLightBoostSupported always returns false on 5S iOS7.1 (for automaticallyEnablesLowLightBoostWhenAvailable)

StackOverflow https://stackoverflow.com/questions/22487518

Question

I'm attempting to enable AVCaptureDevice's automaticallyEnablesLowLightBoostWhenAvailable in an iOS camera app, but I've been utterly unable to make AVCaptureDevice's isLowLightBoostSupported return true.

Question: Is there anything that needs to be done to enable the low light boost api beyond locking for configuration? Is there any known reason that isLowLightBoostSupported would always return false (for all devices) on a fully updated, modern, system?

I'm testing on a 5S with iOS 7.1.

For the sake of simplicity in this question, I've ported the changes into Apple's AVCam test app. The diff in AVCam is as such:

diff --git a/AVCam/AVCam/AVCamViewController.m b/AVCam/AVCam/AVCamViewController.m
index 84a2c77..4e15fc4 100644
--- a/AVCam/AVCam/AVCamViewController.m
+++ b/AVCam/AVCam/AVCamViewController.m
@@ -175,6 +175,18 @@ static void * SessionRunningAndDeviceAuthorizedContext = &SessionRunningAndDevic
            [session addOutput:stillImageOutput];
            [self setStillImageOutput:stillImageOutput];
        }
+
+        if ([videoDevice respondsToSelector:@selector(isLowLightBoostSupported)]) {
+            if ([videoDevice lockForConfiguration:nil]) {
+                if (videoDevice.isLowLightBoostSupported) {
+                    videoDevice.automaticallyEnablesLowLightBoostWhenAvailable = YES;
+                    NSLog(@"was supported");
+                } else {
+                    NSLog(@"was not supported");
+                }
+                [videoDevice unlockForConfiguration];
+            }
+        }
    });
 }

I've put that code in the context of AVCam online at github for further clarity.

I've trawled through the docs and SO to try to find an answer. Here are some things that have educated my current code:

I've also attempted to set the AVCaptureSession instance's sessionPreset to all of AVCaptureSessionPresetHigh, AVCaptureSessionPresetPhoto, and AVCaptureSessionPresetLow with no observable effect on the the state of isLowLightBoostSupported.

Thanks for reading through this - and for any help you can give! :)

Was it helpful?

Solution

From what I understand the 5S does not support low light boost mode. I don't have any insight into Apple's decision on this, but I'm guessing the improvements made to the camera/sensor on the 5S were good enough that they felt low light boost was not needed on that device.

So, what you're seeing is not an error. It's simply that some devices support that feature (the iPhone 5), and some do not (the iPhone 5S).

I'd post a list of compatible devices, but I don't have newer iPod Touches and some iPads to be able to test it. I'd guess the iPhone 5c does support it since that device is basically a reskinned iPhone 5, but again I don't have one to test.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top