johk95
johk95

Reputation: 953

Why is AVCaptureSessionPresetHigh's picture so dark?

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

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.

Upvotes: 4

Views: 1122

Answers (1)

Vanya
Vanya

Reputation: 5005

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.

Upvotes: 2

Related Questions