162 lines
3.9 KiB
JSON
162 lines
3.9 KiB
JSON
{
|
|
"global": {
|
|
"hot_reload": { "enable": true }
|
|
},
|
|
"queue": { "size": 8, "strategy": "drop_oldest" },
|
|
|
|
"templates": {
|
|
"security_pipeline": {
|
|
"nodes": [
|
|
{
|
|
"id": "in",
|
|
"type": "input_rtsp",
|
|
"role": "source",
|
|
"enable": true,
|
|
"url": "${url}",
|
|
"fps": 25,
|
|
"width": 1920,
|
|
"height": 1080,
|
|
"use_mpp": false,
|
|
"use_ffmpeg": true,
|
|
"force_tcp": true
|
|
},
|
|
{
|
|
"id": "pre",
|
|
"type": "preprocess",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"dst_w": 640,
|
|
"dst_h": 640,
|
|
"dst_format": "rgb",
|
|
"keep_ratio": false,
|
|
"use_rga": true
|
|
},
|
|
{
|
|
"id": "ai",
|
|
"type": "ai_yolo",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"model_path": "${model_path}",
|
|
"model_version": "v8",
|
|
"num_classes": 80,
|
|
"conf": 0.5,
|
|
"nms": 0.45,
|
|
"class_filter": []
|
|
},
|
|
{
|
|
"id": "alarm",
|
|
"type": "alarm",
|
|
"role": "sink",
|
|
"enable": true,
|
|
"labels": [],
|
|
"rules": [
|
|
{
|
|
"name": "object_detection",
|
|
"class_ids": [0],
|
|
"roi": { "x": 0.1, "y": 0.1, "w": 0.8, "h": 0.8 },
|
|
"min_duration_ms": 500,
|
|
"cooldown_ms": 5000
|
|
}
|
|
],
|
|
"actions": {
|
|
"log": { "enable": true, "level": "info" },
|
|
"http": {
|
|
"enable": false,
|
|
"url": "http://127.0.0.1:8080/api/alarm",
|
|
"timeout_ms": 3000,
|
|
"include_media_url": true
|
|
},
|
|
"snapshot": {
|
|
"enable": true,
|
|
"format": "jpg",
|
|
"quality": 85,
|
|
"upload": { "type": "local", "path": "/tmp/alarms" }
|
|
},
|
|
"clip": {
|
|
"enable": false,
|
|
"pre_sec": 5,
|
|
"post_sec": 10,
|
|
"format": "mp4",
|
|
"fps": 25,
|
|
"upload": { "type": "local", "path": "/tmp/alarms" }
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "osd",
|
|
"type": "osd",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"draw_bbox": true,
|
|
"draw_text": true,
|
|
"line_width": 2,
|
|
"font_scale": 1,
|
|
"labels": []
|
|
},
|
|
{
|
|
"id": "post",
|
|
"type": "preprocess",
|
|
"role": "filter",
|
|
"enable": true,
|
|
"dst_w": 1920,
|
|
"dst_h": 1080,
|
|
"dst_format": "nv12",
|
|
"keep_ratio": false,
|
|
"use_rga": true
|
|
},
|
|
{
|
|
"id": "storage",
|
|
"type": "storage",
|
|
"role": "sink",
|
|
"enable": true,
|
|
"mode": "continuous",
|
|
"format": "mp4",
|
|
"codec": "h264",
|
|
"segment_sec": 300,
|
|
"path": "${rec_path}",
|
|
"filename_pattern": "%Y%m%d/%H%M%S",
|
|
"fps": 25,
|
|
"bitrate_kbps": 2000
|
|
},
|
|
{
|
|
"id": "pub",
|
|
"type": "publish",
|
|
"role": "sink",
|
|
"enable": true,
|
|
"codec": "h264",
|
|
"fps": 25,
|
|
"gop": 50,
|
|
"bitrate_kbps": 2000,
|
|
"use_mpp": true,
|
|
"use_ffmpeg_mux": true,
|
|
"outputs": [
|
|
{ "proto": "rtsp_server", "port": 8554, "path": "/live/${name}" }
|
|
]
|
|
}
|
|
],
|
|
"edges": [
|
|
["in", "pre"],
|
|
["pre", "ai"],
|
|
["ai", "alarm"],
|
|
["ai", "osd"],
|
|
["osd", "post"],
|
|
["post", "storage"],
|
|
["post", "pub"]
|
|
]
|
|
}
|
|
},
|
|
|
|
"instances": [
|
|
{
|
|
"name": "cam1",
|
|
"template": "security_pipeline",
|
|
"params": {
|
|
"name": "cam1",
|
|
"url": "rtsp://10.0.0.9:8554/cam",
|
|
"model_path": "/models/yolov8n.rknn",
|
|
"rec_path": "/rec/cam1"
|
|
}
|
|
}
|
|
]
|
|
}
|