TABLE OF CONTENTS


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 for sampling purposes, this is not a continuous stream and your results may vary:
rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mp4


Your RTSP steam should be configured in the lowest resolution possible from the camera or NVR, increase the quality after completing the setup as needed.  Delays in streaming or failure to display the stream are normally due to poor network connectivity or too high of a resolution used.



Configuring Your DAKboard OS Device:


- Install DAKboard OS per our instructions on the latest version.  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 after Configuring SSL and SSH on the device configuration page.


- 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 run.sh, file using the following commands, which are run on startup when the pi user logs in.
sudo nano /home/dakboard/startup/run.sh


Place the VLC command right before the browser.sh script in the file as shown:


#!/bin/bash

#------OTHER DAKBOARD SCRIPTS WILL BE HERE-------

#####PLACE RTSP VLC COMMANDS HERE#####
cvlc --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 browser.sh in the background
/home/dakboard/startup/browser.sh



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


cvlc --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 functions 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.  A reboot will be needed to start your configuration when ready.


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 one on 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: