Question

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

Here is me 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.

anyone knows a working method of setting the output buffer width/height ?

Was it helpful?

Solution

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

this sums it up.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top