Getting correct first frame from AVCaptureVideoDataOutput - AVFoundation
<p>I am capturing video from back camera using AVFoundation and would like to process the frames when I press start button. The problem is that, the moment I press start button, I grab the frame from the sample buffer and process it but it seems that the frame that I get is the past frame, meaning not the current frame that I want.</p>

<p>I understand that sample buffer will come at a delayed timing. I tried using the presentation timestamp of the sample buffer but I don't seem to be able to get it in sync. Has anyone faced a similar problem before? Any help or advice will be appreciated.</p>

<pre><code>(void)captureOutput:(AVCaptureOutput *)captureOutput
        didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
        fromConnection:(AVCaptureConnection *)connection;
</code></pre>

<p>That is where I get my frames.</p>