2011-11-01 15 views
6

estoy tratando de capturar imágenes en un tamaño específico de AVCaptureVideoDataOutput estableciendo kCVPixelBufferWidthKey & kCVPixelBufferHeightKey.
El problema es que el ancho de amortiguación y la altura nunca cambian, siempre vuelven 852x640AVCaptureVideoDataOutput y el establecimiento de kCVPixelBufferWidthKey y kCVPixelBufferHeightKey

aquí soy yo código:

// 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: desde iOS AVCaptureOutput.h: En la actualidad, la llave sólo es apoyado kCVPixelBufferPixelFormatTypeKey.

¿Alguien sabe un método de trabajo para configurar el ancho/alto del búfer de salida?

Respuesta

4

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

esto lo resume todo.

+1

Ojalá hubiera funcionado, realmente podría usar eso también. :-) –

Cuestiones relacionadas