safesight-edge/configs/sample_security_pipeline.json
2025-12-26 16:58:18 +08:00

152 lines
3.8 KiB
JSON

{
"queue": { "size": 8, "strategy": "drop_oldest" },
"graphs": [
{
"name": "cam1_security_pipeline",
"nodes": [
{
"id": "in_cam1",
"type": "input_rtsp",
"role": "source",
"enable": true,
"url": "rtsp://192.168.1.100:554/stream",
"fps": 25,
"width": 1920,
"height": 1080,
"use_mpp": false,
"use_ffmpeg": true,
"force_tcp": true
},
{
"id": "pre_cam1",
"type": "preprocess",
"role": "filter",
"enable": true,
"dst_w": 640,
"dst_h": 640,
"dst_format": "rgb",
"keep_ratio": false,
"use_rga": true
},
{
"id": "ai_cam1",
"type": "ai_yolo",
"role": "filter",
"enable": true,
"model_path": "/models/yolov8n.rknn",
"model_version": "v8",
"num_classes": 80,
"conf": 0.5,
"nms": 0.45,
"class_filter": []
},
{
"id": "alarm_cam1",
"type": "alarm",
"role": "sink",
"enable": true,
"labels": [],
"rules": [
{
"name": "object_detection",
"class_ids": [0, 1, 2],
"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://localhost: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_cam1",
"type": "osd",
"role": "filter",
"enable": true,
"draw_bbox": true,
"draw_text": true,
"line_width": 2,
"font_scale": 1,
"labels": []
},
{
"id": "post_cam1",
"type": "preprocess",
"role": "filter",
"enable": true,
"dst_w": 1920,
"dst_h": 1080,
"dst_format": "nv12",
"keep_ratio": false,
"use_rga": true
},
{
"id": "storage_cam1",
"type": "storage",
"role": "sink",
"enable": true,
"mode": "continuous",
"format": "mp4",
"codec": "h264",
"segment_sec": 300,
"path": "/rec/cam1",
"filename_pattern": "%Y%m%d/%H%M%S",
"fps": 25,
"bitrate_kbps": 2000
},
{
"id": "pub_cam1",
"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/cam1" }
]
}
],
"edges": [
["in_cam1", "pre_cam1"],
["pre_cam1", "ai_cam1"],
["ai_cam1", "alarm_cam1"],
["ai_cam1", "osd_cam1"],
["osd_cam1", "post_cam1"],
["post_cam1", "storage_cam1"],
["post_cam1", "pub_cam1"]
]
}
]
}