Skip to content

通用接口

请求格式

URL /dynamic/api/v1/setup
Method POST

请求头说明

Key Value
Content-Type application/json

参数说明

Key Require Type Description
cameraId Y string 相机ID
url Y string 相机或视频地址
imageOut Y string base64-返回Base64
notifyUrl Y string AI分析结果上报地址
inputType Y string RTSP-像机 File-文件
decodeType N string 解码类型, 支持cpu、device两种
skipFrame Y float 抽帧率,60秒一帧,1以下代表1秒多少,比如0.15,表示1秒15帧,0.25表示1秒25帧, 暂时不考虑
roi Y arr ROI, 暂时不考虑
areaBoxes Y arr 区域框列表, 暂时不考虑, 传默认值 []即可
fileStore N object 告警凭证视频存储服务
+url Y string 文件上传地址
+type Y int 文件服务器类型 1-GoFastDFS
+nsKey N string 存储空间KEY
+nsValue N string 存储空间VALUE
abilities Y object[] AI能力列表
+name Y string 能力名, 参考下面"能力列表"
+value Y object 参考abilities参数说明

abilities参数说明

参数 类型 是否必传 默认值 描述
interval float Y 0.5 跳帧间隔,单位秒
minTarry float Y 3 停留时长,单位秒
alarmInterval float Y 5 告警上报间隔,单位秒
minBox object N - 最小目标尺寸
+width int N 50 宽, 单位像素
+height int N 50 高, 单位像素
areaBoxes array Y - 警戒框列表
+x float Y - X坐标
+y float Y - Y坐标
threshold float N 0.4 阈值
areaIsReverse boolean N false 警戒框取反
pointType int N 1 1-绝对坐标 2-相对坐标
zoomFactor float N 1.0 场景图缩放因子
confirmCounts int N 10 多帧确认

响应字段

参数 类型 是否必传 描述
status int Y 响应状态码
message string Y 提示消息

示例

请求

{
  "cameraId": "10000000000",
  "url": "rtsp://12312312",
  "imageOut": "base64",
  "inputType": "RTSP|File",
  "decodeType": "device",
  "notifyUrl": "http://10.10.1.124:6200/api/v1/receive",
  "skipFrame": 25,
  "roi": [],
  "areaBoxes": [],
  "fileStore": {
    "url": "http://xxx.xxx.xxx.xxx:0000",
    "type": 1,
    "nsKey": "scene",
    "nsValue": "certificate"
  },
  "abilities":[
     {
    "name": "IllegalOptPackageLine",
    "value": {
            "interval": 0.5,
            "minTarry": 3,
            "alarmInterval": 5,
            "confirmTime" :10,
            "threshold": 0.4,
            "areaIsReverse": false,
            "pointType": 1,
            "zoomFactor": 1.0,
            "minBox": {
                "width": 50,
                "height": 50
             },
            "areaBoxes": [
              [
                {"x": 100, "y": 100},
                {"x": 900, "y": 100},
                {"x": 900, "y": 800},
                {"x": 100, "y": 800}
              ]
           ]
        }
     }
   ]
}

响应

{
  "status":200,
  "message"":"success"
}

报警格式

参数说明

Key Require Type Description
cameraId Y string 相机ID
alarmType Y string 告警类型
alarmVideoStart Y uint64_t 告警录像开始时间戳
alarmVideoStop Y uint64_t 告警录像结束时间戳
eventID Y string 事件id,同一个事件多次报警的关联id
scene Y string 场景图
sceneWidth N int 场景图宽
sceneHeight N int 场景图高
score N float 事件确信度打分
ts Y string 时间戳13位
boxes Y object[] 检测框数组
areas Y array[] 警戒框
url N string 异步上传视频关联uuid
extra Y object 扩展信息
+cei N object 扩展字段,未用
+itemsInBox Y object[] 针对检测框的扩展
++confidence Y float 置信度
++type N string 对象标签类型

示例

{
  "cameraId": "10000000000",
  "alarmType": "IllegalOptPackageLine",
  "alarmVideoStart": 1281525304602229671, 
  "alarmVideoStop": 3236560592731398549,
  "eventID": "c0662a24-6c6b-11ed-8983-0242ac110005",
  "scene": "场景图, BASE64",
  "ts": "时间戳, 13位",
  "boxes": [
    {
      "x": 340,
      "y": 200,
      "width": 200,
      "height": 240
    }
  ],
  "areas": [
    [
      {"x": 100, "y": 100},
      {"x": 900, "y": 100},
      {"x": 900, "y": 800},
      {"x": 100, "y": 800}
    ]
  ],
  "extra": {
    "itemsInBox": [
      {
        "confidence" : 0.85, //置信度
        "type" : "Trash dump"
      }
    ]
  },
  "sceneHeight": 1080, 
  "sceneWidth": 1920, 
  "score": 0.9145607948303223, 
  "url": "c0662a56-6c6b-11ed-9fe5-0242ac110005"
}