6

AVCaptureVideoDataOutputを設定して、特定のサイズのフレームをキャプチャしようとしています。 問題は、バッファの幅と高さが決して変わらないことです。それらは常に852x640に戻ります。kCVPixelBufferWidthKeykCVPixelBufferHeightKey

これが私のコードです:

// 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のみです。

出力バッファの幅/高さを設定する作業方法を知っている人はいますか?

4

1 に答える 1

4

iOS AVCaptureOutput.hから:Currently, the only supported key is kCVPixelBufferPixelFormatTypeKey.

これはそれを要約します。

于 2011-11-02T10:18:05.080 に答える