Thought this may be worth a mention ...

Basically a Raspberry Pi streaming 4 RTSP video feeds from my IP cameras (3 UniFi UVC Cameras, 1 RevoTech PoE IP Camera).

This has saved me a world of pain as I originally planned to host a 'video' server (desktop or VM running Windows then simply full-screening the feeds in Chrome etc) then pipe that display over CAT6 to HDMI adapters to the several TVs around the house

NOTES: Ended up using a RasPi 3B as I was conscious that it may be a bit power hungry. I'll capture some stats and may end up trying it on a RasPi Zero W (have a few about) if it looks promising. It doesn't run too bad on WiFi either!

The setup was relatively easy, all the details are here but I thought I'd give an attempt at a guide so here we go ...

Things you'll need:

  • Raspberry Pi 3B/3B+ (not to mention SD card, HDMI and USB cable)
  • Latest Raspbian Lite OS
  • CCTV/IP Cameras capable of RTSP streaming
  • TV/Monitor

Recommended setup/tools:

This guide is for peeps using Windows OS ... Linux an Mac guide at a later date


Setting up your Raspberry Pi

  1. Open Etcher, select the Raspbian Lite .zip file, choose the designated SD card and finally click Flash! (The drive may be 'ejected' at the end of the flash, reinsert it and ensure you can see 'boot' as a drive for the next step)

  2. To enable SSH for headless control, create a blank file called 'ssh' and place it in the root folder of the SD card (boot)

  3. If your planning to use Ethernet for network then skip this step...
    Create a file called 'wpa_supplicant.conf' and insert the following code, ensuring you enter your deets for 'country', 'ssid', 'psk' and 'key_mgmt':

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="yourrealwifissid"
    scan_ssid=1
    psk="yourrealpassword"
    key_mgmt=WPA-PSK
}
  1. Safely eject the SD card and insert it into your RasPi and boot up.

  2. As this is a headless install, we will need to identify the IP address assigned to the Pi to SSH in. There are a few ways to figure this out:

    • Head to your routers GUI/backend and find it there
    • Use a mobile app like Fing (AOS/iOS)
    • Use Nmap
  3. Open PuTTY and using the IP address of the Pi, enter pi@myipaddress for the hostname and click Open

  4. Press Yes on the initial security message, and enter the password: raspberry

  5. Once logged in, you'll need to run:
    sudo apt-get update
    sudo apt-get dist-upgrade
    sudo rpi-update
    sudo reboot

  6. Hops back onto the Pi once it has rebooted and run the following: sudo raspi-config

Currently your Pi is running with default settings, lets change that:

  • Change the default password for the pi user (use a strong password)
  • Set the hostname (something simple, short and easy to remember)
  • Boot Options > Desktop / CLI > Console
  • Boot Options > Wait for Network at Boot > Yes
  • Advanced Options > Expand Filesystem
  • Advanced Options > Memory Split > 256
  • Press right arrow twice then Finish
  1. One final reboot after that and we are ready in setup displaycameras

Now we have setup our Raspberry Pi, we can begin installing and configuring displaycameras!

Handy Tip:

At this point after a setup, I usually setup SSH keys using PuTTY to save the hassle of logging into the Pi at a later date.
Another handy tip ... Get a password manager to store your logins.
And the ulimate last tip? ... Don't forget your password for your password manager as you may need to repeat this guide


Installing/Configuring displaycameras

Now we have a fresh RasPi setup and ready, lets do the dirty

  1. Assuming your still SSH'ed in, go to your home directory (cd ~)
  2. Download the latest build by running:
# Download the latest build
wget https://github.com/Anonymousdog/displaycameras/archive/master.tar.gz

# Unpack the file
tar -xvzf ./<source_code.tar.gz>
cd ./<source_code directory>

# Next make the installer executable
chmod +x ./install.sh

# Good stuff. Lets finally run the install.sh
sudo ./install.sh
  1. Almost done. Afer the install is done, you can read the README for more info
  2. If you can't be arsed, lets copy some files over locally to edit. The two in question are:
  • displaycameras.conf

If your lazy, copy over the attached file, however there 5 settings you'll need to change/check if you can be arsed sudo nano etc/displaycameras/displaycameras.conf

blank="true"
omx_timeout=60
startsleep=8
feedsleep=4
retry=10
  • layout.conf.default

This took me some time and tweaking to get running, going to be honest, it was late, I can't remember how I got it working. This layout will provide a 2 x 2 view, you should only need to change the RTSP URLs:

camera_feeds=( \
# Mid-Res feeds are slightly downscaled to 960x540
# "rtsp://xxx.xxx.xxx.xxx:7447/yyyyyyyyyy_1" \
#cam1
"rtsp://CAM_IP_DEETS" \
#cam2
"rtsp://CAM_IP_DEETS" \
#cam3
"rtsp://CAM_IP_DEETS" \
#cam4
"rtsp://CAM_IP_DEETS" \
)
  1. Cool beans. Files edited and ready to transfer. This is where WinSCP comes to hand (by all means, if you don't want to use WinSCP, you can edit each file manually via sudo nano /etc/displaycameras/...). Fire up WinSCP and start a New Session.

  2. Enter the deets, pi@CAM_IP, password, and a way we go (click Login). You should have your local machine on left and Pi on the right. Navigate to etc/displaycameras and drag the two editted file over

  3. That's it. All done. Nice. Now we can power down the Pi (sudo shutdown -h now) and connect it to a monitor/TV via HDMI

  4. Power up that Pi and observe ... Here we have a Raspberry Pi, waking up for the second time today, checking over those new instructions, and now, hopefully, if I have wrote this correctly, and without too many spelling mistakes, the four feeds should start to populate the display.

Troubleshooting

I can't take credit for this handy script, nor know all the answers if issues arise. At least this time I am documenting this stuff!
Check the chaps Github for all the install/config/guide goodness.
However I won't leave you hanging ... If your feeds won't load, try the following:

# Shows if the service is running
sudo systemctl status displaycameras

# If not, give it a restart
sudo systemctl restart displaycameras

# Should you want to stop it manually
sudo systemctl stop displaycameras

# And then bring it back up
Start
sudo systemctl start displaycameras