Note that there are some explanatory texts on larger screens.

plurals
  1. POCapturing GPUImageVideoCamera or AVCaptureSession frames in circular or ring buffer for instant playback
    primarykey
    data
    text
    <p>I am using <a href="https://github.com/BradLarson/GPUImage" rel="nofollow noreferrer">GPUImage</a>'s GPUImageVideoCamera initWithSessionPreset:cameraPosition: in order to display video from the rear facing camera on an iOS device (targeting iOS 7). This is filtered and displayed on a GPUImageView. Will not exceed AVCaptureSessionPreset640x480.</p> <p><strong>At any given moment in the app, I need to recall the past 5 seconds of unfiltered video captured from the rear-facing camera and instantly play this back on another (or the same) GPUImageView.</strong></p> <p>I can access CMSampleBufferRef via GPUImageVideoCamera's willOutputSampleBuffer: which is passed through from but I'm not sure how one goes about getting the most recent frames into memory in an efficient way such that they can be instantly, seamlessly played back.</p> <p>I believe the solution is a <a href="http://en.wikipedia.org/wiki/Circular_buffer" rel="nofollow noreferrer">Circular Buffer</a> using something like <a href="https://github.com/michaeltyson/TPCircularBuffer" rel="nofollow noreferrer">TPCircularBuffer</a> but I'm not sure that will work with a video stream. Also wanted to reference unanswered <a href="https://stackoverflow.com/questions/13531878/buffering-cmsamplebufferref-into-a-cfarray">Buffering CMSampleBufferRef into a CFArray</a> and <a href="https://stackoverflow.com/questions/6227130/hold-multiple-frames-in-memory-before-sending-them-to-avassetwriter">Hold multiple Frames in Memory before sending them to AVAssetWriter</a> as they closely resembled my original plan of attack until I started researching this.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload