mpegts (moved to earlier for OBS B-frame stability) only supports H264. Browser (WHIP) publishing sends VP8 or VP9 depending on the machine's available encoders, which mpegts can't mux at all — confirmed live, 'the MPEG-TS variant of HLS supports H264 video only' crash loop. lowLatency supports the broader codec set browser publishing actually needs. Real risk, not resolved by this alone: lowLatency is what caused the original OBS B-frame muxer crashes this session already fixed once by moving to mpegts. If that recurs, the correct fix is two MediaMTX instances (one per hlsVariant) since it's a global, not per-path, setting — not flip-flopping between the two.
68 lines
2.4 KiB
YAML
68 lines
2.4 KiB
YAML
# 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]+$": {}
|