I am trying to capture frames of a certain size from AVCaptureVideoDataOutput by setting kCVPixelBufferWidthKey and kCVPixelBufferHeightKey .
The problem is that the width and height of the buffer never change, they always return 852x640
Here is the code:
// Add the video frame output self.videoOutput = [[AVCaptureVideoDataOutput alloc] init]; [videoOutput setAlwaysDiscardsLateVideoFrames:YES]; // Use RGB frames instead of YUV to ease color processing [videoOutput setVideoSettings:[NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat:320.0], (id)kCVPixelBufferWidthKey, [NSNumber numberWithFloat:320.0], (id)kCVPixelBufferHeightKey, [NSNumber numberWithInt:kCVPixelFormatType_32BGRA],(id)kCVPixelBufferPixelFormatTypeKey, nil]]; [videoOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()];
EDIT: from iOS AVCaptureOutput.h: Currently, the only supported key is kCVPixelBufferPixelFormatTypeKey.
Does anyone know a working method for setting the width / height of the output buffer?
source share