-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yaml
More file actions
118 lines (94 loc) · 4.95 KB
/
config.yaml
File metadata and controls
118 lines (94 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# TSDuck MPEG-TS Multiplexer Configuration
# =========================================
# This file contains settings that can also be overridden via environment variables.
# Priority: Environment Variable > YAML Config > Hardcoded Default
# =============================================================================
# Network Configuration
# =============================================================================
# TCP port for camera live TS input from FFmpeg SRT container
live_tcp_port: 10000
# TCP port for drone live TS input from FFmpeg RTMP container
drone_tcp_port: 10002
# TCP port for fallback TS input from FFmpeg fallback container
fallback_tcp_port: 10001
# RTMP output URL (internal Docker network address)
# External playback: rtmp://localhost:1935/live/stream (RTMP) or http://localhost:8080/hls/stream.m3u8 (HLS)
rtmp_url: "rtmp://srs/live/stream"
# =============================================================================
# Input Source Configuration
# =============================================================================
# Drone RTMP input URL
# The multiplexer can pull from this RTMP URL when drone input is selected
drone_rtmp_url: "rtmp://srs:1935/publish/drone"
# Input source state file path
# This file persists which input source (camera/drone) is active
# The value is loaded on startup and can be changed via the HTTP API
input_source_file: "/app/shared/input_source.json"
# =============================================================================
# Stream Switching Configuration
# =============================================================================
# DEPRECATED: Replaced by stream health monitoring (see below)
# Maximum gap allowed before switching to fallback (milliseconds)
# If live TS stalls for more than this duration, switch to fallback
max_live_gap_ms: 2000
# =============================================================================
# Stream Health Monitoring
# =============================================================================
# Maximum time without receiving data before considering stream unhealthy (ms)
# Applies to camera, drone, and fallback inputs
# If no data received within this window, multiplexer will switch to fallback
# Env var: MAX_DATA_AGE_MS (default: 3000)
max_data_age_ms: 3000
# Minimum bitrate threshold for healthy stream (bytes per second)
# Set to 0 to disable bitrate checking (only check data age)
# Recommended values:
# - 50000 (50 KB/s ~400 Kbps) for low-bandwidth streams
# - 100000 (100 KB/s ~800 Kbps) for SD streams
# - 200000 (200 KB/s ~1.6 Mbps) for HD streams
# Env var: MIN_BITRATE_BPS (default: 0 = disabled)
min_bitrate_bps: 0
# Window size for bitrate calculation in seconds
# Larger window = smoother average but slower to detect drops
# Smaller window = more responsive but may trigger on brief dips
# Env var: BITRATE_WINDOW_SECONDS (default: 3)
bitrate_window_seconds: 3
# Minimum consecutive live packets required before switching from fallback to live
# Env var: MIN_CONSECUTIVE_FOR_SWITCH (default: 5)
min_consecutive_for_switch: 5
# =============================================================================
# Buffer and Latency Settings
# =============================================================================
# These settings control streaming latency and buffer sizes.
# Lower values = lower latency but potentially less stability.
# All can be overridden via environment variables.
# TCP socket receive buffer size in bytes (kept for backward compat, not used for TCP)
# Higher values prevent packet loss on bursty networks
# Env var: UDP_RCVBUF_SIZE (default: 262144 = 256KB)
udp_rcvbuf_size: 262144
# TS packet queue size - maximum packets per stream queue
# Each packet is 188 bytes, so queue memory = size * 188 bytes
# Reduced from 5000 to 500 for ultra-low latency (~94KB buffer)
# Env var: TS_QUEUE_SIZE (default: 500)
ts_queue_size: 500
# RTMP output pacing delay in microseconds between packets
# Controls how fast packets are sent to FFmpeg
# Set to 0 for no artificial delay (ultra-low latency)
# Env var: RTMP_PACING_US (default: 0)
rtmp_pacing_us: 0
# =============================================================================
# IDR Frame Wait Timeouts
# =============================================================================
# When switching streams, the multiplexer waits for an IDR (keyframe) to ensure
# a clean splice. These timeouts control how long to wait before giving up.
# IDR wait timeout for switching TO live (milliseconds)
# Env var: LIVE_IDR_TIMEOUT_MS (default: 10000)
live_idr_timeout_ms: 10000
# IDR wait timeout for switching TO fallback (milliseconds)
# Fallback typically has 1-second GOPs so this can be shorter
# Env var: FALLBACK_IDR_TIMEOUT_MS (default: 2000)
fallback_idr_timeout_ms: 2000
# =============================================================================
# Logging Configuration
# =============================================================================
# Logging level: DEBUG, INFO, WARN, ERROR
log_level: "INFO"