Event Handling
With ONVIF, Event handling refers to the option of receiving information from the camera.
ONVIF defines three different techniques for receiving information (events) from the camera, such as digital input contacts and motion detection: Real-time pull-point notification interface, Basic-notification interface (WS-BaseNotification), Notification streaming interface (metadata streaming).
The ONVIF plugin supports all three techniques. A particular camera can only support one of them. Contact the camera manufacturer to find out which camera is best suited for your application.
When the motion detection or digital inputs of the camera will be used, Enable event handling with ... must be activated.
Cameras then report various events as a string similar to this: tns1:VideoSource/tns1:MotionAlarm
Known and compliant strings for motion detection and digital input contacts are then displayed in the G-Core Server as a corresponding action ("Sensor Video Alarm" or "Digital Input").
However, if the character string sent by the camera is unknown, the generation of an action cannot be guaranteed.
To be notified of all Onvif events by the camera, you can use a Custom Action or an OnvifNotificationMessage Action to be notified.
Best you choose OnvifNotificationMessage Action because it is much easier to separate information from this action than the Custom Action. Custom Action is still supported for downward compatibility.
To check the string that the camera sends, you can forward all strings sent by the camera that were not understood to a Custom action or an OnvifNotificationMessage action and display this action in the PLC simulator. To do so, Send unknown events as custom action must be activated. All strings that can not be converted in to a corresponding action are then converted into a CustomAction or an Onvif-Notification-Message.
The function Send all events as... always sends custom actions. Strings identified as motion detection are sent as CustomAction and no longer as VideoSensorAlarm.
For debugging purposes, you can select Send All Events as CustomAction to send understandable strings sent by the camera as CustomAction. If this option is selected, there will no longer be any action (Sensor Video Alarm or Digital Input).
To get an overview of what kind of events a particular camera supports, click the Get Event Info from Camera button. All events that the camera offers to send are displayed in the event field. For more information on what the event can be, contact the camera manufacturer. Here are some examples:
-
tns1:AudioAnalytics/Audio/DetectedSound
-
tns1:Configuration/AudioEncoderConfiguration
-
tns1:Configuration/VideoEncoderConfiguration
-
tns1:Device/Trigger/DigitalInput
-
tns1:Media/ConfigurationChanged
-
tns1:Media/ProfileChanged
-
tns1:RuleEngine/CellMotionDetector/Motion
-
tns1:RuleEngine/FieldDetector/ObjectsInside
-
tns1:RuleEngine/LineDetector/Crossed
-
tns1:RuleEngine/TamperDetector/Tamper
-
tns1:RuleEngine/VideoAnalytics/ObjectDetector/Face
-
tns1:RuleEngine/VideoSource/FireAlarm
-
tns1:RuleEngine/VideoSource/SceneTemperature
-
tns1:VideoSource/MotionAlarm
By default, G-Core listens to all events and receives information about them. Onvif suggests only requesting the necessary events to prevent camera and network overload. If you know which event you want to listen to, you can place the event from the event box in the filter box.
If only a specific event is required, simply copy an event from the event box to the filter box.
Example Example 1:
If tns1:Device/Trigger/DigitalInput
is entered, only the digital input events are received by G-Core.
Example Example 2:
If you want to receive two different events, you must place them one after the other, separated by a "|".
If you want to receive digital inputs and motion detection, the filter will look like this: tns1:Device/Trigger/DigitalInput|tns1:VideoSource/MotionAlarm
Example Example 3:
If there are events with the same prefix, you can use a placeholder icon "//.". If you want to receive all tns1: RuleEngine events, enter this in the filter box: tns1:RuleEngine//.
Example Example 4:
Example 2 and 3 can be combined to receive all configuration and RuleEngine events. tns1:Configuration//.|tns1:RuleEngine//
Explanation of OnvifNotificationMessage Action
If you have not entered any filters, you can see a large number of actions in the PLC simulator.
The message received the following parameters:
Name |
Description |
---|---|
channel |
The media channel of the camera |
time |
The time at which the camera sent this event. Not to try to make a mapping event for it! This is mainly for information purposes. |
topic |
The topic is the event displayed in GSet in the Event field. This parameter should be used to create a mapping to a GCore event. |
source name and source value |
This describes the source of the event. |
data name and data value |
Describes the state of the event. You can often see here whether the event is active or not. |
key name and key value |
That's usually empty. Ask the vendor for the intended purpose |
property operation |
There are three states: Initialized, deleted and changed.Initialized is displayed when there is a new parameter or when GCore connects to the camera for the first time.Changed is displayed if there are changes to the event.Deleted is displayed when the source of the event is no longer available. |
source, data, key string |
Source, data and key can consist of several elements. The first element is entered for the name and value of the specified tuple. All elements of a given tuple are separated by comma in this string. |
topic dialect |
This is an information sent with the Onvif event. Mostly unnecessary. |
Explanation of Custom Action
The INT parameter is used to distinguish between different media channels. The INT parameteris the corresponding “Mediachannel ID” from G-Set. It is NOT the “Global number”!
“STRING parameter” is the string received from camera like mention above.
Here is an example in the PLC simulator:
If you know what was sent by the camera, you can start an event in G-Set that is triggered by this CustomAction.