开发者

Faster still image capture with AVFoundation

开发者 https://www.devze.com 2023-04-11 14:46 出处:网络
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 get

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];
 }];
0

精彩评论

暂无评论...
验证码 换一张
取 消