Ios 为什么AVCaptureSessionPresetHigh';这幅画这么暗?
玩Ios 为什么AVCaptureSessionPresetHigh';这幅画这么暗?,ios,cocoa-touch,video-capture,avcapturesession,image-quality,Ios,Cocoa Touch,Video Capture,Avcapturesession,Image Quality,玩AVCapureSessions并尝试以不同的方式显示输出CMSampleBufferRef(使用AVCaptureVideoPreviewLayer,显示CGImage,并将其转换为UIImage),我还查看了您可以为自己设置的所有不同质量预设AVCaptureSession。 然后我注意到了它们之间的质量差异 AVCaptureSessionPresetLow AVCaptureSessionPresetMedium和 AVCaptureSessionPresetHigh 不仅是图像的
AVCapureSessions
并尝试以不同的方式显示输出CMSampleBufferRef
(使用AVCaptureVideoPreviewLayer
,显示CGImage
,并将其转换为UIImage
),我还查看了您可以为自己设置的所有不同质量预设AVCaptureSession
。
然后我注意到了它们之间的质量差异
AVCaptureSessionPresetLow
和AVCaptureSessionPresetMedium
AVCaptureSessionPresetHigh
AVCaptureSessionPresetLow/Medium
获得的帧比使用AVCaptureSessionPresetHigh
获得的帧亮得多。为什么会这样
要设置会话并显示图像,我使用以下代码:
要设置预设值,请执行以下操作:
[self.captureSession setSessionPreset:AVCaptureSessionPresetHigh];
这里有两个中等
和高
质量的示例:
我向您保证,这两个屏幕截图是在相同的地点、相同的时间和相同的光线条件下拍摄的。差异是由这些预设的目的造成的。虽然
AVCaptureSessionPresetHigh
基本上用于制作视频,但是AVCaptureSessionPresetLow/Medium
也可以用于创建照片,因为它们与AVCaptureSessionPresetPhoto
预设具有相同的行为。您可以尝试默认的照相机应用程序