I'm looking to find the best way to have 24/7 recording (and possibly streaming) with the Camera Module.
Especially since the other night someone stole some stone flags from my neighbours yard I want to setup some video surveillance. Luckily I did have an RPi taking photos every minute so the thieves were caught on camera.
The new full FOV modes make things much better in terms of what I can see, that paired with a cheap wide-angle magnetic lens makes the FOV perfect.
I've currently got a very basic script to record 30 second clips to an SMB share which just loops.
I'm using a 512MB model B.
Code: Select all
#!/bin/bash # PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin while true do curryear="`date +%Y`" currmonth="`date +%Y-%m`" currday="`date +%Y-%m-%d`" currhour="`date +%H`" unix="`date +%s`" mkdir -p /mnt/server/rpivideo/$curryear/$currmonth/$currday/$currhour /opt/vc/bin/raspivid -o /mnt/server/rpivideo/$curryear/$currmonth/$currday/$currhour/video-$unix.h264 -t 30000 -b 5000000 -w 1296 -h 976 -ex night done
My question is, whilst my script works it seems very crude, would anyone recommend a better method?
Also, there's been times where something has crashed causing the camera to not open giving the usual mmal errors requiring a reboot. I'd love to be able to avoid that if possible.
Avoiding gaps between clips would be great too but I realise that might not be totally possible.