Because FFmpeg takes a while to spin up, first photo might miss someone if they run through the door. Solutions might include https://github.com/fsphil/fswebcam for image capture.
Another alternative would be using another pi to stream live video. Because of the stream time delay a request to capture from the stream would inherently capture the moments right before the switch being triggered. An artificial delay could possibly be introduced if the natural stream delay is not enough.
Because FFmpeg takes a while to spin up, first photo might miss someone if they run through the door. Solutions might include https://github.com/fsphil/fswebcam for image capture.
Another alternative would be using another pi to stream live video. Because of the stream time delay a request to capture from the stream would inherently capture the moments right before the switch being triggered. An artificial delay could possibly be introduced if the natural stream delay is not enough.