Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVFoundation video preview is darker than the native Camera app

I am using AVFoundation to produce video frames. The problem is that the frames look darker than in the native camera app, especially in dark areas.

As I see, the native camera app (iOS 8) makes some adjustments (ISO, shutter speed) all the time and continuously adopts itself to the environment light conditions (it seems that in low-light conditions it slows the shutter speed, rather then increasing the ISO).

I cannot make my video preview looks the same. Tried settings the exposure mode to AVCaptureExposureModeContinuousAutoExposure, but it does not make the same effect.

Please advise

like image 785
user-123 Avatar asked Dec 14 '22 16:12

user-123


2 Answers

IOS 8 introduced a number of improvements to image capture and I don't doubt that the native app isn't leaning on a number of them.

If you have access this Apple sample exposes all of the new features (white balance, ISO, shutter speed etc).

You will need to combine a few of these settings to replicate the built in - auto exposure alone is unlikely to match the built in.

like image 78
davbryn Avatar answered Mar 23 '23 01:03

davbryn


Well the above answer is 100% correct. In my case though, i was setting AVCaptureSession property sessionPreset to AVCaptureSessionPresetHigh and the preview was a lot darker than the one in camera app. When I changed this preset to AVCaptureSessionPresetPhoto the preview looked so much better and didn't seem to be as dark as before... Maybe it's just this setting.

like image 43
animal_chin Avatar answered Mar 23 '23 00:03

animal_chin