Menu

Registering or viewing ONVIF events

2020-09-26
2020-11-20
  • Bruce Girdlestone

    Hi,

    I have your library compiled on Windows and am running the test app and everything works great!
    I am trying to puzzle through the ONVIF events. I have looked at other examples but the structure is different so I am struggling.
    I ran the get capabilities function and saw this in the response structure.
    + device_service 0x01384e6c "POST /onvif/device_service HTTP/1.1\r\n" char[1024]
    + media_service 0x0138526c "POST /onvif/Media HTTP/1.1\r\n" char[128]
    + imaging_service 0x013852ec "POST /onvif/imaging HTTP/1.1\r\n" char[128]
    + ptz_service 0x0138536c "POST /onvif/PTZ HTTP/1.1\r\n" char[128]
    + event_service 0x013853ec "POST /onvif/Events HTTP/1.1\r\n" char[128]

    From there I am not sure how to register for the events.
    Any test code or examples would be great?

    Thanks,

    Bruce

     
  • Stephen Rhodes

    Stephen Rhodes - 2020-11-20

    Hi Bruce,

    Thank you so much for your message, my apologies for the late reply. I have not implemented the event subscriber in the library. It certainly would be possible to add it, as I had gone through the exercise during the development process. The command to subscribe is the same format as for the other ONVIF commands.

    There are a number of issues with using this feature however, which dissuaded me from incorporating it into the release version. I found that many cameras do not have this feature. Those cameras that do have it will implement the protocol differently. There is also a need to incorporate an http server to respond to the events coming from the cameras which are also vendor specific. Ultimately, events provided by the cameras mostly turn out to be unusable in field conditions.

    A good example is a motion detector. The implementation driving this event in a typical camera will generate far more false alarms than those found in good desktop monitoring software. This will be a result of the limited computing capability in the camera as compared to that available on a desktop for mitigating this issue. Further complexity is caused by the fact that some cameras that implement a protocol that will send a message continuously until motion stops and others will send a start message and a stop message.

    If I remember correctly, you also have to send a keep alive message to some cameras or they will timeout on the event.

    You can observe this protocol with the program Onvif Device Manager.

    https://sourceforge.net/projects/onvifdm/

    It will show the messages received from the event service on the camera. If you know how to use Wireshark, you can watch the network traffic and observe the protocol in action.

    https://www.onvif.org/specs/core/ONVIF-Core-Specification-v250.pdf

    has the commands to look for, page 119.

     

    Last edit: Stephen Rhodes 2020-11-20

Log in to post a comment.