&AVCaptureVideoDataOutput
を設定して、特定のサイズのフレームをキャプチャしようとしています。
問題は、バッファの幅と高さが決して変わらないことです。それらは常に852x640に戻ります。kCVPixelBufferWidthKey
kCVPixelBufferHeightKey
これが私のコードです:
// 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()];
編集:iOS AVCaptureOutput.hから:現在、サポートされているキーはkCVPixelBufferPixelFormatTypeKeyのみです。
出力バッファの幅/高さを設定する作業方法を知っている人はいますか?