Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hashworks/sbf-for-srs
Simple back- and frontend for Simple Realtime Server (SRS)
https://github.com/hashworks/sbf-for-srs
authentication backend frontend mpegts obs rtmp srs
Last synced: about 1 month ago
JSON representation
Simple back- and frontend for Simple Realtime Server (SRS)
- Host: GitHub
- URL: https://github.com/hashworks/sbf-for-srs
- Owner: hashworks
- License: gpl-3.0
- Created: 2022-02-28T19:34:17.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-13T12:47:10.000Z (6 months ago)
- Last Synced: 2024-10-19T22:48:42.605Z (2 months ago)
- Topics: authentication, backend, frontend, mpegts, obs, rtmp, srs
- Language: Python
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SBF(Simple back- and frontend) for SRS
SBF provides a simple configuration, authentication backend server and frontend for [SRS](https://github.com/ossrs/srs).
## Installation
SRSv3, nginx, python, pip and NPM need to be installed on the system.
The AUR provides a [PKGBUILD for Arch Linux](https://aur.archlinux.org/packages/srs): `yay -Syu srs`
```bash
mkdir -p /usr/local/src
cd /usr/local/src
git clone https://github.com/hashworks/sbf-for-srs.git
cd sbf-for-srscp srs{,-backend-server}.service /etc/systemd/system
mkdir -p /etc/srs
cp srs{,-backend-server}.conf /etc/srscp nginx_vhosts.conf /etc/nginx/sites-available/stream.example.net.conf
cd srs-frontend
npm installcd ../srs-backend-server
pip install -r requirements.txt
```Adjust `/etc/srs/srs-backend-server.conf` and `/etc/nginx/sites-available/stream.example.net.conf` according to your liking.
## Components
### Frontend
`srs-frontend` is a HTML5 web-frontend with an MPEG-TS player and a stream key that is adjustable by the URL fragment/hash (f.e. `https://stream.example.net#customkey`, defaults to `public`).
It also provides the direct link to the user (`https://stream.example.net/live/customkey.flv`).
![frontend_with_custom_key](.images/frontend_with_custom_key.png)
### Authentication Backend Server
`srs-backend-server` provides a backend server for SRS that answers the `on-publish` http hook and accepts or denies streams using a provided subnet mask or a list of possible tokens, which can be provided by adding `?token=password` in OBS.
Please note that a VPN network and a subnet mask check should be preferred over tokens since RTMP is unencrypted.
### SRS configuration
`srs.conf` shows an exemplary SRS config. It hosts the frontend in `/usr/local/src/sbf/srs-frontend` on port `57643` and RTMP on its default `1935` and talks to the `srs-backend-server` on `http://127.0.0.1:59354`. It is configured for low latency (2-3s).
`nginx_vhost.conf` shows how to configure a nginx vHost towards SRS.
![obs setting with public key](.images/public_key_with_allowed_ip.png)
![obs setting with custom key and token](.images/custom_key_with_allowed_token.png)