I try to get as many images from the camera as possible, but I can only find examples that captureStillImageAsynchronouslyFromConnection
, and then go straight to:
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; UIImage *image = [[UIImage alloc] initWithData:imageData];
JPEG is loss and that’s it, is there a way to get data like PNG, or even just RGBA (BGRA, what-have-you?). AVCaptureStillImageOutput does not seem to have other NSData * methods.
Actually, looking at CMSampleBufferRef, it seems that it is already locked as JPEG ~
formatDescription = <CMVideoFormatDescription 0xfe5e1f0 [0x3e5ac650]> { mediaType:'vide' mediaSubType:'jpeg' mediaSpecific: { codecType: 'jpeg' dimensions: 2592 x 1936 } extensions: {(null)} }
Is there any other way to make a full resolution image and get raw data?
source share