Viewtron IP Camera API Introduction

Watch this video to see an introduction to the Viewtron IP camera API for software developers. This application programming interface (API) can be used to integrate the AI object detection events supported by Viewtron AI security cameras with 3rd party software applications. Viewtron LPR cameras (license plate recognition) also support the API.

The API uses the HTTP protocol to send an XML document to a server address and URL specified in the IP camera’s configuration. The HTTP Post / XML document is sent when an alarm is triggered on the IP camera. The XML document describes the alarm event that occurred and includes a JPEG snapshot image of the event. Software developers can write an HTTP server to receive the HTTP Post from the Viewtron IP camera and parse the XML document to determine what happened and what to do with the data.

The following alarm events are supported by the API.

  • Human Detection
  • Car detection
  • Face Detection
  • Facial Recognition
  • Authorized / Unauthorized Face Database
  • Line Crossing Detection
  • Intrusion Detection
  • Human Traffic Counting
  • Vehicle Traffic Counting
  • License Plate Detection
  • Automated License Plate Recognition
  • Authorized License Plate Database
  • Illegal Parking
  • Loitering Detection
  • Missing Object Detection

Open Source IP Camera API Server

I wrote an API server in Python for developers to use as an example to write their own applications. You can download my IP camera API server here on Github. Right now, I have the server handling license plate recognition events and face detection events. Both of these events are logged to a CSV file and the snapshot images of the events are saved to the file system. I will be adding support for human detection, vehicle detection, line crossing detection, traffic counting, and all other AI camera events very soon.

CCTV Camera Pros already has several partners creating some interesting applications using our facial recognition cameras and LPR cameras. We are excited to support additional partners. Please contact me at mike@cctvcamerapros.net if you need help or have any questions.


Video Transcript

Hey guys, Mike from CCTV Camera Pros here. In this video, I want to tell you about our new Viewtron IP camera API. So our Viewtron AI security cameras, as you probably know, we have AI security cameras that could do things like detect humans, detect cars, detect faces, facial recognition. Then we have license plate recognition cameras that are a specific type of AI camera geared towards detecting license plates and automatically recognizing the numbers and letters on those plates. If you use our Viewtron NVRs with our IP cameras, you can trigger alarm events on the NVR. For example, when a human or a vehicle crosses a line, line crossing detection, or intrudes in a certain area, you can trigger video recording on the NVR. You can trigger external alarms, audio alarms or lights, and you could trigger a push notification. Those are all different types of triggers that you could do based on those events. Same with license plate recognition. You could do all those things when a license plate is recognized or when a certain plate number is recognized.

Now, in addition to performing those types of events on an NVR, the IP camera can also send an HTTP post to an external system with an XML payload describing that event. This is for programmers to integrate with third party systems. So for example, I wrote a server in Python that I’m running on a Raspberry Pi. You could run on any type of Linux server. I just run it on a Raspberry Pi because it’s really easy for me to deploy one of those real quick. I open sourced this server so that developers can look at it and use it as an example on how to integrate with our Viewtron IP cameras.

This is how it works. So that license plate recognition camera that you see behind me, we have that connected to a Viewtron NVR. It records plates on the NVR when they enter this area. Now, in addition to that, I’ve gone into the IP camera settings directly, not the NVR settings. I logged directly into the IP camera, and there’s this HTTP post section where I can specify the IP address, the port number and the URL to send an XML document to whenever a license plate recognition event occurs. So I have my server running on the same network as that camera on a Raspberry Pi. So now whenever that camera detects a license plate, in addition to recording on the Viewtron NVR, it’s also sending the data via XML to my Raspberry Pi. The Raspberry Pi receives that XML data, it opens up a CSV file and logs the data. It logs which IP camera sent the request, the time and date stamp, the numbers and letters of the plate. Then it sends two JPEG images, an overview snapshot of the vehicle, as well as a cropped image of the plate. So an overview snapshot image and a close-up of the license plate. I log the location of where I’m saving that in the CSV file.

Then I have an images directory on the Raspberry Pi where I save both of those images, the license plate image, and the overview of the camera image. You could download my server, my Python server on GitHub. I’ll link to it and use that as an example for license plate recognition integration with our Viewtron LPR cameras. You could also use it, and I’ll expand the examples on this. This is my first video. This was my first proof-of-concept server with this, but I’ll also be expanding that server that I’m open sourcing to deal with face detection and facial recognition events, as well as human detection and vehicle detection events.

Here’s what the snapshots look like. So this is the overview snapshot, and then this is a close-up of the license plate snapshot. Then this is what the record looks like in the CSV file. CSV is just a comma separated value file. You can open it up in Microsoft Excel or Google Sheets or whatever.

This is just one example. So this integration really opens up our Viewtron IP cameras to software developers to integrate with their third-party systems however they see fit. If you want to download the open source server that I wrote and learn more about this integration, first off, you can email me with questions. I can be reached at Mike@cctvcamerapros.net. If you want to learn more about this, please visit www.cctvcamerapros.com/IPcameraAPI. Thank you for watching.