Saving iOS video buffer

304 Views Asked by At

I am trying to write a video cache like algorithm that could save a video file starting from 60 seconds before you press record, or when record is triggered from some sensor input.

It would work something like this:

  1. Video is constantly recording and saving video to a place in memory.
  2. This area of memory holds 60 seconds of video.
  3. When the memory fills up, it dumps the oldest frames.
  4. When record is triggered, it starts outputting the video to a file with the buffered video concatenated at the beginning.

I've messed around with AVCaptureSession, and can save video from a camera source, but I don't know where to start with the buffering. Any thoughts would be very helpful.

0

There are 0 best solutions below