SECUREXSECURITY ENGINEERINGNVR 文档

detect / record / audio Roles

Role 决定每一路 FFmpeg 输入在 Securex NVR 中承担什么职责。合理拆分 Role 是降低 CPU、减少带宽并保证录像质量的关键。

规则

  • 同一摄像头内,每个 role 只能由一个 input 承担。
  • 一个 input 可以同时承担多个 role,但通常不建议让 4K 主码流同时负责 detect。
  • 即使关闭目标检测,系统为了运动检测、API 图像和 Birdseye 等功能仍可能需要解码 detect 视频。

典型双码流

cameras:
  front:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_sub
          input_args: preset-rtsp-restream
          roles: [detect]
        - path: rtsp://127.0.0.1:8554/front_main
          input_args: preset-rtsp-restream
          roles: [record]

什么时候共用一路

如果摄像头只有一个稳定码流,或者分辨率本身不高,可以在一个 input 上配置 roles: [detect, record]。代价是该流必须持续解码,同时录像也只能保存这一路画质。

常见误区

误区结果修正
4K 主码流做 detect解码负担大,CPU/GPU 压力高使用低分辨率子码流做 detect
同一 role 配到两个 input配置验证失败或行为不明确每个 role 只保留一个来源
record 读取低码流回放清晰度低record 指向主码流

验证

保存后查看 Camera/FFmpeg 日志和系统统计。detect FPS 应稳定,record 时间线应连续;如果 Live 正常但录像没有内容,优先确认 record role 是否存在以及全局/摄像头录像是否启用。

detect / record / audio roles

Roles define what each FFmpeg input does. Separating them correctly reduces decode cost and bandwidth while preserving recording quality.

Rules

  • Each role may be assigned to only one input per camera.
  • One input may carry multiple roles, but using a 4K main stream for detection is usually wasteful.
  • Securex NVR may still decode a detect stream for motion, API images, or Birdseye even when object detection is disabled.

Typical dual-stream setup

cameras:
  front:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_sub
          input_args: preset-rtsp-restream
          roles: [detect]
        - path: rtsp://127.0.0.1:8554/front_main
          input_args: preset-rtsp-restream
          roles: [record]

Single-stream cameras

If a camera has only one reliable stream, use roles: [detect, record]. The trade-off is that the same stream must be decoded continuously and recording quality is limited to that stream.

Common mistakes

MistakeImpactFix
4K main stream used for detectHigh decode loadUse a lower-resolution substream
Same role on two inputsInvalid or ambiguous configKeep one source per role
Low stream used for recordPoor playback qualityPoint record at the main stream

Verify

After saving, inspect FFmpeg logs and camera statistics. Detection FPS should be stable and the recording timeline should be continuous.

Roles detect / record / audio

Los roles definen la función de cada entrada FFmpeg. Separarlos correctamente reduce carga y ancho de banda sin perder calidad de grabación.

Reglas

  • Cada rol solo puede estar en una entrada por cámara.
  • Una entrada puede tener varios roles, aunque no conviene usar un stream 4K para detect.
  • El sistema puede seguir decodificando el stream de detección para movimiento, imágenes API o Birdseye aunque la detección de objetos esté desactivada.

Configuración típica

cameras:
  front:
    ffmpeg:
      inputs:
        - path: rtsp://127.0.0.1:8554/front_sub
          input_args: preset-rtsp-restream
          roles: [detect]
        - path: rtsp://127.0.0.1:8554/front_main
          input_args: preset-rtsp-restream
          roles: [record]

Una sola entrada

Si solo existe un stream fiable, use roles: [detect, record]. La desventaja es que se decodifica continuamente y la calidad de grabación queda limitada a ese stream.

Errores habituales

ErrorEfectoSolución
4K para detectCarga altaUsar substream
Mismo rol en dos entradasConfiguración inválidaUna fuente por rol
Stream bajo para recordReproducción de baja calidadUsar stream principal

Verificación

Revise logs FFmpeg, FPS de detección y continuidad del timeline después de guardar.

输入关键词开始搜索