From 457c5c89c9885b5fd46657de5f06cb6557d035dc Mon Sep 17 00:00:00 2001 From: ComputerTech Date: Sat, 4 Apr 2026 13:35:45 +0100 Subject: [PATCH] fix: correct MediaMTX v1.x config syntax (runOnReady, top-level flags) --- setup_mediamtx.sh | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/setup_mediamtx.sh b/setup_mediamtx.sh index 8d6bf5a..a217b06 100755 --- a/setup_mediamtx.sh +++ b/setup_mediamtx.sh @@ -65,30 +65,27 @@ sudo tee "$MEDIAMTX_CONF" > /dev/null << YAMLEOF logLevel: info logDestinations: [stdout] -# Disable unused protocols (top-level flags for MediaMTX v1.x) -rtmpDisable: true -webrtcDisable: true +# Disable unused protocols +rtmp: false +webrtc: false -# HLS output — listeners access the stream here -hls: - address: :${HLS_PORT} - # Keep a short segment list so listeners tune in quickly - segmentDuration: 2s - partDuration: 200ms - segmentMaxAge: 30s +# HLS output +hlsAddress: :${HLS_PORT} +hlsVariant: lowLatency +hlsSegmentDuration: 1s +hlsPartDuration: 200ms -# SRT input — DJ streams here via OBS -srt: - address: :${SRT_PORT} +# SRT input +srtAddress: :${SRT_PORT} # Paths paths: ${SRT_PATH}: - runOnPublish: >- + runOnReady: >- curl -s -X POST http://127.0.0.1:${LISTENER_PORT}/api/webhook -H "Content-Type: application/json" -d "{\"event\":\"publish\",\"path\":\"${SRT_PATH}\",\"source\":{\"remoteAddr\":\"\$MTX_QUERY\"}}" - runOnUnpublish: >- + runOnNotReady: >- curl -s -X POST http://127.0.0.1:${LISTENER_PORT}/api/webhook -H "Content-Type: application/json" -d "{\"event\":\"unpublish\",\"path\":\"${SRT_PATH}\"}"