Still image capture time in iPhone 5S is slower than iPhone 5?

I am trying to capture a still image with 8 megapixels. I spent the time spent on the camera pipeline to go to the completion handler. On average, the iPhone 5S takes 0.33 seconds when the iPhone 5 takes less than 0.15 seconds. any body explains this. This is my profiling code.

__block NSDate *TimerAcross = [NSDate date];
    [stillImageOutput captureStillImageAsynchronouslyFromConnection:connection
                                                  completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error)
     {
         DLog(@"handler call  timer = %f", [[NSDate date] timeIntervalSinceDate:TimerAcross]);
    }`

When I try to use the same code in a square cam (apple demo code). I see that the time spent on the iPhone 5S is about 0.6 and less than that of the iPhone 5. What is the reason for this.

My settings are for capturing YUVSP images. `NSMutableDictionary * outputSettings = [NSMutableDictionary dictionaryWithObject: AVVideoCodecJPEG forKey: AVVideoCodecKey];

[outputSettings setValue: @ (kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) forKey: (id) kCVPixelBufferPixelFormatTypeKey];

NSMutableDictionary *videoOutputSettings = [NSDictionary dictionaryWithObject:@(kCVPixelFormatType_420YpCbCr8BiPlanarFullRange) forKey:(id)kCVPixelBufferPixelFormatTypeKey];

[stillImageOutput setOutputSettings:outputSettings];
[videoDataOutput setVideoSettings:videoOutputSettings];
videoDataOutput.alwaysDiscardsLateVideoFrames = YES;

if([captureSession canAddOutput:stillImageOutput] && [captureSession canAddOutput:videoDataOutput])
{
    [captureSession addOutput:videoDataOutput];
    [captureSession addOutput:stillImageOutput];
    NSLog(@"added output to captureSession");
    return YES;
}
else
{
    NSLog(@"error in adding still image output");
    return NO;
}

} `

+3
source share
1 answer

Please share or check the video orientation settings.

If it is installed on any equipment with a fixed orientation, it may take some time to return through the callback. Please use the [connection setVideoOrientation:] method, which sets the orientation based on the current orientation of the device, and this will be a faster call.

You can read more detailed information. Link

+2
source

All Articles