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?


  • 1
    You say, "stops working", but what happens if you run raspistill -o test.jpg at that point? Is there no error but no picture? Maybe you should put some relevant code in here so someone can at least suggest a further strategy for debugging the issue. – goldilocks Jan 21 '15 at 15:27
  • I will try and post it here – user22948 Jan 21 '15 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy