添加zlmediakit支持

This commit is contained in:
haotian 2025-09-16 17:32:33 +08:00
parent d44399dcda
commit 9e088dd2d1
3 changed files with 12 additions and 3 deletions

1
ZLMediaKit Submodule

@ -0,0 +1 @@
Subproject commit 97d2a1fb08886efcbdbfdf0b59c6d1d6904db450

View File

@ -1,7 +1,13 @@
# 如何使用
## 1.启动一个流媒体服务器
```shell
# 启动nginx-rtmp服务
docker run -d -p 1935:1935 -p 8080:8080 tiangolo/nginx-rtmp
# 或者
# 启动zlmediakit服务
sudo su # 切换管理员
# 注./MediaServer -h 查看参数
/home/admin-root/haotian/摄像头_目标检测/ZLMediaKit/release/linux/Debug/MediaServer -d --log-slice 10 --log-size 10 &
```
## 2.启动主服务
```python
@ -11,5 +17,7 @@ python rtsp_processor.py
```python
# 端口号要和服务端口号一致
rtmp://ip:1935/live/processed
http://ip:8080/live/processed.m3u8
http://ip:port/live/processed.m3u8
http://ip:port/应用名/流id.live.flv
http://ip:port/应用名/流id/hls.m3u8
```

View File

@ -177,7 +177,7 @@ class AlarmManager:
class StreamServer:
"""流媒体服务器接口"""
def __init__(self, output_url: str = "rtmp://localhost:1935/live/stream", use_gpu: bool = True):
def __init__(self, output_url: str = "rtmp://127.0.0.1:1935/live/stream", use_gpu: bool = True):
self.output_url = output_url
self.ffmpeg_process = None
self.use_gpu = use_gpu
@ -516,7 +516,7 @@ def main():
target_classes=["person", "car", "truck"], # 目标类别
confidence_threshold=0.6,
alarm_duration=15, # 告警录制15秒
cooldown_duration=60, # 冷却60秒
cooldown_duration=60*60, # 冷却60秒
save_path="./alarm_videos"
)