Why is AVCaptureSessionPresetHigh's picture so dark?

1.1k views Asked by At

Playing around with AVCapureSessions and trying to display the output CMSampleBufferRef's in different ways (using a AVCaptureVideoPreviewLayer, displaying a CGImage and transforming it to a UIImage), I also looked at all the different quality presets you can set for you AVCaptureSession.
Then I noticed how the quality differences between

  • AVCaptureSessionPresetLow,
  • AVCaptureSessionPresetMedium and
  • AVCaptureSessionPresetHigh

are not only the resolution of the image but also their aspect ratio and most notably the overall image quality. In my specific case, frames gotten with AVCaptureSessionPresetLow/Medium were much brighter than those with AVCaptureSessionPresetHigh. Why is this?

To set up the session and to display the images I used this code: http://www.benjaminloulier.com/posts/ios4-and-direct-access-to-the-camera

To set the presets:

[self.captureSession setSessionPreset:AVCaptureSessionPresetHigh];

Here two examples with Medium and High quality:

AVCaptureSessionPresetMedium AVCaptureSessionPresetHigh

I assure you that these two screenshots are made pointing the camera at the same spot, same time and with the same light conditions.

1

There are 1 answers

0
Vanya On

The difference is caused by the purpose of those presets. While AVCaptureSessionPresetHigh is basically for making video, AVCaptureSessionPresetLow/Medium might be used for creating photos as well because they have the same behavior as AVCaptureSessionPresetPhoto preset. You can try your default camera app.