Próbuję uchwycić klatek w określonym rozmiarze od AVCaptureVideoDataOutput
ustawiając kCVPixelBufferWidthKey
& kCVPixelBufferHeightKey
.
problemem jest szerokość i wysokość buforu nigdy nie zmieni, zawsze wrócić 852x640AVCaptureVideoDataOutput i ustawienie kCVPixelBufferWidthKey & kCVPixelBufferHeightKey
Oto mi kod:
// 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: z iOS AVCaptureOutput.h: Obecnie jedynym kluczem jest obsługiwana kCVPixelBufferPixelFormatTypeKey.
Ktoś zna działającą metodę ustawiania szerokości/wysokości bufora wyjściowego?
Żałuję, że to nie działa - naprawdę mogłem to wykorzystać. :-) –