Tutorial 4:

How to build motion detection and alarm system in C#

In this tutorial you can learn about writing codes in C#, which handle an IP camera using Ozeki Camera SDK.

The motion detection is an essential part of a security system. If nobody is in front of the screen, and you still want to know if something unexpected happens then this is the best tutorial for you. We will show you a number of ways to create and program motion detectors using IP cameras.

Ozeki Camera SDK can help you to create these detectors easily. With just a few lines of code you can build motion detection functionality in your C# application and than it can send a snapshot/video about the detected event e.g. firecase, burglary, etc. in email or upload them to an FTP server. And that is not all, it can even send an alarm for you or a monitoring center (police, central station) via a VoIP phone call or in a Contact ID message. In case of VoIP phone call alarms, your system can send a text message that will be read out by the text-to-speech engine or it can send a prerecorded audio file (wav).

You can extend these functionalities with limiting the watching area by masking. This is especially good, when your IP camera doesn't support zooming. You can also set the sensitivity of the detection e.g. ignoring the falling leaves in your garden.

Furthermore, if a hooligan causes harm to the IP camera or it goes offline for any technical reason, your application can detect it and alarm you to have it fixed immediately.

You can find clear explanations (including code snippets and GUI screenshots) for every example related to the functionalities mentioned above. The full source code of each example project can be downloaded and the FAQ section gives answers for the most common questions.

Lecture 1: Subscribe to IP camera events in C#

After reading through this lecture, you will be able to subscribe for IP camera events if you want to be notified about certain detections. Start now

Lecture 2: Motion detection on the IP camera side in C#

It is worth to separate the IP camera and the view sides. This lecture shows how to use the camera side motion detection. Start now

Lecture 3: Setup the viewer side in C#

In this lecture, you can learn more about how to setup the viewer side motion detection. Start now

Lecture 4: Motion detection sensitivity in C#

In this lecture you can learn about how to adjust the accuracy of the monitoring of pixel changes during the motion detection. Start now

Lecture 5: Mask the IP camera image in C#

If you would like to hide certain areas of the video image, check this lecture that explains how to mask those areas. Start now

Lecture 6: Send snapshot in e-mail in C#

Start to build your alarm system here! Find out how to handle alarms by taking a snapshot picture and sending it as an e-mail. Start now

Lecture 7: Upload snapshot to FTP in C#

Get more information about how to handle alarms by taking a snapshot picture and uploading it to an FTP server. Start now

Lecture 8: Send video clip in e-mail in C#

From this lecture you can learn how to manage alarms by recording a video clip and sending it as an e-mail. Start now

Lecture 9: Upload video to FTP server in C#

This lecture will introduce how to record a video clip and upload that to an FTP server to be able to handle alarms effectively. Start now

Lecture 10: Make a VoIP phone call alarm in C#

Learn about how to handle alarms by making a VoIP phone call to an alarm monitoring center with text-to-speech. Start now

Lecture 11: Send Contact ID alarms in C#

This lecture is meant to introduce how to send a Contact ID alert message to an alarm monitoring center. Start now

Lecture 12: Detect if IP cameras go offline in C#

Find out how to detect if an IP camera goes offline and how to make an alarm phone call using a prerecorded voice. Start now