New Feature Showcase: Pre-Recording
Let me first explain how the so called circ-buffer or ring-buffer (more technical details here on wikipedia) inside the Elphel camera works as it is essential to understand the tech behind the pre-recording feature:

Around 19MB of the total 64MB SDRAM that are available in the Elphel camera are used as main circular buffer to store a constant stream of video frames that finished their path through the processing pipeline in the FPGA. The latest available frame always overwrites the memory where the oldest frame just was (the read pointer rotates around the ring). When you start recording a video in the harddisk recorder software (camogm as used in ElphelVision) a read pointer inside the ring buffer comes into effect. It takes one frame after the other from the circ-buffer and writes it to the hard-drive. If the hard-disk recorder cannot store the frames to hard-drive fast enough (faster than new frames are added to the buffer at the write pointer) the buffer will overflow, meaning the read pointer will fail to read the oldest available frame and suddenly read the latest (or a part from the latest) frame. This overflow will result in dropped frames.
To visualise this idea you could imagine a rotating cake plate where at a certain point a baker constantly puts new slices of pie onto the plate. Your job is to eat all pieces as fast as possible ( Lets call you the "cake-recorder" and you have to store all pieces in your stomach). Delicious idea isn't it :)
Recently Andrey from Elphel Inc. sent me a pre-release version of modifications he did to the camogm source code that integrate a new feature. This new feature called "Pre-Recording" lets you store frames from the video stream to hard-drive that were recorded before you pressed the record button. The write buffer starts with storing the oldest frames instead of the latest ones first.
The following video shows this feature in effect, it might not be a pretty video but it serves its purpose. The camera films me when I pressed the record button on my screen. The number of frames stored in the circ-buffer depends on the actual data-size of the frames. In this video that are around 6 seconds of video.

