Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Record n minutes from a webcam


My goal is to create a tool with OpenCV to record stream from webcams. I want to record the n last minutes before a event. First I try to find a way with ffmpeg and gstream to do that but I don't achieve to do this. Then I try to do this with OpenCV.

I have two solutions, I can't simply record for example 2500 images on my computer with imwrite and then erase the oldest images with new frames. Or I can create a "tiny videos" 5 to 10 seconds" to record a portion of time and then as the images solutions,I erase the oldest videos and replace it with new solution.

The idea is to be able to get the last n minutes with the two solutions. For the first solution, in worst case, if the program crash, the last frame is not stored and I can see the last (n minutes -1 frames). In the second solution the last "tiny video" is broken and I can see the last (n minutes - 1 tiny video) and this is not really great even if it is for me the most optimise solution ...

Can someone give me advices or solutions for my problem.

Best regard.