|
| 1 | +--- |
| 2 | +title: Selfstream |
| 3 | +--- |
| 4 | + |
| 5 | +# Selfstream |
| 6 | + |
| 7 | +We first have to start all services, and then we can set up the stream. |
| 8 | + |
| 9 | +There are two ways to run Selfstream-services: |
| 10 | + |
| 11 | +## Setting up the services: |
| 12 | + |
| 13 | +### 1. **Using Docker**: |
| 14 | + |
| 15 | + 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: |
| 16 | + |
| 17 | + ```bash |
| 18 | + docker compose -f docker-compose-selfstream.yml up --build |
| 19 | + ``` |
| 20 | + |
| 21 | +Now you can follow the instructions in the [Starting the stream](#starting-the-stream) section to start your stream. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +### 2. **Starting services locally**: |
| 26 | + |
| 27 | +:::warning |
| 28 | +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. |
| 29 | +::: |
| 30 | + |
| 31 | +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: |
| 32 | + |
| 33 | +:::info |
| 34 | +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 `meidamtx` server to authenticate the stream correctly. |
| 35 | +::: |
| 36 | + |
| 37 | + - 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: |
| 38 | + |
| 39 | + ```bash |
| 40 | + docker start meilisearch mariadb-tumlive |
| 41 | + ``` |
| 42 | + |
| 43 | + - Start the backend. run this command in the `root` |
| 44 | + |
| 45 | + ```bash |
| 46 | + go run ./cmd/tumlive |
| 47 | + ``` |
| 48 | + |
| 49 | +- Start the frontend: |
| 50 | + |
| 51 | + ```bash |
| 52 | + # in the web/ directory |
| 53 | + |
| 54 | + npm install |
| 55 | + npm run buil-dev |
| 56 | + ``` |
| 57 | + |
| 58 | +- Start the runner. Configure the path accordingly: You can set the `STORAGE_PATH` and `SEGMENT_PATH` environment variables to point to the correct locations if you don't want to use default ones: |
| 59 | +
|
| 60 | + ```bash |
| 61 | + # in the root |
| 62 | + |
| 63 | + STORAGE_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 |
| 64 | + ``` |
| 65 | +
|
| 66 | +- Start the worker: |
| 67 | +
|
| 68 | + ```bash |
| 69 | + # in the root |
| 70 | + |
| 71 | + go run ./worker/edge |
| 72 | + ``` |
| 73 | +- Start the `meidamtx` server: |
| 74 | +
|
| 75 | + ```bash |
| 76 | + # in the root |
| 77 | + |
| 78 | + mediamtx ./ingest/mediamtx.yml |
| 79 | + ``` |
| 80 | +
|
| 81 | +--- |
| 82 | +
|
| 83 | +## Starting the stream |
| 84 | +
|
| 85 | +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: |
| 86 | +
|
| 87 | +1. Login to an admin account (`admin`, `prof1` or `prof2`). |
| 88 | + |
| 89 | + In the admin section confirm that the runner is `active` |
| 90 | +
|
| 91 | +2. 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. |
| 92 | +
|
| 93 | +3. After creating the lecture you can click the `show keys` button to see the `URL` and `key`. Copy them into the streaming software of your choice. |
| 94 | +4. Change the `tum.ingest.live/` to `localhost/`. |
| 95 | +5. Start streaming, and you should see the stream in the admin section after a few seconds. You can also check the `meidamtx` logs to see if the stream is being ingested correctly. |
| 96 | +
|
| 97 | +
|
| 98 | +
|
| 99 | +
|
| 100 | +
|
| 101 | +
|
0 commit comments