add mediamtx

This commit is contained in:
2026-04-27 14:12:30 +00:00
parent 1f713b6887
commit b978a83ec8
3 changed files with 104 additions and 1 deletions
+4 -1
View File
@@ -21,4 +21,7 @@ dist-ssr
*.ntvs*
*.njsproj
*.sln
*.sw?
*.sw?
api/.venv/
api/__pycache__/
+13
View File
@@ -0,0 +1,13 @@
services:
mediamtx:
image: bluenviron/mediamtx:1-ffmpeg
container_name: mediamtx
ports:
- 9997:9997/tcp
- 8554:8554/tcp
- 8889:8889/tcp
- 8189:8189/udp
volumes:
- ./mediamtx.yml:/mediamtx.yml
- ./recordings:/recordings
restart: unless-stopped
+87
View File
@@ -0,0 +1,87 @@
############################################
# GENERAL
############################################
logLevel: info
############################################
# Bật tắt API
############################################
api: true
apiAddress: :9997
############################################
# RTSP
############################################
rtsp: true
rtspAddress: :8554
rtspTransports: [tcp] # tối ưu cho IP camera
############################################
# HLS
############################################
hls: false
hlsAddress: :8888
hlsVariant: lowLatency
hlsSegmentDuration: 1s
hlsPartDuration: 200ms
############################################
# WEBRTC
############################################
webrtc: true
webrtcAddress: :8889
webrtcLocalUDPAddress: :8189
webrtcAdditionalHosts:
- 192.168.88.3
############################################
# PLAYBACK (optional - có thể bật sau)
############################################
playback: false
############################################
# PATH DEFAULTS (QUAN TRỌNG NHẤT)
############################################
pathDefaults:
##########################################
# SOURCE
##########################################
sourceOnDemand: false
##########################################
# RTSP SOURCE SETTINGS
##########################################
rtspTransport: tcp
##########################################
# RECORDING (NEW STRUCTURE)
##########################################
record: true
recordPath: /recordings/%path/%Y-%m-%d_%H-%M-%S-%f
recordFormat: fmp4
recordPartDuration: 1s
recordSegmentDuration: 5m
recordDeleteAfter: 0s # 0s là không tự động xóa, đặt thời gian xóa nếu ổ cứng có giới hạn
############################################
# CAMERA PATHS
############################################
paths:
cam1:
source: rtsp://admin:password@192.168.88.126:554/h264_stream
cam2:
source: rtsp://admin:password@192.168.88.127:554/h264_stream
cam3:
source: rtsp://admin:password@192.168.88.76:554/h264_stream
cam4:
source: rtsp://admin:password@192.168.88.179:554/h264_stream
# Nếu có cam thứ 5 thì thêm tương tự
# cam5:
# source: rtsp://...