How can you bring the RTSP video stream from surveillance cameras to screens with as little delay as possible using inexpensive hardware? One possible solution is VLC on a Raspberry Pi or Banana Pi with the armbian operating system. The instructions work with both single-board computers in the cheapest edition and can certainly be adapted for other Pi-like computers.
The VLC version as a package for armbian Bullseye has problems with RTSP streams at the time of writing this post. Therefore armbian Buster is used. Installing VLC using snap is not yet possible, there is no package for the ARM architecture. Therefore the version of the package maintainer is used, which can play RTSP streams.
- Download the image of Armbian Buster with Xfce Desktop and write it to the SD card using Etcher.
- Boot the Pi from the SD card and complete the installation. Set user accounts and language options as desired.
- Run armbian-config and set processor to performance mode. If necessary, set Fixed IP and use nano /etc/ssh/sshd_config to configure the SSH server so that the Pi can later be managed remotely without a mouse and keyboard.
- Install VLC:
apt-get install vlc
- Set up automatic login on startup of armbian Xfce:
Add the following lines:
- Create a script to start the RTSP stream with VLC:
cvlc –fullscreen –network-caching 200 rtsp://[camuser]:[campassword]@192.168.xxx.xxx:[camport]/?inst=2
Make script executable:
chmod +x stream.sh
- Add script via graphical desktop in settings as autostart object.
Now every time the system starts, the user is automatically logged in and the stream of the surveillance camera is displayed with VLC as full screen on the monitor connected via HDMI. Since VLC is invoked using cvlc and not vlc, no control buttons appear but a minimalistic view. The reduced cache ensures less delay between reality and the image of the surveillance camera.