Selfstream
We first have to start all services, and then we can set up the stream.
There are two ways to run Selfstream-services:
Setting up the services:​
1. Using Docker:​
This is the recommended way to run Selfstream, as it provides an isolated environment and simplifies the setup process. To run Selfstream using Docker, follow these steps:
docker compose -f docker-compose-selfstream.yml up --build
Now you can follow the instructions in the Starting the stream section to start your stream.
2. Starting services locally:​
Warning: This method doesn't insure that the services are running with the correct configuration, so it is recommended to see the logs after each service is started.
If you prefer to run the services locally, you can start each service individually. This method requires more setup and configuration, but it allows for more flexibility in development. To start the services locally, follow these steps:
You have to change the externalAuthenticationURL in the ingest/mediamtx.yml file by uncommenting the the line and changing the URL to http://localhost:8081/api/selfstream/onPublish. This is required for the mediamtx server to authenticate the stream correctly.
-
Start the db and meilisearch first. We use hybrid approach to run db and meilisearch in docker. You can run the following command to start them:
docker start meilisearch mariadb-tumliveinfoIf you don't have them set up, please follow the instructions in the DevSetup guide to set them up.
-
Start the backend. run this command in the
rootgo run ./cmd/tumlive -
Start the frontend:
# in the web/ directorynpm installnpm run build-dev -
Start the runner. Configure the path accordingly: You can set the
STORAGE_PATHandSEGMENT_PATHenvironment variables to point to the correct locations if you don't want to use default ones:# in the rootSTORAGE_PATH=/home/<path-to-cache-location>/storage/mass SEGMENT_PATH=/home/<path-to-cache-location>/dev/storage/live go run runner/cmd/runner/main.go -
Start the worker:
# in the rootgo run ./worker/edge -
Start the
mediamtxserver:# in the rootmediamtx ./ingest/mediamtx.yml
Starting the stream​
After setting up the services you can follow these instructions to start your stream. We recommend using OBS as it has been tested and also used to showcase here:
-
Login to an admin account (
admin,prof1orprof2).In the admin section confirm that the runner is
active -
In the admin section you can either create a new course or use one of the existing ones to create a new lecture. Just fill the required fields and click the create button.
-
After creating the lecture you can click the
show keysbutton to see theURLandkey. Copy them into the streaming software of your choice. -
Change the
tum.ingest.live/tolocalhost/. -
Start streaming, and you should see the stream in the admin section after a few seconds. You can also check the
mediamtxlogs to see if the stream is being ingested correctly.