Add recommended FFmpeg decode RTSP pipeline
This commit is contained in:
parent
982ab2ff97
commit
bb4f90085f
170
configs/person_shoe_two_stage_recommended.json
Normal file
170
configs/person_shoe_two_stage_recommended.json
Normal file
@ -0,0 +1,170 @@
|
|||||||
|
{
|
||||||
|
"queue": {
|
||||||
|
"size": 8,
|
||||||
|
"strategy": "drop_oldest"
|
||||||
|
},
|
||||||
|
"graphs": [
|
||||||
|
{
|
||||||
|
"name": "person_shoe_two_stage_recommended",
|
||||||
|
"executor": {
|
||||||
|
"batch_size": 2,
|
||||||
|
"run_budget": 8
|
||||||
|
},
|
||||||
|
"nodes": [
|
||||||
|
{
|
||||||
|
"id": "in",
|
||||||
|
"type": "input_rtsp",
|
||||||
|
"role": "source",
|
||||||
|
"enable": true,
|
||||||
|
"url": "rtsp://10.0.0.49:8554/cam",
|
||||||
|
"fps": 30,
|
||||||
|
"width": 1920,
|
||||||
|
"height": 1080,
|
||||||
|
"use_ffmpeg": true,
|
||||||
|
"use_mpp": false,
|
||||||
|
"force_tcp": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "pre_rgb",
|
||||||
|
"type": "preprocess",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"dst_w": 1920,
|
||||||
|
"dst_h": 1080,
|
||||||
|
"dst_format": "rgb",
|
||||||
|
"dst_packed": true,
|
||||||
|
"resize_mode": "stretch",
|
||||||
|
"rga_gate": "person_shoe_two_stage_recommended",
|
||||||
|
"use_rga": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "person_det",
|
||||||
|
"type": "ai_yolo",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [4],
|
||||||
|
"use_rga": true,
|
||||||
|
"rga_gate": "person_shoe_two_stage_recommended",
|
||||||
|
"rga_max_inflight": 4,
|
||||||
|
"dst_packed": true,
|
||||||
|
"use_dma_input": true,
|
||||||
|
"infer_fps": 2,
|
||||||
|
"infer_phase_ms": 0,
|
||||||
|
"model_path": "./models/yolov8n-640.rknn",
|
||||||
|
"model_version": "v8",
|
||||||
|
"model_w": 640,
|
||||||
|
"model_h": 640,
|
||||||
|
"num_classes": 80,
|
||||||
|
"conf": 0.35,
|
||||||
|
"nms": 0.45,
|
||||||
|
"class_filter": [0],
|
||||||
|
"bbox_expand": {
|
||||||
|
"enable": true,
|
||||||
|
"class_id": 0,
|
||||||
|
"left": 0.06,
|
||||||
|
"right": 0.06,
|
||||||
|
"top": 0.04,
|
||||||
|
"bottom": 0.16
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "person_trk",
|
||||||
|
"type": "tracker",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [5],
|
||||||
|
"mode": "bytetrack_lite",
|
||||||
|
"per_class": true,
|
||||||
|
"track_classes": [0],
|
||||||
|
"high_th": 0.6,
|
||||||
|
"low_th": 0.15,
|
||||||
|
"iou_th": 0.3,
|
||||||
|
"max_age_ms": 700,
|
||||||
|
"min_hits": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "shoe_det",
|
||||||
|
"type": "ai_shoe_det",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [6],
|
||||||
|
"use_rga": true,
|
||||||
|
"rga_gate": "person_shoe_two_stage_recommended",
|
||||||
|
"rga_max_inflight": 4,
|
||||||
|
"dst_packed": true,
|
||||||
|
"use_dma_input": false,
|
||||||
|
"infer_fps": 2,
|
||||||
|
"infer_phase_ms": 250,
|
||||||
|
"model_path": "./models/shoe_detector_openimages_ppe_v1.rknn",
|
||||||
|
"model_w": 640,
|
||||||
|
"model_h": 640,
|
||||||
|
"conf": 0.20,
|
||||||
|
"nms": 0.45,
|
||||||
|
"v8_box_format": "cxcywh",
|
||||||
|
"append_detections": true,
|
||||||
|
"dynamic_roi": {
|
||||||
|
"enable": true,
|
||||||
|
"person_class_id": 0,
|
||||||
|
"shoe_class_id": 1,
|
||||||
|
"debug_roi_class_id": -1,
|
||||||
|
"max_rois": 1,
|
||||||
|
"min_person_height": 80,
|
||||||
|
"x_offset": -0.20,
|
||||||
|
"y_offset": 0.68,
|
||||||
|
"width_scale": 1.40,
|
||||||
|
"height_scale": 0.50
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "osd",
|
||||||
|
"type": "osd",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [7],
|
||||||
|
"draw_bbox": true,
|
||||||
|
"draw_text": false,
|
||||||
|
"use_rga_bbox": false,
|
||||||
|
"labels": ["person", "shoe"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "post",
|
||||||
|
"type": "preprocess",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [7],
|
||||||
|
"dst_w": 1920,
|
||||||
|
"dst_h": 1080,
|
||||||
|
"dst_format": "nv12",
|
||||||
|
"resize_mode": "stretch",
|
||||||
|
"rga_gate": "person_shoe_two_stage_recommended",
|
||||||
|
"use_rga": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "pub",
|
||||||
|
"type": "publish",
|
||||||
|
"role": "filter",
|
||||||
|
"enable": true,
|
||||||
|
"cpu_affinity": [3],
|
||||||
|
"codec": "h264",
|
||||||
|
"fps": 30,
|
||||||
|
"bitrate_kbps": 2000,
|
||||||
|
"mpp_output_timeout_ms": 50,
|
||||||
|
"mpp_packet_wait_ms": 10,
|
||||||
|
"use_mpp": true,
|
||||||
|
"outputs": [
|
||||||
|
{"proto": "rtsp_server", "port": 8555, "path": "/live/cam1"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"edges": [
|
||||||
|
["in", "pre_rgb"],
|
||||||
|
["pre_rgb", "person_det"],
|
||||||
|
["person_det", "person_trk"],
|
||||||
|
["person_trk", "shoe_det", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
|
||||||
|
["shoe_det", "osd", {"queue": {"size": 16, "strategy": "drop_oldest"}}],
|
||||||
|
["osd", "post", {"queue": {"size": 32, "strategy": "drop_oldest"}}],
|
||||||
|
["post", "pub", {"queue": {"size": 64, "strategy": "drop_oldest"}}]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -149,6 +149,27 @@ sudo ./scripts/ops.sh ddr-restore
|
|||||||
- `restore`:恢复到切换前保存的 governor/min/max
|
- `restore`:恢复到切换前保存的 governor/min/max
|
||||||
- 默认节点为 `/sys/class/devfreq/dmc`
|
- 默认节点为 `/sys/class/devfreq/dmc`
|
||||||
|
|
||||||
|
### 3.2 RTSP 解码推荐
|
||||||
|
|
||||||
|
对高位监控、烟雾多、偶发 H.264 参考帧异常的 RTSP 源,优先使用 `FFmpeg CPU decode + MPP encode` 组合。
|
||||||
|
|
||||||
|
推荐配置:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build/media-server -c configs/person_shoe_two_stage_recommended.json
|
||||||
|
```
|
||||||
|
|
||||||
|
说明:
|
||||||
|
|
||||||
|
- 输入端:`use_ffmpeg: true`、`use_mpp: false`
|
||||||
|
- 输出端:仍然使用 `MPP` 编码
|
||||||
|
- 适用场景:源流在 VLC 中播放正常,但项目内 `ffmpeg demux + mpp decode` 会出现固定画面卡顿
|
||||||
|
|
||||||
|
排障建议:
|
||||||
|
|
||||||
|
- 若 `configs/sample_rtsp_publish_only.json` 会卡,但 VLC 直接拉原始 RTSP 源不卡,优先切到 FFmpeg 解码版验证
|
||||||
|
- 若 FFmpeg 解码版不卡,则说明问题主要在 MPP 解码兼容性,而不是 AI 链路或发布链路
|
||||||
|
|
||||||
### 4. 卸载
|
### 4. 卸载
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user