I try to use or create a software to record the last n minutes from a webcam.
I use opencv to grab images from my webcam but I don't know if it is the best way to create a in real time a video. I want to continiously record the data and then when the user want it, the program stop and generate a video with the last n minutes.
I planned to record the m last frames in memory or in computer and continously replace the older frame by new one and when the user want its video, generate it with the frames.
I am not really sure it is the best and efficious way to do that.
Can someone give me link or advice about doing somethink like that?