ONVIF和PTZ访问IP摄像机 [英] ONVIF and PTZ Access to IP Cameras

查看:877
本文介绍了ONVIF和PTZ访问IP摄像机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到有关ONVIF IP摄像机规范的麻烦.我建立了一个程序,可以使用该标准来联系相机并将其发送给标准媒体/设备请求.

I'm in trouble here about the ONVIF IP Camera specification. I've built a program that is able to use the standard to contact cameras and send them standard media/device requests.

问题是我现在正在尝试通过ONVIF访问其PTZ容量,而对于我的两个摄像机,我只会遇到以下错误:

The problem is that I'm now trying to access their PTZ capacities through the ONVIF and that for both of my cameras, I only get this following error :

HTTP/1.1 400 Bad Request
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 741
Connection: keep-alive

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:ter="http://www.onvif.org/ver10/error">

<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<SOAP-ENV:Code>
<SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value>
<SOAP-ENV:Subcode>
<SOAP-ENV:Value>ter:Namespace</SOAP-ENV:Value>
</SOAP-ENV:Subcode>
</SOAP-ENV:Code>
<SOAP-ENV:Reason>
<SOAP-ENV:Text xml:lang="en">Namespace Error</SOAP-ENV:Text></SOAP-ENV:Reason>
<SOAP-ENV:Node>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</SOAP-ENV:Node>
<SOAP-ENV:Role>http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver</SOAP-ENV:Role>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

因此,名称空间错误.

问题是我通过GetCapabilities()ONVIF请求获得了摄像机(/onvif/ptz_service)的onvif PTZ命名空间.

The problem is that I got the onvif PTZ namespace of the camera (/onvif/ptz_service) through a GetCapabilities() ONVIF request.

对于我发送到两个ONVIF摄像机中的任何一个的任何PTZ onvif请求,问题都是相同的.

The problem is same for any PTZ onvif request that I send to any of both of my two ONVIF cameras.

我已经尝试使用ONVIF查找软件,以使它们发送PTZ请求并查看它们是否有效,但是我没有找到一个(这里有一个ONVIF设备管理器:

I already tried to find softwares using the ONVIF to have them send PTZ request and see if they works, but I didn't find one (There's an ONVIF Device Manager here : http://sourceforge.net/projects/onvifdm/ but there's no actual PTZ handling, unless the problem come from my cameras).

推荐答案

我发现了这个问题,坦率地令人失望:

I found the problem, which is frankly disappointing :

我使用的是ONVIF PTZ WSDL文件的第2版(ver20),因为第1版(ver10)被认为已弃用.

I was using the 2nd version (ver20) of the ONVIF PTZ WSDL file, because the 1st one (ver10) is considered as deprecated.

即使是我几天前刚购买的,具有最新固件的ONVIF相机,也仍在使用ver10.

Turns out even the recent ONVIF camera I just bought some days ago, with an up-to-date firmware, is still using ver10.

由于无法使用SvcUtil使用ver10 wsdl生成代理类,因此我尝试使用ver10(而不是ver20)切换所有"http://www.onvif.org/ver20/ptz/wsdl"命名空间,并且有用.目前.我希望它将继续与其他相机配合使用...

Since I can't use SvcUtil to generate my proxy class using the ver10 wsdl, I tried switching all the "http://www.onvif.org/ver20/ptz/wsdl" namespaces with ver10 instead of ver20, and it works. For now. I hope it'll keep working with other cameras ...

这篇关于ONVIF和PTZ访问IP摄像机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆