Watcherstream¶
This section explains more in-depth configuration of watcherstream. For installation and basic usage, see Getting Started. The srtg-watcherstream can operate in multiple modes, depending on the users’ needs. Following modes are supported:
default
obs
rtsp
The mode can be selected by adding watcherstream_mode = <mode>
to the top-level
of /etc/srtg/srtg.toml
Default mode¶
The default
mode uploads the player view as-is to Surrogate.tv.
OBS mode¶
If you want to customize your stream further, obs
mode can be used. In this mode,
the srtg-watcherstream
does not generate the stream but instead only uploads a
stream generated by OBS. For example, if you have a separate
PC which you would like to use to modify the watcherstream, this mode can be
utilized for streaming to surrogate.tv.
The srtg-watcherstream does not need any other confiuration except the aforementioned
watcherstream_mode. After changing the mode, run sudo systemctl restart srtg
to
reload the configuration.
OBS needs to be configured to record the stream in HLS format to a specific location. To do so,
Go to
settings->Output
in OBSSet Recording Format to
m3u8
orHLS
(only one of these should be in the dropdown list)Set Recording Path to
/tmp/srtg_hls
Go to
settings->Advanced
Set Filename Formatting under Recording to
main
Turn on Overwrite if file exists under the filename formatting option

After these steps, click Start recording and the stream should soon appear in your game’s page. If there is need to stream to some other service than Surrogate.tv at the same time, OBS supports recording and streaming simultaneously. In that case, setup streaming settings for whichever service you are using according to their instructions.
RTSP mode¶
The RTSP mode can be used when the watcherstream is needed on another machine, e.g. if you are running multiple Raspberry Pi based robots and want to create a sophisticated watcher experience that aggregates streams from multiple robots.
The srtg-watcherstream does not need any other configuration except setting
watcherstream_mode to rtsp. After changing the mode, run
sudo systemctl restart srtg
to reload the configuration.
First, you need to setup OBS. To get the stream as an input into an OBS scene, do the following
Check the Raspi’s local IP from admin panel
Go to your game’s settings page
Select Game Engine tab
Scroll down to the correct robot and copy the IP address from Local Config URL
Add a new
VLC Video Source
.Click the + sign on the right and select
Add Path/URL
.Add the following URL:
rtsp://<local_ip_from_step_1>:8554/unicast

Then you need to setup the stream uploading. The steps for this depend on your platform
Linux¶
On a (Debian based, e.g. Ubuntu, Mint, Debian) Linux, install srtg-watcherstream
by running sudo apt install srtg-watcherstream
. Refer to OBS mode
on the setup.
Windows¶
On a Windows 10 machine, first install Windows Subsystem for Linux 2. Run a Ubuntu 20.04 virtual machine in WSL2 according to the instructions. Once you have an Ubuntu VM running, install watcherstream package. Following commands need to be run:
sudo sh -c 'echo deb https://apt.surrogate.tv/ buster main >> /etc/apt/sources.list'
sudo apt-key adv --keyserver "hkps://keys.openpgp.org" --recv-keys "58278AC826D269F82F1AD74AD7337870E6E07980"
sudo apt-get update
sudo apt install srtg-watcherstream
The setup steps for the stream itself are almost same as in OBS section. Following extra steps need to be done:
Create config directory by running
sudo mkdir /etc/srtg
Create a config file with your choice of editor, e.g.
nano /etc/srtg/srtg.toml
Add
watcherstream_mode = obs
to the config file.Add a game engine section to the config file
[game_engine] url = "https://ge.surrogate.tv/signaling" token = "<token from your admin panel>"
In the OBS settings, instead of setting Recording Path according to OBS instructions, set it to the path pointing to the WSL2. The path should be
\\wsl$\Ubuntu-20.04\tmp\srtg_hls
.
If this path does not work
for some reason, open a file explorer in Windows. Type \\wsl$
to the address
bar and open the directory of the virtual machine. Find directory tmp
and open
it. Finally, open directory srtg_hls
and copy the address found on the address
bar and enter this path to OBS.
After that, because WSL2 machines do not use systemd, you need to manually
run the watcherstream program. To do so, run sudo python3 /usr/bin/srtg-watcherstream
.
Note that this does not run the program as a service and you have to re-run it
always when you reboot your computer or when there is an error.