
Unfortunately this is considered blasphemy by SO (see here and here), which I agree with not only because it might corrupt the. Using code I found on the web (but can't find the link to any more), I found a hack whereby I kill the thread which launched the raspivid command. Similarly, I can't switch to the Party state (constant video recording of parties) as the camera is already recording. For example, I can't switch to the TV state as I can not record HD footage and watch it at the same time. To get around this, I launch a thread to launch the raspivid command, so now the states are correctly updated based on when the user comes and goes.

10 mins), but since the raspivid command is blocking, I get a situation where the user is physically in the house, but the program is in the surveillance state.

If motion is detected just before the user returns, the camera starts recording for a predetermined period of time (ie. I am creating a program where home surveillance is switched on when the user leaves, and then off again when they return. This presents a huge problem in surveillance.

This seems really stupid to me as, to the best of my knowledge, there is no camera available for retail which requires the user to specify how many seconds to run for, and then runs for that many seconds before stopping. Starting the Raspi Camera is rather trivial: raspivid -t 10000 -o test.h264
