I am going to writing an App that records video but to save on memory space I want to allow the user to continually record and then, when something happens, they can save that period of time (post the event) in a similar vein to a CCTV camera that continually records over itself unless something happens and you want to permanently store it.
My concept to this so far is to record to a temporary video output (e.g. Output1) then after X minutes store Output1 in temp, start Output2 recording then after X minutes go back and record over Output1 and so on until an action to save from the user. Upon this action, stitch the two videos together to get more than X minutes regardless of how far in to each output file you have gotten, find the time index of the end of the second video minus X minutes then trim the combined video to produce the full output. This concept seems logical as you only use a smaller amount of space rather than have one constantly recording video and trim down but I am concerned that when the program transitions between the two recordings there will be a minor gap when it is working through saving the first output to temp.
My Questions are:
- Does the concept seem logical or are there other functions that can do rolling video recording?
- If it seems like a good idea is there a good way in Xcode to do some kind of parallel action to save one output to temp and start the next one off so there is no minor gap?