- Getting started
- C# nuget package
- C# git repository
- IP video camera viewer
- PTZ IP camera motion control
- Onvif network video recorder
- SMS notifications
- Motion detection and alarms
- Subscribe for camera events
- Camera side motion detection
- Viewer side motion detection
- Motion detection sensitivity
- Mask the video image
- Send snapshot in e-mail
- Upload image to FTP server
- Send video alarm in e-mail
- Upload video to FTP server
- Make VoIP phone call alarm
- Send Contact ID alarms
- Detect if camera goes offline
- IP camera to SIP video call
- Configure Onvif IP cam remotely
- Onvif IP camera video server
- Video stream on website
- Onvif Network Video Analytics
- Onvif IP Camera Manager
- Computer Vision Technology
- Motion recognition
- Object detection
- Object categorization
- Image Manipulation
- Ozeki SDK for Linux
- Supported cameras
- Download the SDK
- Copy the C# code example into Visual Studio
- Build your IP Camera project
Did you know?
Did you know, that this SDK was used to build Ozeki Camera Recorder?
If you don't want to write code, it could be just what you need. Download it now from the follolwing page: Download Ozeki Camera Recorder.
How to subscribe for camera events in C#
This article demonstrates how to subscribe Onvif camera events in C# This is useful if you would like to be informed about what events are happening on the camera side.
The ONVIF specification includes three different types of event notifications:
- Real-time Pull-Point Notification Interface
- Basic Notification Interface (WS-BaseNotification)
- Notification Streaming Interface (metadata streaming)
The next parts describe the GetEventProperties action, which will inform you about which notifications a device supports and what information they contain. We will learn how to set up the subscriptions for the methods above, and how the Notification Message is processed.
The WS-BaseNotification specification defines a set of optional WS-ResouceProperties.
This specification does not require the implementation of the WS-ResourceProperty interface.
Instead, the subsequent direct interface shall be implemented by an ONVIF compliant device
in order to provide information about the FilterDialects, Schema files and topics supported
by the device.
The GetEventProperties action returns the various event topics that the device supports. The prerequisites are a device must be discovered and the service URIs must be known.
This method returns a PullPointSubscription that can be polled using PullMessages. This message
contains the same elements as the SubscriptionRequest of the WS-BaseNotification without the ConsumerReference.
PullPoint subscription is used when a client wants to fetch event notifications from a service. This is an ONVIF extension to the standard WS-BaseNotification mechanisms. First, a subscription is created and a subscriptionReference is returned, which is used in PullMessages requests to fetch the actual event notifications. If no notifications are available, the response is delayed. The prerequisites are the following: a device that must be discovered and the service URIs must be known.
Figure 1 - Setting Up PullPoint Subscription
A subscription is set up and the notification handling service connects to the specified URL and sends the Notification message. The producer initiates the connection where the Notification is sent through. The consumer and the entity which sets up the subscription don't have to be the same. This process requires a device that must be discovered and the service URIs that are must be known.
Below you can find the answers for the most frequently asked questions related to this topic:
How can I get the URL of the camera?
You can get the URL from the producer of the camera. (In the 10th tutorial you can find information on how to create an own IP camera discoverer program.)
I moved my hand and it has not been detected. Why?
The pixel intensity (sensitivity of movement) has a default value, but in the next chapter we will learn how to change it.