Blog Archive

Friday 24 May 2013

Using the Raspberry Pi Camera Module with Zoneminder

UPDATE Using raspimjpeg and mjpg-streamer

I have found a MUCH better way to do this. After installing the camera module to the Pi, go to http://www.raspberrypi.org/forums/viewtopic.php?t=63276 and follow those instructions for installing the RPi-Cam-Web-Interface.
When you've done that and got it working, go here and follow the instructions for install MJPG-Streamer . When you've done that, set up your monitor in Zoneminder to point to the stream from MJPG-Streamer, like so:


Bish bash bosh. The framerate and quality from this method are SO much better than the VLC stuff below, which I'll leave for reference.



OLD VLC method - I don't do it like this now.





I got a new Raspberry Pi camera module, plugged it in and took a picture. Marevellous, but now what? I wanted to get it working in Zoneminder which supports all sorts of streaming cameras. It was a bit tricky to get going, but here's how:

After setting up the camera module, I installed VLC on the Pi:

#apt-get install vlc


then in order to stream the video over the network:

#raspivid -o - -t 9999999 -w 320 -h 240  | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554/pi.sdp}' :demux=h264


Setting up Zoneminder isn't obvious. Although cvlc on the Pi is putting out an RTSP stream, the "RTSP" option in the monitor setup in Zoneminder doesn't seem to work. Instead use the "FFMPEG" option


and put the URL "rtsp://ip.address:8554/pi.sdp" into the "Source Path" box.
I think you also need to match the capture height and width to that of the stream; both 320 x 240 in my test case.

Now I just have to setup WiFi on the Pi and I've got a wireless IP camera which in theory supports high definition streaming. Bargain.

SOURCES:

http://www.mybigideas.co.uk/RPi/RPiCamera/
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=43&t=43969

http://www.raspberrypi.org/forums/viewtopic.php?t=48597
http://elinux.org/RPi-Cam-Web-Interface
http://www.raspberrypi.org/forums/viewtopic.php?t=63276