I would like to shoot high resolution still images using AVCaptureSession. Therefore, the AVCaptureSessionpreset is set to Photo.
It works well. On iPhone 4, the final resolution of a still image is at most 2448x3264 pixels, and the preview resolution (video) is 852 × 640 pixels.
Now, since the preview frames are analyzed to detect objects in the scene, I would like to lower their resolution. How can this be done? I tried setting AVVideoSettingswith a smaller width / height on AVCaptureVideoDataOutput, but this will result in the following error message:
AVCaptureVideoDataOutput setVideoSettings:] - videoSettings dictionary contains one or more unsupported (ignored) keys: (AVVideoHeightKey, AVVideoWidthKey
So, it seems like this is the wrong approach to adjust the size of the preview frames obtained with AVCaptureVideoDataOutput/ AVCaptureVideoDataOutputSampleBufferDelegate. Do you have any idea how you can adjust the resolution of the preview frames?
Any recommendations are welcome, thanks.
source
share