当前位置:网站首页>The RTSP video structured intelligent analysis platform easynvr stops calling the PTZ interface through the onvif protocol to troubleshoot the pending status
The RTSP video structured intelligent analysis platform easynvr stops calling the PTZ interface through the onvif protocol to troubleshoot the pending status
2022-06-24 16:36:00 【Tsingsee green rhino video】
When the camera device supports PTZ , Video structured security intelligent platform EasyNVR Is to support the adoption of onvif Protocol to call the PTZ control of the camera , But during the call , If the user name and password are wrong , Call stop PTZ control interface will always be in pending state .
Through the browser debugging interface, you can see the pending state , No content has been returned .
Analyze the back end interface , Find specific to StopPTZ There is something wrong with the logic in the method , The logic currently used is as follows :
func StopPTZ(host, username, password, deviceUrl string) (err error) {
if dll == nil {
err = fmt.Errorf("onvif dll not init")
return
}
ptz := fmt.Sprintf("stop ptz host[%s] username[%s] password[%s] deviceUrl[%s]", host, username, password, deviceUrl)
global.OperationLogger.Info(ptz)
_host := uintptr(unsafe.Pointer(syscall.StringBytePtr(host)))
_username := uintptr(unsafe.Pointer(syscall.StringBytePtr(username)))
_password := uintptr(unsafe.Pointer(syscall.StringBytePtr(password)))
_deviceUrl := uintptr(unsafe.Pointer(syscall.StringBytePtr(deviceUrl)))
i := 1
for i <= 500 {
r1, _, _ := procStopPtz.Call(_host, _username, _password, _deviceUrl)
if r1 == 0 {
break
}
if i == 500 {
log.Printf("EasyOnvifClient_StopPtz failed, ret[%d], retryed 5s", r1)
err = fmt.Errorf("EasyOnvifClient_StopPtz failed, ret[%d]", r1)
}
time.Sleep(10 * time.Millisecond)
}
return
}
We will i := 1 Change the logic , And time.Sleep Place for 1 Not for 10, Problem solvable . The modified logic code reference is as follows :
func StopPTZ(host, username, password, deviceUrl string) (err error) {
if dll == nil {
err = fmt.Errorf("onvif dll not init")
return
}
ptz := fmt.Sprintf("stop ptz host[%s] username[%s] password[%s] deviceUrl[%s]", host, username, password, deviceUrl)
global.OperationLogger.Info(ptz)
_host := uintptr(unsafe.Pointer(syscall.StringBytePtr(host)))
_username := uintptr(unsafe.Pointer(syscall.StringBytePtr(username)))
_password := uintptr(unsafe.Pointer(syscall.StringBytePtr(password)))
_deviceUrl := uintptr(unsafe.Pointer(syscall.StringBytePtr(deviceUrl)))
for i := 0; i <= 500; i += 100 {
r1, _, _ := procStopPtz.Call(_host, _username, _password, _deviceUrl)
if r1 == 0 {
return
}
if i == 500 {
log.Printf("EasyOnvifClient_StopPtz failed, ret[%d], retryed 5s", r1)
err = fmt.Errorf("EasyOnvifClient_StopPtz failed, ret[%d], timeout 5s", r1)
}
time.Sleep(1 * time.Millisecond)
}
return
}
Rerun and call the interface check , You can see that the above error content disappears , Problem solved :
Onvif The agreement expanded EasyNVR Compatibility and control of devices , We've introduced before EasyNVR in onvif Protocol standard instructions and configuration mode , If you are interested, you can learn something about , If you want to know more about onvif perhaps EasyNVR Related content of , Welcome to follow us .
边栏推荐
- Teach you to write a classic dodge game
- Global and Chinese markets of natural insect repellents 2022-2028: Research Report on technology, participants, trends, market size and share
- B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)
- Modern finite element analysis can easily achieve accurate results
- mysql时间戳格式转换日期格式字符串
- Goby+AWVS 实现攻击面检测
- How does easydss, an online classroom / online medical live on demand platform, separate audio and video data?
- D. Solve the maze (thinking +bfs) codeforces round 648 (Div. 2)
- Where is the most formal and safe account opening for speculation futures? How to open a futures account?
- Nonholonomic constrained robot
猜你喜欢

A survey on dynamic neural networks for natural language processing, University of California

C. Three displays(动态规划)Codeforces Round #485 (Div. 2)
MySQL進階系列:鎖-InnoDB中鎖的情况

There are potential safety hazards Land Rover recalls some hybrid vehicles

Ui- first lesson

Some adventurer hybrid versions with potential safety hazards will be recalled
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization

B. Ternary Sequence(思维+贪心)Codeforces Round #665 (Div. 2)

Problems encountered in the work of product manager

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)
随机推荐
Little red book, hovering on the edge of listing
Goby+awvs realize attack surface detection
50 growers | closed door meeting of marketing circle of friends ス gathering Magic City thinking collision to help enterprise marketing growth
Istio FAQ: failed to resolve after enabling smart DNS
Tencent on the other hand, I was puzzled by the "horse race" problem
Fastjson 漏洞利用技巧
[tke] troubleshooting tips for container problems
Detailed explanation of transpose convolution in pytorch
What is zero trust? Three classes will show you how to understand him!
Find out the invisible assets -- use hosts collision to break through the boundary
ZOJ——4104 Sequence in the Pocket(思维问题)
Serial of H3CNE experiment column - VLAN configuration experiment, access and trunk
06. Tencent cloud IOT device side learning - Introduction to basic functions
Global and Chinese markets of Leyte coin exchange 2022-2028: Research Report on technology, participants, trends, market size and share
Embedded Software Engineer written interview guide arm system and architecture
【Prometheus】2. Overview and deployment
Is Guotai Junan Futures safe? How to open a futures account? How to reduce the futures commission?
MySQL Innodb和Myisam
Leetcode notes of Google boss | necessary for school recruitment!
Global and Chinese market of insect proof clothing 2022-2028: Research Report on technology, participants, trends, market size and share