Kodi is not only a media library for movies and TV shows, it can also be used to use a video stream from a surveillance camera to show on screen.
In the past I've been using the ZoneMinder video add-on which connects to a ZoneMinder server. However there are a few problems with this setup:
Although ZoneMinder is the best open source tool for surveillance and ip camera recording, streaming its sources to yet another streaming application (such as Kodi) is definitely not its strength.
While looking for an alternative way to directly display the IP cameras video stream in Kodi without going through ZoneMinder, I found the Surveillance Cameras add-on, which is part of the official Kodi TV add-on repository (= no need to install an additional and unofficial repository).
The big advantage is it does what it says it does: It connects directly to a video stream of an IP camera, without having to go through yet another software or proxy.
The disadvantage: Only three cameras/streams can be configured and there is no multi-view (watch multiple streams at the same time) possible.
Nevertheless, I gave it a go.
In Kodi 18.x (Leia), the add-on can be installed by going to Add-ons -> Download -> Video add-ons and scroll down until Surveillance Cameras shows up. Or use the add-ons search, to find the add-on in the search results.
Once installed, the add-on needs to be configured.
In the add-on settings, the streams can be configured using the Configure button.
The stream configuration is very straight forward.
In the number of cameras one can select the number of cameras (1-3) and then define the stream and location for each camera. The stream in this case is (usually) a rtsp address.
Depending on where and how Kodi runs, it may be easier to manually configure the add-ons settings.xml in a terminal. In my case Kodi runs on a LibreElec system to which I am able to connect with SSH.
The newly created config file for the Surveillance Cameras add-on can be found in /storage/.kodi/userdata/addon_data/plugin.video.ipcams/:
LibreELEC:~ # cat /storage/.kodi/userdata/addon_data/plugin.video.ipcams/settings.xml
<settings>
<setting id="cam1" value="rtsp" />
<setting id="cam2" value="" />
<setting id="cam3" value="" />
<setting id="loc1" value="" />
<setting id="loc2" value="" />
<setting id="loc3" value="" />
<setting id="numcams" value="1" />
</settings>
Here the previous (incomplete) setting for the rtsp path is showing up. This config file can now manually be configured. Here I added two cameras (increased the numcams setting to 2) and defined their streams:
LibreELEC:~ # cat /storage/.kodi/userdata/addon_data/plugin.video.ipcams/settings.xml
<settings>
<setting id="cam1" value="rtsp://user:password@IP.address.camera.one:554/cam/realmonitor?channel=1&subtype=1" />
<setting id="cam2" value="rtsp://user:password@IP.address.camera.two:554/cam/realmonitor?channel=1&subtype=1" />
<setting id="cam3" value="" />
<setting id="loc1" value="Door" />
<setting id="loc2" value="Garage" />
<setting id="loc3" value="" />
<setting id="numcams" value="2" />
</settings>
Note: If a camera requires authentication before the stream is shown, the credentials can be be added in the following style: rtsp://user:password@ip.address.of.camera:554/path/to/video/stream
When launching the add-on again in Kodi, both cameras should now show up with their relevant description (Location):
And finally how the camera stream looks like on screen:
To benefit from a very quick image update and real-time streaming, one should use a lower quality sub-stream of the IP camera. Newer IP cameras often have the possibility to define multiple streams. A primary stream for high quality images (for example for recording or image zooming) and a secondary (or even more) streams with a lower resolution. Forcibly a lower resolution results in less bandwidth and the chances of image delay decreases.
Depending on the camera vendor and model, the paths to the primary and sub streams vary a lot. As my setup runs with IP cameras from Dahua, the stream addresses is the same for all models (IPC-HFW4300S, IPC-HFW1320S, IPC-HFW1420S and IPC-HDBW1320E):
Primary stream: rtsp://user:password@ip.address.of.camera:554/cam/realmonitor?channel=1&subtype=0
Sub (secondary) stream: rtsp://user:password@ip.address.of.camera:554/cam/realmonitor?channel=1&subtype=1
Note the subtype value.
For other cameras the ZoneMinder Wiki is highly recommended. It has a very nice overview of the different video stream addresses for all kinds of camera models.
ck from Switzerland wrote on Sep 26th, 2021:
Hi dvtc, it is more a question of what model your IP camera is. If it has a RTSP stream, you can access the stream via Kodi.
dvtc from wrote on Sep 24th, 2021:
I have an ip camera that access is via the YCC365 Plus cloud app. Do you have any idea how to access through Lobreelec/Kodi?
Thanks!
Claudio Kuenzler from Switzerland wrote on Apr 29th, 2021:
sunba, I used "vim" directly in the Kodi server. If you dont feel at ease on the command line, you can enable the Samba Service in Kodi and then access the XML in a File Explorer (Network Share) and edit it there.
sunba from wrote on Apr 29th, 2021:
How did you "manually configure" that xml file?
AWS Android Ansible Apache Apple Atlassian BSD Backup Bash Bluecoat CMS Chef Cloud Coding Consul Containers CouchDB DB DNS Database Databases Docker ELK Elasticsearch Filebeat FreeBSD Galera Git GlusterFS Grafana Graphics HAProxy HTML Hacks Hardware Icinga Influx Internet Java KVM Kibana Kodi Kubernetes LVM LXC Linux Logstash Mac Macintosh Mail MariaDB Minio MongoDB Monitoring Multimedia MySQL NFS Nagios Network Nginx OSSEC OTRS Office OpenSearch PGSQL PHP Perl Personal PostgreSQL Postgres PowerDNS Proxmox Proxy Python Rancher Rant Redis Roundcube SSL Samba Seafile Security Shell SmartOS Solaris Surveillance Systemd TLS Tomcat Ubuntu Unix VMWare VMware Varnish Virtualization Windows Wireless Wordpress Wyse ZFS Zoneminder