Compare commits
2 Commits
21d3a85ef1
...
7527017070
| Author | SHA1 | Date | |
|---|---|---|---|
| 7527017070 | |||
| 3c3f2fe25b |
20
bin/start-rtsp-server.bat
Normal file
20
bin/start-rtsp-server.bat
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
@echo off
|
||||||
|
echo 启动RTSP测试服务器...
|
||||||
|
echo.
|
||||||
|
echo 请确保已安装FFmpeg
|
||||||
|
echo.
|
||||||
|
|
||||||
|
REM 使用FFmpeg创建一个简单的RTSP服务器
|
||||||
|
REM 这里使用测试视频文件,你可以替换为实际的视频文件路径
|
||||||
|
set VIDEO_FILE=test.mp4
|
||||||
|
|
||||||
|
REM 如果没有测试视频,创建一个测试模式
|
||||||
|
if not exist "%VIDEO_FILE%" (
|
||||||
|
echo 创建测试视频流...
|
||||||
|
ffmpeg -f lavfi -i testsrc=duration=3600:size=640x480:rate=25 -f rtsp rtsp://localhost:8554/11
|
||||||
|
) else (
|
||||||
|
echo 使用视频文件: %VIDEO_FILE%
|
||||||
|
ffmpeg -re -i "%VIDEO_FILE%" -c copy -f rtsp rtsp://localhost:8554/11
|
||||||
|
)
|
||||||
|
|
||||||
|
pause
|
||||||
24
bin/start-rtsp-server.sh
Normal file
24
bin/start-rtsp-server.sh
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "启动RTSP测试服务器..."
|
||||||
|
echo
|
||||||
|
|
||||||
|
# 检查FFmpeg是否安装
|
||||||
|
if ! command -v ffmpeg &> /dev/null; then
|
||||||
|
echo "错误: FFmpeg未安装,请先安装FFmpeg"
|
||||||
|
echo "Ubuntu/Debian: sudo apt install ffmpeg"
|
||||||
|
echo "CentOS/RHEL: sudo yum install ffmpeg"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 视频文件路径
|
||||||
|
VIDEO_FILE="test.mp4"
|
||||||
|
|
||||||
|
# 如果没有测试视频,创建一个测试模式
|
||||||
|
if [ ! -f "$VIDEO_FILE" ]; then
|
||||||
|
echo "创建测试视频流..."
|
||||||
|
ffmpeg -f lavfi -i testsrc=duration=3600:size=640x480:rate=25 -c:v libx264 -preset ultrafast -f rtsp rtsp://localhost:8554/11
|
||||||
|
else
|
||||||
|
echo "使用视频文件: $VIDEO_FILE"
|
||||||
|
ffmpeg -re -i "$VIDEO_FILE" -c copy -f rtsp rtsp://localhost:8554/11
|
||||||
|
fi
|
||||||
2
pom.xml
2
pom.xml
@@ -42,7 +42,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bytedeco</groupId>
|
<groupId>org.bytedeco</groupId>
|
||||||
<artifactId>javacv-platform</artifactId>
|
<artifactId>javacv-platform</artifactId>
|
||||||
<version>1.5.9</version> <!-- 版本号需与项目兼容 -->
|
<version>1.5.10</version> <!-- 版本号需与项目兼容 -->
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- SpringBoot的依赖配置-->
|
<!-- SpringBoot的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -63,9 +63,8 @@
|
|||||||
<artifactId>spring-context</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bytedeco</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>javacv-platform</artifactId>
|
<artifactId>spring-context</artifactId>
|
||||||
<version>1.5.9</version> <!-- 版本号需与项目兼容 -->
|
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@@ -152,3 +152,17 @@ mediasServer:
|
|||||||
arcFace:
|
arcFace:
|
||||||
appId: '替换成你的appId'
|
appId: '替换成你的appId'
|
||||||
sdkKey: '替换成你的sdkKey'
|
sdkKey: '替换成你的sdkKey'
|
||||||
|
|
||||||
|
# 视频分析配置
|
||||||
|
video:
|
||||||
|
# 是否启用AI检测功能
|
||||||
|
detection:
|
||||||
|
enabled: false
|
||||||
|
# RTSP配置
|
||||||
|
rtsp:
|
||||||
|
# 连接超时时间(微秒)
|
||||||
|
timeout: 10000000
|
||||||
|
# 传输协议 tcp/udp
|
||||||
|
transport: tcp
|
||||||
|
# 重试次数
|
||||||
|
retryCount: 3
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ public class InspectionTaskServiceImpl implements InspectionTaskService {
|
|||||||
// 初始化模型管理器
|
// 初始化模型管理器
|
||||||
if (modelManager == null) {
|
if (modelManager == null) {
|
||||||
modelManager = new ModelManager();
|
modelManager = new ModelManager();
|
||||||
URL json = getClass().getResource("/models/models.json");
|
URL json = getClass().getResource("/libs/models/models.json");
|
||||||
if (json != null) {
|
if (json != null) {
|
||||||
modelManager.load(json);
|
modelManager.load(json);
|
||||||
}
|
}
|
||||||
|
|||||||
33
ruoyi-video/src/main/resources/models/detection-config.json
Normal file
33
ruoyi-video/src/main/resources/models/detection-config.json
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"name": "yolo",
|
||||||
|
"type": "object_detection",
|
||||||
|
"modelPath": "models/yolo.onnx",
|
||||||
|
"configPath": "models/yolo.cfg",
|
||||||
|
"weightsPath": "models/yolo.weights",
|
||||||
|
"classNames": [
|
||||||
|
"person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck",
|
||||||
|
"boat", "traffic light", "fire hydrant", "stop sign", "parking meter", "bench",
|
||||||
|
"bird", "cat", "dog", "horse", "sheep", "cow", "elephant", "bear", "zebra",
|
||||||
|
"giraffe", "backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
|
||||||
|
"skis", "snowboard", "sports ball", "kite", "baseball bat", "baseball glove",
|
||||||
|
"skateboard", "surfboard", "tennis racket", "bottle", "wine glass", "cup",
|
||||||
|
"fork", "knife", "spoon", "bowl", "banana", "apple", "sandwich", "orange",
|
||||||
|
"broccoli", "carrot", "hot dog", "pizza", "donut", "cake", "chair", "sofa",
|
||||||
|
"pottedplant", "bed", "diningtable", "toilet", "tvmonitor", "laptop", "mouse",
|
||||||
|
"remote", "keyboard", "cell phone", "microwave", "oven", "toaster", "sink",
|
||||||
|
"refrigerator", "book", "clock", "vase", "scissors", "teddy bear", "hair drier",
|
||||||
|
"toothbrush"
|
||||||
|
],
|
||||||
|
"inputSize": {
|
||||||
|
"width": 640,
|
||||||
|
"height": 640
|
||||||
|
},
|
||||||
|
"threshold": 0.5,
|
||||||
|
"nmsThreshold": 0.4
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"enabled": true,
|
||||||
|
"defaultModel": "yolo"
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user