The demo script (delay.py) produces a "delayed" preview, with recording facilities. The pot (connected to the MCP3008) is used to control the amount by which the preview is delayed (can vary between 0 and 60 seconds), whilst one button is used to toggle recording (GPIO22), and the other to terminate the script (GPIO17).
Recording is written to "output.h264" in the current directory. This file is wiped when the script starts, and all recording is written to it (i.e. stopping the recording, then starting it again continues the recording from where it left off).