Faster still image capture with AVFoundation
I use some code to capture still images from the camera. With my iPad2, it grabs 30 frames per second without any trouble, 开发者_C百科but with the iPhone4 only around 4 fps before the imagebuffer gets full. Is there any way to make it faster, I need at least 15 fps. I just save the images in an array, so maybe I just have to increase the imagesamplebuffer?
[stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
[arrCaptures addObject:image];
[image release];
}];
精彩评论