简体   繁体   中英

GetProfiles Issue When Accessing Hikvision Cameras Programmatically Via ONVIF

PROBLEM:

I have a number of test cameras that I'm using in development of a Cocoa ONVIF driver. I have AXIS, Dahua and Hikvision (so far -more will be coming).

All of the cameras claim conformance to Profile S and Profile G.

The AXIS cameras are the only ones that are behaving as expected.

Most can return RTSP image data if I send a direct URI to them (which, I see, is how most "ONVIF" apps seem to work).

What I am trying to do, is use the "proper channels" to access these devices.

That means running the MANDATORY GetProfiles query, like so:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
 xmlns:trt="http://www.onvif.org/ver10/media/wsdl">
    <soap:Body>
        <trt:GetProfiles/>
    </soap:Body>
</soap:Envelope>

That's textbook. Straight out of the ONVIF application programming guide. I'm using a REST injection app to test this, using POST. I have set up authentication as Basic, using a full admin user.

The issue is that Hikvision cameras consistently return an "Optional Action Not Implemented" fault, which is their way of saying "We don't like what you sent".

I should note that the Core commands, like "GetServices" and "GetCapabilities" work just fine.

There is precious little lessons learned stuff out there on ONVIF. I think it's a standard that is still struggling to stand up on its own.

The only thing I've seen out there is this post .

That does not apply to me. The same issue happens when I use either WSDL version.

When I Wireshark the apps that can connect to the camera, all I see is that they directly send an RTSP URI. No mention of "GetProfiles".

My question is this an issue that anyone else has encountered?

If so, how was it solved? I am learning to loathe the ONVIF spec, as it gets real hard to find detailed packet descriptions.

It seems that you are posting all the requests to the same URI. GetServices and GetCapabilities belong to the Device management Service, while GetProfiles belongs to the Media Service, which could have a different URI (this is something you must verify with GetServices ).

The ONVIF specs are abundant, I suggest you to start from the ONVIF Application Programming Guide . It gives you an idea about how to structure your application.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM