SRT Live Server (sls) is a low latency streaming server that is using SRT (Secure Reliable Transport). This fork includes a secure REST API with authentication, SQLite database storage, and rate limiting for production use.
- SRT Protocol Support: Low latency streaming with SRT
- Secure REST API: Authentication with API keys and rate limiting
- SQLite Database: Persistent storage for stream IDs and configuration
- Access Logging: Complete audit trail of API usage
- Docker Support: Easy deployment with docker-compose
- Dynamic end-to-end Latency: Latency can be determined by the client
- Clone the repository:
git clone https://github.com/OpenIRL/srt-live-server.git
cd srt-live-server- Start with docker-compose:
docker-compose up -d- Check the logs for the admin API key:
docker-compose logs | grep "admin API key"You'll see something like:
Generated default admin API key: AbCdEfGhIjKlMnOpQrStUvWxYz123456
IMPORTANT: Save this key securely. It will not be shown again.
4000/udp: Publisher port (SRT input)4001/udp: Player port (SRT output)8080/tcp: HTTP API port
See API.md for complete API documentation.
- Add a stream mapping:
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"publisher":"studio","player":"live"}' \
http://hostname:8080/api/stream-ids- List all streams:
curl -H "Authorization: Bearer YOUR_API_KEY" \
http://hostname:8080/api/stream-ids- Get stream statistics:
curl http://hostname:8080/stats/liveThe stats endpoint returns publisher metrics. When using SRTLA (link aggregation), per-peer connection stats are included:
{
"status": "ok",
"publisher": {
"bitrate": 8000,
"throughput": 8300,
"rtt": 15.5,
"buffer": 2920,
"dropped_pkts": 30,
"uptime": 3600,
"latency": 3000,
"peers": [
{
"connection_id": "a3f2b1c0",
"bitrate": 5000,
"throughput": 5200,
"jitter": 1.2,
"uptime": 3600
},
{
"connection_id": "7e4d9f12",
"bitrate": 3000,
"throughput": 3100,
"jitter": 4.8,
"uptime": 3580
}
]
}
}| Field | Description |
|---|---|
connection_id |
Anonymized identifier per SRTLA connection (stable per session) |
bitrate |
Usable payload bitrate in kbps for this connection (updated every 1s) |
throughput |
Total network throughput in kbps including retransmissions; publisher.throughput is the sum across all connections |
jitter |
Smoothed network jitter in milliseconds (RFC 3550 EWMA, lower = more stable) |
uptime |
Connection uptime in seconds |
The peers array is only present when SRTLA connections are active.
Deprecated: The
legacy=1query parameter returns the old stats format (underpublishers.live, withoutpeers) for compatibility with older clients such as NOALBS < 2.14.0. It is deprecated and will be removed in a future release — migrate to the default format above. Responses tolegacy=1requests include aDeprecation: trueheader.
srt://hostname:4001?streamid=publisher_id
srt://hostname:4000?streamid=player_id
- Change Default API Key: The default admin key should be changed immediately
- Use HTTPS: In production, use a reverse proxy with SSL/TLS
- Network Security: Restrict API access to trusted networks
- Regular Backups: Backup the SQLite database regularly
- Monitor Logs: Check access logs for suspicious activity
Create publisher and player id using the api:
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"publisher":"publisher_id","player":"player_id"}' \
http://hostname:8080/api/stream-idsffmpeg -re -f lavfi -i testsrc2=size=640x360:rate=25 -f lavfi -i sine=frequency=1000:sample_rate=48000 -c:v libx264 -preset ultrafast -tune zerolatency -c:a aac -f mpegts "srt://hostname:4001?streamid=publisher_id"
Receive it with OBS or VLC: srt://hostname:4000?streamid=player_id
For issues and feature requests, please use the GitHub issue tracker.
This project is licensed under the MIT License - see the LICENSE file for details.