Files
podsteadr/mediamtx/mediamtx.yml
T

68 lines
2.4 KiB
YAML
Raw Normal View History

# MediaMTX configuration for podsteadr.
# Ingest: RTMP (OBS) + WebRTC/WHIP (browser). Output: HLS. Publish auth is
# delegated to podsteadr via HTTP; stream status is polled from the API.
logLevel: info
api: yes
apiAddress: :9997
# ---- authentication ------------------------------------------------------
authMethod: http
authHTTPAddress: http://podsteadr-app:8095/api/mediamtx/auth
authHTTPExclude:
- action: api
- action: metrics
- action: pprof
# ---- protocols -----------------------------------------------------------
rtsp: no
srt: no
moq: no
rtmp: yes
rtmpAddress: :1935
hls: yes
hlsAddress: :8888
# Switched from mpegts back to lowLatency (2026-08-11): mpegts can only mux
# H264, and browser (WHIP) publishing sends VP8/VP9 depending on the
# machine's available encoders — confirmed live, mpegts crashed with "the
# MPEG-TS variant of HLS supports H264 video only" for a VP9 browser stream.
# lowLatency supports AV1/VP9/H265/H264/Opus, so it's required for browser
# publishing to produce any HLS output at all.
#
# Known risk: this is the variant that was moved AWAY from earlier — LL-HLS's
# small per-part buffering window has very little tolerance for B-frame
# reordering (common in most OBS encoder presets), and a real OBS test
# stream crashed the muxer twice in ~2 minutes with "too many reordered
# frames" / "unable to extract DTS" once frame timing got even slightly
# irregular. If that recurs, the real fix is running two MediaMTX instances
# (mpegts for RTMP/OBS, lowLatency for WHIP/browser) since hlsVariant is a
# global setting with no per-path override — not flipping back and forth.
hlsVariant: lowLatency
hlsAlwaysRemux: yes
hlsAllowOrigins: ["*"]
webrtc: yes
webrtcAddress: :8889
webrtcLocalUDPAddress: :8189
webrtcAllowOrigins: ["*"]
# webrtcAdditionalHosts is set via MTX_WEBRTCADDITIONALHOSTS in
# docker-compose.yml (MEDIAMTX_WEBRTC_HOST in .env) — see the comment there
# for why it must be the raw IP, not the Cloudflare-proxied domain.
# ---- recording -----------------------------------------------------------
pathDefaults:
record: yes
recordPath: /recordings/%path/%Y-%m-%d_%H-%M-%S-%f
recordFormat: fmp4
recordPartDuration: 1s
recordSegmentDuration: 1h
recordDeleteAfter: 168h
paths:
# Streams live at live/<streamId>; publish requires the stream secret,
# which podsteadr checks in the auth webhook.
"~^live/[A-Za-z0-9]+$": {}