海康威视摄像头驱动
AIRIOT 与 摄像头对接说明
本驱动主要实现摄像头的预览和云台控制功能。
使用本驱动时,需要平台所在服务器能直接连到摄像头ip.
预览功能:
使用本驱动的设备表,可以在表记录上配置rtsp地址,
在画面中使用视频组件时,平台将请求所选设备配置的rtsp地址,
平台拉流后,将视频流推送到前端页面进行显示。
云台和报警功能:
对于海康威视的摄像头,本驱动会使用厂家的网络设备SDK连接设备,实现云台控制、接收报警等功能。
非海康威视的摄像头,目前未实现云台和接收报警功能,配置时仅填写rtsp主子码流和默认码流字段即可。
1、打开设备监控-驱动管理, 点击添加驱动, 选择driver-hik-camera
2、驱动配置
一般情况下,如果实例配置、设备表配置、表记录配置中存在相同的字段,优先级依次升高,不填时默认继承上一级的配置。
实例配置
设备表配置
在数据管理页面中,新建设备表,选择上一步创建的驱动实例。 数据点和指令如图填写, 数据点可只填写online
表记录配置
3、画面示例:
预览:在画面中,添加一个画面组件,右侧组件属性中,选择设备表视频,选择创建好的表记录,视频类型和视频地址会自动根据所选的表记录填写。 云台:画面中选择云台组件,填写设备,也可以从上级组件组继承。
附录
常见品牌rtsp地址格式:
海康威视:
摄像机:
模板: rtsp://用户名:密码@IP地址/ch1/main/av_stream
注:ch1为通道号 main为主码流
主码流例:rtsp://admin:admin12345@192.168.1.64/ch1/main/av_stream
子码流例:rtsp://admin:admin12345@192.168.1.64/ch1/sub/av_stream
录像机:
模板: rtsp://用户名:密码@IP地址:554/Streaming/Channels/通道?transportmode=unicast
注:如通道1主码流为101通道15为1501,通道1子码流为102通道15为1502
主码流例:rtsp://admin:admin12345@192.168.1.199:554/Streaming/Channels/1701?transportmode=unicast
子码流例:rtsp://admin:admin12345@192.168.1.199:554/Streaming/Channels/1702?transportmode=unicast
大华
大华摄像机RTSP url规则:
模板: rtsp://[username]:[password]@[ip]:[port]/cam/realmonitor?/[channel]&/[subtype]
URL组成说明:
1. username: 用户名;
2. password: 密码;
3. ip: 网络摄像机IP地址;
4. port: 端口号,默认554;
5. codectype:有h264/h265/mjpeg;
6. channel: 通道号。
7. subtype: 码流类型,主码流:0,子码流:1。
主码流例:rtsp://admin:admin123456@192.168.0.121:554/cam/realmonitor?channel=1&subtype=0
子码流例:rtsp://admin:admin123456@192.168.0.121:554/cam/realmonitor?channel=1&subtype=1
数据点和指令配置json,可直接复制
数据点:
[
{
"id": "online",
"name": "在线状态"
},
{
"id": "ALARM-4000-3",
"name": "报警-移动侦测"
},
{
"id": "ALARM-4000-6",
"name": "报警-遮挡"
},
{
"id": "ALARM-1102-4",
"name": "区域入侵"
},
{
"id": "ALARM-1102-1",
"name": "越界侦测"
}
]
指令:
[
{
"name": "上",
"ops": {
"action": "cameraUp",
"param": "上"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "下",
"ops": {
"action": "cameraDown",
"param": "下"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "左",
"ops": {
"action": "cameraLeft",
"param": "左"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "右",
"ops": {
"action": "cameraRight",
"param": "右"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "左上",
"ops": {
"action": "cameraLeftUp",
"param": "左上"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "左下",
"ops": {
"action": "cameraLeftDown",
"param": "左下"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "右上",
"ops": {
"action": "cameraRightUp",
"param": "右上"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "右下",
"ops": {
"action": "cameraRightDown",
"param": "右下"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "放大",
"ops": {
"action": "cameraZoomIn",
"param": "放大"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "缩小",
"ops": {
"action": "cameraZoomOut",
"param": "缩小"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"name": "转到指定预置点",
"ops": {
"action": "cameraPreset",
"param": "转到指定预置点"
},
"writeIn": {
"defaultValue": {
"default": 3
},
"ioway": "默认写入",
"type": "number"
}
},
{
"formSchema": {
"schema": {
"form": [
"table",
"device",
"*"
],
"key": "root",
"listFields": [
"table",
"device"
],
"name": "报警抓拍",
"properties": {
"device": {
"canOrder": false,
"config": "文本",
"createShow": true,
"descriptionType": "tooltip",
"editShow": true,
"fieldType": "input",
"invalid": false,
"key": "device",
"listFields": true,
"need": true,
"placeholder": "被抓拍设备的编号",
"textContent": "text",
"textType": "input",
"title": "设备编号",
"type": "string"
},
"table": {
"canOrder": false,
"config": "文本",
"createShow": true,
"descriptionType": "tooltip",
"editShow": true,
"fieldType": "input",
"invalid": false,
"key": "table",
"listFields": true,
"need": true,
"placeholder": "被抓设备所属设备表的标识",
"textContent": "text",
"textType": "input",
"title": "表标识",
"type": "string"
}
},
"required": [
"table",
"device"
],
"title": "报警抓拍",
"treeKey": "root",
"type": "object"
}
},
"name": "报警抓拍",
"ops": {
"action": "cameraAlarmCapture",
"param": "报警抓拍"
},
"showName": "报警抓拍",
"writeIn": {
"arrayValue": null,
"ifRepeat": null,
"ioway": "默认写入",
"mod": null,
"objectValue": {
"schema": {
"form": [
"table",
"device",
"*"
],
"key": "root",
"listFields": [
"table",
"device"
],
"properties": {
"device": {
"canOrder": false,
"config": "文本",
"createShow": true,
"descriptionType": "tooltip",
"editShow": true,
"fieldType": "input",
"invalid": false,
"key": "device",
"listFields": true,
"need": true,
"placeholder": "被抓拍设备的编号",
"textContent": "text",
"textType": "input",
"title": "设备编号",
"type": "string"
},
"table": {
"canOrder": false,
"config": "文本",
"createShow": true,
"descriptionType": "tooltip",
"editShow": true,
"fieldType": "input",
"invalid": false,
"key": "table",
"listFields": true,
"need": true,
"placeholder": "被抓设备所属设备表的标识",
"textContent": "text",
"textType": "input",
"title": "表标识",
"type": "string"
}
},
"required": [
"table",
"device"
],
"title": "根对象",
"treeKey": "root",
"type": "object"
}
},
"type": "object"
}
}
]