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
VariableDefaultDescription
HLS_DIRC:\ProgramData\StreamDelay\hlsDirectory for HLS segments and playlists
LOG_DIRC:\ProgramData\StreamDelay\logsDirectory for service log files
SRT_INPUT_PORT9000SRT input port for OBS stream
CONTROLLER_PORT8080HTTP port for dashboard and REST API
SEGMENT_TIME2HLS segment duration in seconds
HLS_LIST_SIZE100Maximum number of segments in the playlist
STREAM_KEYliveStream key identifier

Port Configuration

PortProtocolServicePurpose
8080HTTPControllerDashboard & REST API
8888HTTPMediaMTXHLS streaming output
9000SRT/UDPMediaMTXSRT input from OBS
9997HTTPMediaMTXManagement API

Tuning Segment Duration

The SEGMENT_TIME setting affects delay precision and disk I/O:

ValueDelay PrecisionDisk I/OUse Case
1±1 secondHigherPrecise delay control
2 (default)±2 secondsModerateGood balance
4–10±4–10 secondsLowerReduced disk usage

Tuning Buffer Size

The HLS_LIST_SIZE determines the maximum achievable delay:

Max delay ≈ HLS_LIST_SIZE × SEGMENT_TIME seconds
HLS_LIST_SIZESEGMENT_TIMEMax Delay
502~100 seconds
100 (default)2~200 seconds
1502~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

MethodEndpointBodyDescription
GET/api/delay/currentGet 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/resetReset to default (60s)
POST/api/delay/preset/30sSet 30-second delay
POST/api/delay/preset/60sSet 60-second delay
POST/api/delay/preset/90sSet 90-second delay
POST/api/delay/preset/120sSet 120-second delay
POST/api/delay/preset/180sSet 180-second delay

Status & Configuration

MethodEndpointDescription
GET/api/statusSystem status
GET/api/settingsCurrent settings
POST/api/settingsUpdate settings
GET/api/configCurrent configuration
POST/api/config/updateUpdate configuration

HLS Streaming

MethodEndpointDescription
GET/hls/delayed.m3u8Delayed HLS playlist
GET/hls/*.tsHLS segments