User Tools

Site Tools


software:zoneminder:picamera

This is an old revision of the document!


Raspberry Pi Camera on ZoneMinder

Install v4l2rtspserver on camera

git clone https://github.com/mpromonet/v4l2rtspserver
cd v4l2rtspserver
cmake .
make
sudo make install
v4l2rtspserver.service
# systemd configuration for v4l2rtspserver
# /etc/systemd/system/v4l2rtspserver.service
 
[Unit]
Description=v4l2rtspserver rtsp streaming server
After=network.target
 
[Service]
#ExecStartPre=/usr/bin/v4l2-ctl --set-ctrl vertical_flip=1
ExecStartPre=/usr/bin/v4l2-ctl --set-ctrl h264_i_frame_period=5
ExecStart=/usr/local/bin/v4l2rtspserver -F 5 -W 640 -H 480
#ExecReload=/bin/kill -HUP $MAINPID
Type=simple
User=root
Group=video
Restart=always
 
[Install]
WantedBy=multi-user.target
systemctl start v4l2rtspserver

Zoneminder Configuration

Create a new monitor in ZoneMinder with the following parameters

  • Source Type: Remote
  • Remote Protocol: RTSP
  • Remote Method: RTP/Unicast
  • Remote Host Name: Hostname or IP
  • Remote Host Port: 8554
  • Remote Host Path: /unicast
  • Capture Width: 640
  • Capture Height: 480

You should soon see the output in zoneminder.

Production

For production, change the resolution of both the camera and the ZoneMinder configuration

  1. Edit /etc/systemd/system/v4l2rtspserver.service
    1. Change -W and -H (width and height) to your desired parameters
      1. 1920 x 1080 (1080p) Gives you a lot of details, but also transfers a lot of traffic and is fuzzy
      2. 1280 x 720 (720p) Is a lot lower bandwidth and “prettier” picture
      3. # reload the systemctl daemon
        systemctl daemon-reload
        # reload the config for v4l2rtspserver
        systemctl restart v4l2rtspserver
        # Set v4l2rtspserver to autostart
        systemctl enable v4l2rtspserver
  2. Edit Monitor on ZoneMinder
    1. Set Capture Resolution to same values as camera
software/zoneminder/picamera.1622667786.txt.gz · Last modified: 2021/06/02 16:03 by rodolico