接入Hikvision摄像头
获取模板
在 examples/rtspDeviceShifu 中查看模板文件。
修改配置
在 examples/rtspDeviceShifu/camera-deployment/deviceshifu-camera-deployment.yaml
中:
spec:
...
template:
...
spec:
containers:
...
- image: edgehub/camera-python:v0.0.1
...
env:
- name: EDGEDEVICE_NAME
value: "edgedevice-camera"
- name: EDGEDEVICE_NAMESPACE
value: "devices"
- name: IP_CAMERA_ADDRESS
value: "192.168.14.254" # 修改此值
- name: IP_CAMERA_USERNAME
value: "admin" # 修改此值
- name: IP_CAMERA_PASSWORD
value: "password" # 修改此值
- name: IP_CAMERA_CONTAINER_PORT
value: "11112" # 修改此值
...
推荐使用
Secret
存储密码,对于接入设备这是不必要的,但是这样会大大加强安全性- 创建
Secret
,在rtsp_password
字段填写密码
kubectl create secret generic deviceshifu-secret --from-literal=rtsp_password=your_password -n deviceshifu
- 将环境变量
IP_CAMERA_PASSWORD
的值修改为从Secret
中获取
- name: IP_CAMERA_PASSWORD
valueFrom:
secretKeyRef:
name: deviceshifu-secret
key: rtsp_password
optional: false
提示
部署deviceShifu
执行下面的命令:
kubectl apply -f examples/rtspDeviceShifu/camera-deployment
与deviceShifu交互
在 examples/rtspDeviceShifu/camera-deployment/deviceshifu-camera-configmap.yaml
中:
data:
...
instructions: |
...
instructions:
capture:
info:
stream:
move/up:
move/down:
move/left:
move/right:
您可以通过这些指令与数字孪生交互,这等同于操作实际的海康威视摄像头。