Raspberry Pi / Banana Pi RTSP Player with VLC

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.

  1. Download the image of Armbian Buster with Xfce Desktop and write it to the SD card using Etcher.
  2. Boot the Pi from the SD card and complete the installation. Set user accounts and language options as desired.
  3. 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.
  4. Install VLC:
    su root
    apt-get update
    apt-get upgrade
    apt-get install vlc
  5. Set up automatic login on startup of armbian Xfce:
    nano /etc/lightdm/lightdm.conf.d/11-armbian.conf
    Add the following lines:
    autologin-user=[user]
    autologin-user-timeout=0
  6. Create a script to start the RTSP stream with VLC:
    nano /home/user/stream.sh
    cvlc –fullscreen –network-caching 200 rtsp://[camuser]:[campassword]@192.168.xxx.xxx:[camport]/?inst=2

    Make script executable:
    chmod +x stream.sh
  7. 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.

Leave a Comment