Settings Reference
All configuration lives in C:\ProgramData\StreamDelay\.env. Changes require a service restart.
Environment Variables#
HLS_DIR=C:\ProgramData\StreamDelay\hls
LOG_DIR=C:\ProgramData\StreamDelay\logs
SRT_INPUT_PORT=9000
CONTROLLER_PORT=8080
SEGMENT_TIME=2
HLS_LIST_SIZE=100
| Variable | Default | Description |
|---|
HLS_DIR | C:\ProgramData\StreamDelay\hls | Directory for HLS segments and playlists |
LOG_DIR | C:\ProgramData\StreamDelay\logs | Directory for service log files |
SRT_INPUT_PORT | 9000 | SRT input port for OBS stream |
CONTROLLER_PORT | 8080 | HTTP port for dashboard and REST API |
SEGMENT_TIME | 2 | HLS segment duration in seconds |
HLS_LIST_SIZE | 100 | Maximum number of segments in the playlist |
STREAM_KEY | live | Stream key identifier |
Port Configuration#
| Port | Protocol | Service | Purpose |
|---|
| 8080 | HTTP | Controller | Dashboard & REST API |
| 8888 | HTTP | MediaMTX | HLS streaming output |
| 9000 | SRT/UDP | MediaMTX | SRT input from OBS |
| 9997 | HTTP | MediaMTX | Management API |
Tuning Segment Duration#
The SEGMENT_TIME setting affects delay precision and disk I/O:
| Value | Delay Precision | Disk I/O | Use Case |
|---|
| 1 | ±1 second | Higher | Precise delay control |
| 2 (default) | ±2 seconds | Moderate | Good balance |
| 4–10 | ±4–10 seconds | Lower | Reduced disk usage |
Tuning Buffer Size#
The HLS_LIST_SIZE determines the maximum achievable delay:
Max delay ≈ HLS_LIST_SIZE × SEGMENT_TIME seconds
| HLS_LIST_SIZE | SEGMENT_TIME | Max Delay |
|---|
| 50 | 2 | ~100 seconds |
| 100 (default) | 2 | ~200 seconds |
| 150 | 2 | ~300 seconds (5 min) |
Configuration Scenarios#
Reduce Latency#
SEGMENT_TIME=1
HLS_LIST_SIZE=200
Increase Maximum Delay#
SEGMENT_TIME=2
HLS_LIST_SIZE=300
Change Ports (Avoid Conflicts)#
SRT_INPUT_PORT=9001
CONTROLLER_PORT=8081
Remember to update OBS URLs after changing ports.
REST API Reference#
Delay Control#
| Method | Endpoint | Body | Description |
|---|
GET | /api/delay/current | — | Get current delay value |
POST | /api/delay/set | {"delay": 60} | Set delay in seconds (0–200) |
POST | /api/delay/increment | {"seconds": 10} | Increase delay |
POST | /api/delay/decrement | {"seconds": 10} | Decrease delay |
POST | /api/delay/reset | — | Reset to default (60s) |
POST | /api/delay/preset/30s | — | Set 30-second delay |
POST | /api/delay/preset/60s | — | Set 60-second delay |
POST | /api/delay/preset/90s | — | Set 90-second delay |
POST | /api/delay/preset/120s | — | Set 120-second delay |
POST | /api/delay/preset/180s | — | Set 180-second delay |
Status & Configuration#
| Method | Endpoint | Description |
|---|
GET | /api/status | System status |
GET | /api/settings | Current settings |
POST | /api/settings | Update settings |
GET | /api/config | Current configuration |
POST | /api/config/update | Update configuration |
HLS Streaming#
| Method | Endpoint | Description |
|---|
GET | /hls/delayed.m3u8 | Delayed HLS playlist |
GET | /hls/*.ts | HLS segments |