Tentatively, you could try setting a dictionary on the something like the following with your width
and height
:
NSDictionary* videoSettingsDictionary = @{
(id)kCVPixelBufferWidthKey : @(width),
(id)kCVPixelBufferHeightKey : @(height),
AVVideoScalingModeKey : AVVideoScalingModeFit
};
[yourAVCaptureVideoDataOutput setVideoSettings:videoSettingsDictionary];
Supposedly, AVVideoScalingModeFit
forces the AVCaptureVideoDataOutput
to Crop to remove edge processing region; preserve aspect ratio of cropped source by reducing specified width or height if necessary.
(link to AVF docs)