A Complete, Modern CCTV System with Raspberry Pi (Part III)

Sun Rui
2 min readMar 2, 2019

--

Part I: Architecture Overview

Part II: A Step-by-step Tutorial (with references)

Part III: Evaluation and FAQs

The whole system has a lag of around 6 seconds, although the CPU utilization of any component is quite low, even for my Pi. If you have any thoughts on this, please comment below!

If you want to add more camera nodes to the system, just do the following:

  1. Buy Raspberry Pi’s and RPi Cameras (of course!)
  2. Create client certificate for each new node (or, for simplicity, reuse client certificate, although nor recommended)
  3. Stream each node to a different endpoint, then add cameras in Shinobi. Done!

There are definitely more things to do to make the system scale better, including using cloud storage instead of local disks, such as Amazon S3, Azure Blob Storage, or Google’s equivalent product. We can also use cloud database to make the system more resilient and easier to scale.

FAQs

  • Why RTMP? Why not HLS/some other streaming protocol?

I believe nginx-rtmp-module has “rtmp” in its name for a reason, and I assume it supports RTMP better than other protocols like HLS. This is just my guess.

  • Why RTMP + OpenVPN? Why not RTMPS (RTMP over TLS/SSL)?

Because both RTMP and OpenVPN are mature technologies and have extensive documentation. RTMPS is relatively new and I am not sure the level of support.

  • Why Shinobi? Why not ZoneMinder/Kerberos.io/iSpy?

iSpy only runs on Windows; ZoneMinder and Kerberos.io use PHP, which is a technology I deem as dead. Shinobi uses Node.js and MariaDB (TBH this is another technology I don’t like). They claim in their tweet that PostgreSQL (my favorite!) is also supported, however, I did not find any mention of Postgres in official documentation.

--

--