With advanced configuration steps, it is possible to display an RTSP stream on a DAKboard screen using a Raspberry Pi DAKboard OS device with VLC.  This video will only show on the DAKboard OS device and is recommended that the Pi4B or CPU v4 is used for best performance. Non-Pi4B Raspberry Pis will only display RTSP properly in Landscape orientation.  Preview functions on DAKboard.com and other devices will not display the stream.  


For this setup we will be using the following RTSP stream, this is not a continuous stream and your results may vary:
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4



Configuring Your DAKboard OS Device


- Install DAKboard OS per our instructions, you will need DAKboard OS 2.28 or later.  These steps were performed on a Raspberry Pi4B 2GB.


- Access the command line of the DAKboard OS device. This can be done locally on the device with a keyboard and mouse by pressing CTRL+ALT+T to open a terminal or ALT+F4 to close the browser and use the start menu.  Alternatively, you can SSH to the device, if you don't know the credentials you may contact support for them.


- We need to give our startup sequence a VLC command to open our RTSP stream, transcode it, and offer it up locally for the DAKboard screen.  Start by editing the chromium.sh (browser.sh for v3.52 and newer) file using the following commands, which is run on startup when the pi user logs in.

v3.42 and older releases:

    sudo nano /home/pi/startup/chromium.sh

v3.52 and newer releases:

    sudo nano /home/dakboard/startup/browser.sh


The content below after #start stream is the VLC command example we add to the startup sequence, it must occur first, before the chromium browser is opened.



#!/bin/bash 

#start stream
vlc --loop rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 :network-caching=1000 --sout '#transcode{gather:std,vcodec=theo,vb=800,scale=Auto,acodec=vorb,ab=128,channels=2,samplerate=44100} :standard{access=http,mux=mux_ogg,dst=localhost:8080}' :sout-all :sout-keep &

# Start Chromium. This is called from run.sh

if (cat /proc/device-tree/model | grep "Raspberry Pi 4" >/dev/null 2>&1 ;)
then {
echo "Opening Chromium with Pi4 flags";
chromium-browser \
  --window-size=7000,7000 \
  --start-fullscreen \
  --noerrdialogs \
  --incognito \
  --autoplay-policy=no-user-gesture-required \
  --test-type \
  --ignore-certificate-errors \
  --allow-running-insecure-content \
  --check-for-update-interval=1 \
  --simulate-critical-update \
  --use-gl=desktop \
  --enable-features=VaapiVideo-decoder \
  --ignore-gpu-blocklist \
  --enable-gpu-rasterization \
  --kiosk http://localhost/screenload.php
}
elif (cat /proc/device-tree/model | grep "Raspberry Pi Zero" >/dev/null 2>&1 ;) || (cat /proc/device-tree/model | grep "Raspberry Pi 3 Model A" >/dev/null 2>&1 ;) 
then {
echo "Opening Chromium without Pi4 flags";
sleep 15
chromium-browser \
  --window-size=7000,7000 \
  --start-fullscreen \
  --noerrdialogs \
  --incognito \
  --autoplay-policy=no-user-gesture-required \
  --test-type \
  --ignore-certificate-errors \
  --allow-running-insecure-content \
  --check-for-update-interval=1 \
  --simulate-critical-update \
  --use-gl=desktop \
  --kiosk "http://localhost/screenload.php"
}
else {
chromium-browser \
  --window-size=7000,7000 \
  --start-fullscreen \
  --noerrdialogs \
  --incognito \
  --autoplay-policy=no-user-gesture-required \
  --test-type \
  --ignore-certificate-errors \
  --allow-running-insecure-content \
  --check-for-update-interval=1 \
  --simulate-critical-update \
  --use-gl=desktop \
  --kiosk "http://localhost/screenload.php"
}
fi



Let us break down the command a bit to understand how we may need to substitute some details for your specific application:


vlc --loop rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4 :network-caching=1000 --sout '#transcode{gather:std,vcodec=theo,vb=800,scale=Auto,acodec=vorb,ab=128,channels=2,samplerate=44100} :standard{access=http,mux=mux_ogg,dst=localhost:8080}' :sout-all :sout-keep &



Our first bolded text is the RTSP source we shared earlier, you will substitute this with your RTSP URL.  If your URL contains special characters, encapsulate the entire URL in quotation marks "URL".  The second bolded text is the local address for the content, in this case, we are using localhost at port 8080, so as not to conflict with the device configuration page hosted at port 80 on the device.  The 8080 port specification will be significant later when configuring our screen.  You may add additional streams by duplicating the command, adding new RTSP URLs, and utilizing another port, as long as they run before starting Chromium.


The following VLC documents will list the other function of this command in more detail:


https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/

https://wiki.videolan.org/transcode/#Completely_non-interactive_transcoding



Additional Steps for Unifi RTSP Cameras

If your cameras are hosted from Unifi, the streams are only provided in RTSPS. To use it as an RTSP stream, you will need to remove “S” from “RTSPS” and change port 7441 to 7447.


Example: rtsps://192.168.0.1:7441/abcdefghij?enableSrtp   ->    rtsp://192.168.0.1:7447/abcdefghij?enableSrtp

Remove the “?enableSrtp” end string.


Example: rtsp://192.168.0.1:7447/abcdefghij?enableSrtp     ->     rtsp://192.168.0.1:7447/abcdefghij  (final RTSP string)



- Once you have finished editing the file, Press CTRL+X, then Y Enter to save your changes and exit.  We are finished making changes to the DAKboard OS device at this time.


Configuring Your DAKboard Screen


Now we will configure a DAKboard screen with a widget block to display our stream.  Start by adding a new screen or edit an existing in the screens page, then click the green Add button and search for the Widget block:


- In the Widget Block, insert the following HTML, editing port 8080 if you elected to change it earlier on the DAKboard OS configuration steps:

<video id="video" src="http://localhost:8080" autoplay="autoplay" width="100%" height="100%"></video>


- Click save changes and resize accordingly.


- For additional streams, duplicate the block and update the port in the HTML.


Note: This video will only show on the DAKboard OS device with the video locally stored on it.  Preview functions on dakboard.com and other devices will not display the video.



Start The DAKboard OS Device


Set your DAKboard OS device to the configured screen on the Displays & Devices page and reboot the DAKboard OS device.  You will see VLC open and begin the stream and transcoding before the DAKboard screen in the browser initializes.  The video will start pixelated and green initially while it is transcoded, this will normalize.  Some streams can take additional time to transcode and will not be ready immediately, if this is the case you can refresh your DAKboard screen from dakboard.com and the stream will appear as shown:


Having trouble?

- Create a Support Ticket