Sorry, I don't think there is a documention for the circular buffer.
The ring buffer size is calculated from the timeout and bit rate value:
Code: Select all
int count=state.bitrate * (state.timeoute / 1000) / 8;
This mean we allocated as many bytes as would be needed at the given bitrate to save timeout seconds.
This will not give timeout seconds video, as we need to have a valid I frame to start with. The I frames are only each 60(?) frame, this can be set too. If you are unlucky you will have 59 frames at the beginning which will need to be skiped.
The signal to the program can be keypress or signal. If it is set to signal you can send the program a "USR1" kill signal to trigger it.
I'm not using python, but I guess you can use something like "os.kill(pid, signal.SIGUSR1)))".
I would recommend to use the picamera python library
, which has an excellent documentation.