I m trying to capture frames in a specific size from AVCaptureVideoDataOutput
by setting kCVPixelBufferWidthKey
& kCVPixelBufferHeightKey
.
Problem is the buffer width and height never change, they always come back 852x640
下面是我的法典:
// 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:SOS:CaptureOutputh: 目前,唯一得到支持的关键是KCVPixelBufferPixelFormatTypeKey。
任何人都知道确定产出缓冲宽度/宽度的工作方法?