3

AVCapureSessions玩周围,并试图显示输出以不同的方式CMSampleBufferRef“s(使用AVCaptureVideoPreviewLayer,显示CGImage并将它转换到UIImage),我也看了所有的不同质量预设,你可以为你AVCaptureSession设置。
然后我注意到为什么AVCaptureSessionPresetHigh的图片如此黑暗?

  • AVCaptureSessionPresetLow之间的质量差异,
  • AVCaptureSessionPresetMedium
  • AVCaptureSessionPresetHigh

如何不仅是图像的分辨率也是其长宽比和最引人注目的是整体图像质量。在我的具体情况下,使用AVCaptureSessionPresetLow/Medium获得的帧比使用AVCaptureSessionPresetHigh的帧要明亮得多。为什么是这样?

为了建立会话,并显示我用这个代码的图像:http://www.benjaminloulier.com/posts/ios4-and-direct-access-to-the-camera

要设置的预置值:

[self.captureSession setSessionPreset:AVCaptureSessionPresetHigh]; 

在这里与Medium两个例子和High质量:

AVCaptureSessionPresetMedium AVCaptureSessionPresetHigh

我向你保证,这两个截图是在相同的地点,相同的时间和相同的光线条件下指向相机。

回答

1

不同之处在于这些预设的目的。虽然AVCaptureSessionPresetHigh基本上用于制作视频,但AVCaptureSessionPresetLow/Medium也可用于创建照片,因为它们与AVCaptureSessionPresetPhoto预设具有相同的行为。你可以尝试你的默认相机应用程序。