Get motion detection event on ONVIF camera

Hi!

I’m new to the topics of Milestone and ONVIF.

I have a camera that runs an ONVIF server (I wrote the code) and I need to get an alarm/event whenever it detects a motion event.

I tried to enable Motion Started (HW) and “Motion Stopped (HW) on this camera, and I can see on the client that there are motion events.

When I checked the Wireshark, I could not see any ONVIF data related to that, just the streams once.

I wrote the onvif code on the camera side, so I need to understand what kind of events it sends in order to implement the callback on my side (the camera code).

How can I enable it so it will send information to the camera via ONVIF?

You can refer to the ONVIF Events documentation here:

https://doc.milestonesys.com/latest/en-US/onvifdriver/events.htm?tocpath=Third-party%20integrations%7CONVIF%C2%AE%20drivers%7CEvents%7C_____1

The basic steps for retrieval of events from an ONVIF device are:

  1. CreatePullPointSubscription
  2. PullMessages
    1. The Topic of an event returned from the device must match one of the pre-defined topics specified in the document (in your case for Motion Event).

Hi, thank you.

I’ve implemented the CreatePullPointSubscription function but I don’t understand when this function gets called.

When I add the camera to the recording server, or when I sign the hardware to event?

Ok, I succeeded to do the CreatePullPointSubscription, and to get PullMessages callback, but I don’t understand which topic do I need to put, and where can I find it?

Again you can refer to the ONVIF Events documentation for the recognized Motion topics:

https://doc.milestonesys.com/latest/en-US/onvifdriver/motion.htm?tocpath=Third-party%20integrations%7CONVIF%C2%AE%20drivers%7CEvents%7C_____3

Thanks, I’ll take a look.

Now I have a question in the other direction, is there a way that a motion detected on the camera from milestone can be transmitted via onvif to the device itself?

No, there is no such capability.