Raspberry Pi camera & Shinobi CCTV

Raspberry Pis make for really good HD CCTV cameras as they're cheap, small and have wifi in the newer iterations. There seem to be two good CCTV recording packages at the moment - Shinobi & MotionEyes. It took some effort to get Shinobi to communicate with the camera on my Raspberry Pi, so this post records what I had to do, for posterity.

If you search on the internet about RaspberryPi cameras and Shinobi you find a bunch of posts talking about setting up an RTSP stream for Shinobi to connect to. And on the Shinobi discord, a developer pointed to None of these instructions worked - I think they may have been for an older version of Raspbian. So firstly lets go through the software versions and hardware versions that I'm dealing with.

The hardware is a Raspberry Pi 3, and a Raspberry Pi ZeroW. Both of these have built in wifi which makes things easier. With these I'm using official Raspberry Pi cameras. I'm using the latest version of Raspbian at the time of writing - Raspbian GNU/Linux 10, and Shinobi ocean-1.

What eventually worked for me was adapted from a couple of web pages, particularly, and involved gst-rpicamsrc and gst-rtsp-server which contained the test-launch programme.

  1. Download and build In the future this will be part of gstreamer (from version 1.18) so you won't need to do this step any more.
  2. Find out your gstreamer (gst) version e.g. with apt search libgstreamer. At the time of writing this is libgstreamer1.0-0/stable 1.14.4-1 armhf. You then need to download the version of gst-rtsp-server that matches your libgstreamer1.0 version. So I downloaded gst-rtsp-server-1.14.4 from and build that.
  3. sudo apt install gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-plugins-rtp
  4. gst-rtsp-server provides a utility called test-launch. It sets up an rtsp server. I manually ran this with test-launch ( rpicamsrc bitrate=8000000 awb-mode=auto preview=false rotation=180 ! video/x-h264, width=960, height=540, framerate=10/1 ! h264parse ! rtph264pay name=pay0 pt=96 ). This command had a resolution for a v1 camera. If you use a v2 camera you will want to choose a different resolution. I found this page to be useful for understanding the modes available.
  5. I then was able to configure Shinobi to connect to rtsp://CAMERA_IP:8554/test.
  6. The final setup was to install test-launch as a permanent background task in systemd. Put a file with the following contents into /etc/systemd/system called e.g. cam-stream.service then run systemctl start cam-stream && systemctl enable cam-stream.

Description=auto start cam stream
ExecStart=/home/xxx/bin/test-launch ( rpicamsrc bitrate=8000000 awb-mode=auto preview=false rotation=180 ! video/x-h264, width=960, height=540, framerate=10/1 ! h264parse ! rtph264pay name=pay0 pt=96

By ff

Systems software engineer with interests in C/C++/Rust on Linux, electronic music and games.

5 replies on “Raspberry Pi camera & Shinobi CCTV”

Did you install the rpi camera/gstreamer on the same rpi as where Shinobi is installed? Or is that just not possible?

In my config I had shinobi installed on an x86 machine elsewhere in my house, and just the camera/stream installed on the raspberry pis. I haven't tried running shinobi itself on rpis so I can't comment on how well this configuration would work.

Could you update this? I was unable to figure how to build gst-rtsp-server, but I found the libgstrtspserver-1.0-0 package, so I hoped I could use that. In either case, whatever provides test-launch, I don't have it yet.

Leave a Reply

Your email address will not be published. Required fields are marked *