title: AVCapture capturing and getting framebuffer at 60 fps in iOS 7
body: <p>I'm developping an app which requires capturing framebuffer at as much fps as possible. I've already figured out how to force iphone to capture at 60 fps but</p>
  
  <pre><code>- (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection
  </code></pre>
  
  <p>method is being called only 15 times a second, which means that iPhone downgrades capture output to 15 fps.</p>
  
  <p>Has anybody faced such problem? Is there any possibility to increase capturing frame rate?</p>
  
  <p><strong>Update</strong> my code:</p>
  
  <pre><code>camera = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
  if([camera isTorchModeSupported:AVCaptureTorchModeOn]) {
     [camera lockForConfiguration:nil];
     camera.torchMode=AVCaptureTorchModeOn;
     [camera unlockForConfiguration];
  }
  [self configureCameraForHighestFrameRate:camera];
  
  // Create a AVCaptureInput with the camera device
  NSError *error=nil;
  AVCaptureInput* cameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:camera error:&amp;error];
  if (cameraInput == nil) {
     NSLog(@"Error to create camera capture:%@",error);
  }
  
  // Set the output
  AVCaptureVideoDataOutput* videoOutput = [[AVCaptureVideoDataOutput alloc] init];
  
  // create a queue to run the capture on
  dispatch_queue_t captureQueue=dispatch_queue_create("captureQueue", NULL);
  
  // setup our delegate
  [videoOutput setSampleBufferDelegate:self queue:captureQueue];
  
  // configure the pixel format
  videoOutput.videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA], (id)kCVPixelBufferPixelFormatTypeKey,
                               nil];
  
  // Add the input and output
  [captureSession addInput:cameraInput];
  [captureSession addOutput:videoOutput];
  </code></pre>
  
  <p>I took <code>configureCameraForHighestFrameRate</code> method here <a href="https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html">https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html</a></p>