-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmediamtx.dev.yml
More file actions
136 lines (123 loc) · 5.44 KB
/
Copy pathmediamtx.dev.yml
File metadata and controls
136 lines (123 loc) · 5.44 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# ##############################################
# MediaMTX config for LOCAL DEV ONLY
# ##############################################
#
# This mirrors the base settings of the shipped `mediamtx.yml` (API, HLS,
# WebRTC, recording defaults, the `all_others` catch-all) and then adds a
# diverse fleet of named paths so `pnpm dev` exercises the whole feature
# surface: multiple codecs, audio/none, mixed resolutions, always-on vs
# on-demand vs offline, named-entry vs wildcard-backed, and a per-path
# record override.
#
# The streams here are generated by MediaMTX itself via `runOnInit` /
# `runOnDemand`, which is why dev uses the `bluenviron/mediamtx:*-ffmpeg`
# image (see docker-compose.dev.yml) — the stock image is FROM scratch and
# has no ffmpeg. The `stream1`..`stream5` cards you also see come from the
# separate `examples/fake-streams` publisher; those ride `all_others` and
# stay wildcard-backed (confName `all_others`) on purpose — that is the
# normal case the app is built around (ADR 0002) and what the e2e suite
# drives, and a wildcard-backed path can only be published from outside
# this config.
#
# Keep the base settings below — api, hls, webrtc, webrtcAdditionalHosts,
# pathDefaults, the `all_others` catch-all — in sync with `mediamtx.yml`, which
# carries the matching pointer back here. There is no include/merge mechanism,
# so the two copies only stay together by hand.
# API settings
api: yes
apiAddress: :9997
authInternalUsers:
- user: any
ips: []
permissions:
- action: api
- action: metrics
- action: pprof
- action: playback
- action: read
- action: publish
# HLS settings
hls: yes
hlsAddress: :8888
# WebRTC settings (WHEP playback)
webrtc: yes
webrtcAddress: :8889
# Owned by docker-compose.dev.yml via MTX_WEBRTCADDITIONALHOSTS
# (${REMOTE_MEDIAMTX_HOST:-127.0.0.1}) — see mediamtx.yml for why this stays
# commented out rather than living here.
# webrtcAdditionalHosts: [127.0.0.1]
# Recording is on by default; individual paths below override it to exercise
# the effective-vs-inherited record indicator.
pathDefaults:
record: yes
recordPath: /recordings/%path/%Y-%m-%d_%H-%M-%S
paths:
# ---- Named, always-on (runOnInit publishes to the path itself) ----------
# The "hero" camera: full-HD H264 + AAC. Named entry (confName: front-door),
# so it exercises the own-entry branch while still inheriting record: yes.
front-door:
runOnInit: >
ffmpeg -re -f lavfi -i testsrc=size=1920x1080:rate=30
-f lavfi -i sine=frequency=440:sample_rate=48000
-c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -g 60
-c:a aac -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnInitRestart: yes
# ---- Named, on-demand (runOnDemand fires on first viewer) ---------------
# Idle until played: card shows no codecs / not-ready, then goes live on
# Play and closes 15s after the last viewer leaves.
warehouse-cam:
runOnDemand: >
ffmpeg -re -f lavfi -i testsrc=size=1920x1080:rate=30
-f lavfi -i sine=frequency=523:sample_rate=48000
-c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -g 60
-c:a aac -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnDemandRestart: yes
runOnDemandCloseAfter: 15s
# H265/HEVC, no audio. HEVC isn't universally WebRTC-playable, so this also
# exercises the playback fallback path.
parking-lot:
runOnDemand: >
ffmpeg -re -f lavfi -i mandelbrot=size=1280x720:rate=25
-c:v libx265 -preset ultrafast -x265-params keyint=50 -pix_fmt yuv420p
-f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnDemandRestart: yes
runOnDemandCloseAfter: 15s
# M-JPEG + a per-path record override. MediaMTX ingests M-JPEG over RTSP but
# neither WebRTC nor HLS can play it, so its card shows the M-JPEG codec chip
# and an unsupported-playback state. record: no proves the override wins over
# pathDefaults.record: yes in the card's recording indicator.
loading-dock:
record: no
# -huffman 0 forces standard Huffman tables, which MediaMTX's RTSP M-JPEG
# (RFC 2435) requires — the default optimized tables get rejected.
runOnDemand: >
ffmpeg -re -f lavfi -i testsrc=size=640x480:rate=15
-c:v mjpeg -q:v 5 -huffman 0 -pix_fmt yuvj420p
-f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnDemandRestart: yes
runOnDemandCloseAfter: 15s
# H264 + Opus, low-res. Opus is WebRTC-native, so this one plays with audio
# over WHEP.
rooftop:
runOnDemand: >
ffmpeg -re -f lavfi -i testsrc2=size=854x480:rate=25
-f lavfi -i sine=frequency=660:sample_rate=48000
-c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -g 50
-c:a libopus -f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnDemandRestart: yes
runOnDemandCloseAfter: 15s
# H265, no audio, on-demand.
garage-bay:
runOnDemand: >
ffmpeg -re -f lavfi -i smptebars=size=1280x720:rate=20
-c:v libx265 -preset ultrafast -x265-params keyint=40 -pix_fmt yuv420p
-f rtsp rtsp://localhost:$RTSP_PORT/$MTX_PATH
runOnDemandRestart: yes
runOnDemandCloseAfter: 15s
# ---- Named, offline (declared but no source) ----------------------------
# Never goes ready: exercises the offline / "no snapshot yet" placeholder and
# the Play-with-no-stream path.
service-elevator:
# ---- Wildcard catch-all -------------------------------------------------
# Backs stream1..5 (from examples/fake-streams) and anything else published.
all_others: