sto cercando di catturare fotogrammi in formato specifico AVCaptureVideoDataOutput
impostando kCVPixelBufferWidthKey
& kCVPixelBufferHeightKey
.
problema è la larghezza e l'altezza del buffer non cambiano mai, hanno sempre tornare 852x640AVCaptureVideoDataOutput e l'impostazione kCVPixelBufferWidthKey & kCVPixelBufferHeightKey
Qui sono io il codice:
// 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: da iOS AVCaptureOutput.h: Attualmente, la chiave unica supportato è kCVPixelBufferPixelFormatTypeKey.
qualcuno conosce un metodo di lavoro per impostare la larghezza/altezza del buffer di uscita?
Vorrei che funzionasse, ma potrei davvero usarlo anche io. :-) –