当前位置:网站首页>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 .
边栏推荐
- Global and Chinese markets of natural insect repellents 2022-2028: Research Report on technology, participants, trends, market size and share
- A survey of training on graphs: taxonomy, methods, and Applications
- Pytorch 转置卷积
- Memo list: useful commands for ffmpeg command line tools
- How to pop up an alarm through the national standard gb28181 protocol video platform easygbs for mobile detection / perimeter intrusion detection video recording
- Bitwise Operators
- ThinkPHP 漏洞利用工具
- AI structured intelligent security video monitoring technology, supporting the protective umbrella of the reserve / wild animals
- Pytorch transpose convolution
- Batch BOM Bapi test
猜你喜欢

A survey of training on graphs: taxonomy, methods, and Applications

Problems encountered in the work of product manager

B. Terry sequence (thinking + greed) codeforces round 665 (Div. 2)

Ui- first lesson
MySQL Advanced Series: Locks - Locks in InnoDB
![[go] concurrent programming channel](/img/6a/d62678467bbc6dfb6a50ae42bacc96.jpg)
[go] concurrent programming channel

C. Three displays(动态规划)Codeforces Round #485 (Div. 2)

There are potential safety hazards Land Rover recalls some hybrid vehicles

C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)

Ps\ai and other design software pondering notes
随机推荐
2021-05-01: given an ordered array arr, it represents the points located on the X axis. Given a positive number k
[go] concurrent programming channel
Greenplum role-based fine-grained permission control
Percona Toolkit series - Pt deadlock logger
Global and Chinese market of computer protective film 2022-2028: Research Report on technology, participants, trends, market size and share
AI video structured intelligent security platform easycvr intelligent security monitoring scheme for protecting community residents
Go deep into the implementation principle of go language defer
How to select an open source license
Web page live broadcast on demand RTMP streaming platform easydss newly added virtual live broadcast support dash streaming function
C. K-th Not Divisible by n(数学+思维) Codeforces Round #640 (Div. 4)
CDs view permission check
C. Three displays codeforces round 485 (Div. 2)
Use Google search like a professional
#夏日挑战赛# HarmonyOS - 实现带日期效果的待办事项
C. K-th not divisible by n (Mathematics + thinking) codeforces round 640 (Div. 4)
An error is reported during SVN uploading -svn sqlite[s13]
Pageadmin CMS solution for redundant attachments in website construction
AI structured intelligent security video monitoring technology, supporting the protective umbrella of the reserve / wild animals
Advanced programmers must know and master. This article explains in detail the principle of MySQL master-slave synchronization
@There is a free copyright protection service for enterprises in Dawan District