MTX_WEBRTCADDITIONALHOSTS (the ICE host candidate MediaMTX advertises for WebRTC/WHIP) was wired to PUBLIC_HOST, the Cloudflare-proxied domain. The WHIP HTTP handshake (SDP offer/answer through nginx) still succeeds through Cloudflare, so 'stream from this browser' looks like it works — but the actual media is a raw UDP path (port 8189) that Cloudflare never forwards regardless of port, same as the earlier RTMP issue. The browser ends up trying to send video/audio to Cloudflare's edge, which drops it, so nothing ever actually arrives. Split into a dedicated MEDIAMTX_WEBRTC_HOST env var (raw origin IP in production) instead of reusing PUBLIC_HOST, mirroring how MEDIAMTX_RTMP_PUBLIC already does this for the same reason. Confirmed via podman inspect that the previously-deployed container really was resolving MTX_WEBRTCADDITIONALHOSTS to the Cloudflare-proxied hostname before this fix.
59 lines
1.9 KiB
YAML
59 lines
1.9 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
|
|
# Standard HLS, not lowLatency: 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 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. Standard HLS buffers a full
|
|
# segment before finalizing, which absorbs that jitter — a few extra seconds of latency
|
|
# instead of intermittent muxer crashes / viewer buffering.
|
|
hlsVariant: mpegts
|
|
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]+$": {}
|