James
James

Reputation: 2282

Video stream from iPhone camera, retain only last 2 min of stream at all times

I am working on an iPhone app that would capture realtime video from the iPhone camera over long periods of time. That part is fairly straightforward - the catch is that I only want the device to retain the last 2 minutes of recorded video at any time, discarding all images prior to this time period. I'm having trouble conceptualizing how this functionality might work. The only idea that comes to mind is to retain a stream of still images for the last 2 minutes, and discard outdated images. Then when the user stopped the recording, these images would be compiled into a video. It just seems really inefficient to hold on to almost 3000 images at a time.

I would love to hear any ideas for how to achieve this goal in a reasonably efficient manner. Thank you all in advance for your input!

Best, James

Upvotes: 1

Views: 516

Answers (1)

Toastor
Toastor

Reputation: 8990

Skip the idea with still images. You'd loose all the efficency that video codecs have to offer. Plus, I don't think the iPhone can handle that amount of data properly.

But maybe there's a compromise - it may be possible to record, say, ten seconds at a time, then start a new recording seamlessly. Dump the old recordings once they become old then two minutes.

I'm not quite sure if this is possible without loosing a few frames between the recordings though.

Upvotes: 2

Related Questions