I have developed a system (Raspbian / Python) with detects someone's presence through a PIR sensor and records a 15' video with a Pi NoIR camera.
This is command I call to record the video:
Popen(["raspivid", "-w", "800", "-h", "600", "-t", "15000", "-o", fullpath, "-n", "-rot", "270"], stdout=PIPE, stderr=PIPE)
It works fine for a while, but after some hours the camera doesn't record anymore nor return any error. The problem is then just fixed when I restart my Raspberry Pi.
I tried taking a picture when the error occurred, but no success, meaning neither a picture nor a message error at all...
raspistill -o test.jpg
I checked the memory status (45%) and CPU usage as well (66%). So there are enough resources available... The RPi is also "well" powered since the red light stays on all the time (even when recording...)
It doesn't matter if I use the picamera library via Python or call raspivid via Popen.
My questions are: - What can I do to avoid the camera to stop working? - Is there a way to restart / reset the camera without having to restart the Pi?