Files
42_150/mediamtx.yml
Timmy ce4f9f19bd 調校 MediaMTX 抗閃爍:加大寫入佇列、強制 RTSP 走 TCP
實況偶發「閃一下」,查 journalctl 為應用層問題(非網路):
- reader is too slow → 加 writeQueueSize: 1024(預設 512)吸收瞬時卡頓
- UDP decode errors → rtspTransports: [tcp] 杜絕 UDP 掉包花屏
.103 線上設定已同步並重啟驗證;另補上 init 產生的 CLAUDE.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 20:54:28 +08:00

20 lines
793 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# MediaMTX 設定:把攝影機唯一的 RTSP 串流轉發給多個觀看端
# 用法mediamtx ./mediamtx.yml
# 全域:避免觀看端瞬時吃不下 1080p H.265 時直接丟幀造成的閃爍
writeQueueSize: 1024 # 預設 512加大寫入佇列吸收瞬時卡頓
rtspTransports: [tcp] # 強制 RTSP 走 TCP杜絕 UDP 掉包導致的 H.265 花屏/閃爍
paths:
# 主碼流 H.265 1080p → 對外路徑 /cam
cam:
source: rtsp://192.168.42.150:554/stream1
rtspTransport: tcp
sourceOnDemand: yes # 沒人看時不連攝影機,自動釋放那唯一的連線槽
# 子碼流 H.264 704×576 → 對外路徑 /cam-sub手機/縮圖用)
cam-sub:
source: rtsp://192.168.42.150:554/stream2
rtspTransport: tcp
sourceOnDemand: yes