Vehicle Detection & Parking Management API
Viewtron AI security cameras include built-in illegal parking detection (PVD) that runs entirely on the camera hardware — no cloud service or external AI software required. When a vehicle parks in a designated prohibited zone and remains beyond a configurable time threshold, the camera sends an HTTP POST webhook to your server with the detection event data, including images of the violation.
Parking violation detection (PVD) is distinct from license plate recognition (LPR) — PVD detects the presence of a stationary vehicle in a prohibited zone, while LPR reads the plate number from a moving or stationary vehicle. PVD is also distinct from general vehicle detection via intrusion detection, which detects a vehicle entering a zone but does not track how long it remains parked. All Viewtron IP cameras and NVRs are NDAA compliant.
PVD (illegal parking detection) has not been fully tested via HTTP Post webhook delivery. The camera configuration endpoint GetSmartPvdConfig is confirmed working, and the IPC smartType PVD is documented. The webhook XML format is expected to follow the same CommonImagesLocation pattern as other IPC smart detection events. This page will be updated as testing is completed.
What You Can Build
- No-parking zone enforcement — detect vehicles that park in fire lanes, handicapped zones, or restricted areas
- Loading zone monitoring — alert when a vehicle exceeds the allowed time in a loading dock or delivery zone
- Fire lane compliance — automated monitoring of fire lanes with violation logging and image capture
- Parking lot management — track illegal parking in reserved spots, employee-only areas, or visitor zones
- Tow company integration — automatically notify towing services when a parking violation exceeds a threshold
- Municipal parking enforcement — log violations with timestamped images for citation evidence
How It Works
- Configure a parking violation zone on the camera — define a polygon region where parking is prohibited
- Set the dwell time threshold — configure how long a vehicle must remain parked before triggering an alert
- Enable HTTP POST webhooks — point the camera at your server's IP and port
- Your server receives XML when a violation occurs — the POST includes the PVD event data with images
- Parse the event using the Viewtron Python SDK (
pip install viewtron) or Node.js SDK - Take action — save violation images, log to CSV, send alerts, or trigger enforcement workflows
Event Data Included
Each parking violation webhook POST is expected to contain:
| Field | Description |
|---|---|
smartType | PVD (IPC illegal parking detection) |
boundary | Polygon coordinates of the prohibited parking zone |
rect | Bounding box of the detected vehicle |
eventId / targetId | Unique IDs for the event and tracked target |
status | SMART_START, SMART_PROCEDURE, or SMART_STOP |
sourceBase64Data | Full-frame JPEG image (base64 encoded) |
targetBase64Data | Cropped vehicle JPEG image (base64 encoded) |
currentTime | Detection timestamp |
Parsing Parking Violation Events
- Python SDK
- Node.js SDK
- IPC XML (v1.x)
The simplest way to receive parking violation events. The SDK's ViewtronServer handles HTTP connections, keepalives, XML parsing, and version detection — you just write the callback:
pip install viewtron
from viewtron import ViewtronServer
import os
IMG_DIR = "images"
os.makedirs(IMG_DIR, exist_ok=True)
def on_event(event, client_ip):
if event.category != "intrusion":
return
# PVD events use the intrusion category with PVD alarm type
if event.get_alarm_type() not in ("PVD", "illegalParking"):
return
print(f"Parking violation detected from {client_ip}")
print(f" Type: {event.get_alarm_description()}")
print(f" Time: {event.get_time_stamp_formatted()}")
overview = event.get_source_image_bytes()
if overview:
with open(f"{IMG_DIR}/{event.get_time_stamp()}-parking-violation-overview.jpg", "wb") as f:
f.write(overview)
target = event.get_target_image_bytes()
if target:
with open(f"{IMG_DIR}/{event.get_time_stamp()}-parking-violation-vehicle.jpg", "wb") as f:
f.write(target)
server = ViewtronServer(port=5002, on_event=on_event)
server.serve_forever()
See the Python SDK reference for the full list of methods and event classes.
npm install viewtron-sdk
const { ViewtronServer } = require('viewtron-sdk');
const fs = require('fs');
fs.mkdirSync('images', { recursive: true });
const server = new ViewtronServer({ port: 5002 });
server.on('event', (event, clientIP) => {
if (event.category !== 'intrusion') return;
if (event.eventType !== 'PVD' && event.eventType !== 'illegalParking') return;
console.log(`Parking violation detected from ${clientIP}`);
console.log(` Status: ${event.status}`);
if (event.sourceImageBytes) {
fs.writeFileSync(
`images/${Date.now()}-parking-violation-overview.jpg`,
event.sourceImageBytes
);
}
if (event.targetImageBytes) {
fs.writeFileSync(
`images/${Date.now()}-parking-violation-vehicle.jpg`,
event.targetImageBytes
);
}
});
server.start();
The PVD event format follows the standard IPC smart detection pattern with a <perimeter> block:
<?xml version="1.0" encoding="UTF-8" ?>
<config version="1.7" xmlns="http://www.ipc.com/ver10">
<smartType type="openAlramObj">PVD</smartType>
<deviceName type="string"><![CDATA[ParkingLot]]></deviceName>
<currentTime type="tint64">1774792701902505</currentTime>
<perimeter>
<perInfo type="list" count="1">
<item>
<eventId type="uint32">6100</eventId>
<targetId type="uint32">5900</targetId>
<status type="perStatus">SMART_START</status>
<boundary type="list" count="4">
<item><point><x type="uint32">1000</x><y type="uint32">3000</y></point></item>
<item><point><x type="uint32">6000</x><y type="uint32">3000</y></point></item>
<item><point><x type="uint32">6000</x><y type="uint32">8000</y></point></item>
<item><point><x type="uint32">1000</x><y type="uint32">8000</y></point></item>
</boundary>
<rect>
<x1 type="uint32">2500</x1><y1 type="uint32">3500</y1>
<x2 type="uint32">5500</x2><y2 type="uint32">7500</y2>
</rect>
</item>
</perInfo>
</perimeter>
<sourceDataInfo>
<sourceBase64Length>430000</sourceBase64Length>
<sourceBase64Data>... (base64 JPEG) ...</sourceBase64Data>
</sourceDataInfo>
<listInfo count="1">
<item>
<targetImageData>
<targetBase64Length>70000</targetBase64Length>
<targetBase64Data>... (base64 JPEG) ...</targetBase64Data>
</targetImageData>
</item>
</listInfo>
</config>
See the IPC Event Format reference for the complete v1.x XML structure.
Relevant API Endpoints
| Endpoint | Purpose | Reference |
|---|---|---|
| GetSmartPvdConfig | Read parking violation detection zone configuration | Parking Violation Config |
| SetHttpPostConfig | Configure webhook destination | Webhook Config |
| GetAlarmStatus | Poll current alarm state | Alarm Status |
Integrations
Viewtron vehicle detection also integrates with automation platforms via published packages:
| Platform | Package | What It Does |
|---|---|---|
| Home Assistant | viewtron-home-assistant | Vehicle detection events as native HA sensors — automate gates, alerts, notifications |
| Node-RED | node-red-contrib-viewtron | Vehicle detection events direct to Node-RED flows — no middleware needed |
Related Applications
- License Plate Recognition — read plate numbers from vehicles (distinct from parking detection)
- Human Detection & Intrusion — detect vehicles entering zones (without dwell time tracking)
- Loitering Detection — dwell time detection for people (similar concept to PVD for vehicles)
- Relay Control & IoT Automation — trigger gates or barriers based on vehicle detection
Related Products
- Viewtron AI Security Cameras — IP cameras with built-in vehicle detection and parking violation monitoring
- Viewtron IP Camera NVRs — NVRs with HTTP POST event forwarding
Questions & Development Inquiries
- Email: mike@viewtron.com
- Phone: 561-433-8488
- Forum: NVR Webhook Setup Guide
Mike Haldas is available for questions, consultation, and custom software development for Viewtron API related projects. Email details about your project to mike@viewtron.com.