Event
Event Notification
Receive live event data from NVR.
Notification URL
To get event notification, request the following:
GET /api/events/notify
This is an example response to the above request.
HTTP/1.1 200 OK
Content-Type: text/event-stream
Cache-Control: no-cache
event: event
data: {"type":0,"timestamp":1489664896,"devices":[45]}
event: event
data: {"type":0,"timestamp":1489664896,"devices":[30]}
event: event
data: {"type":0,"timestamp":1489664896,"devices":[107]}
: keep-alive
...
You can use EventSource
in web browsers like:
let eventSource = new EventSource('/api/events/notify');
eventSource.onopen = function () {
console.log('open');
};
eventSource.addEventListener("event", function (event) {
console.log('event: ' + event.data);
});
eventSource.onerror = function (error) {
console.log(error);
};
You can read HTML5 SSE(Server-Sent Events) specification and 'Using server-sent events' document for more details.
Notification Parameters
When you request a notification, you can specify the filter parameters as follows:
types
: event types (default:*
, start from0
)devices
: device numbers (default:*
, start from0
)
Event types and device numbers can be described like 0,3-4,7
.
For example, you can request notification only for LPR events like:
GET /api/events/notify?types=33
The : keep-alive
comment is used for checking connections.
Event Search
Search event data saved in NVR.
Authentication
HTTP Basic / Digest authentication is required. The user must have permission to search recording data.
Search URL
To get the all events, request the following:
GET /api/events
This is an example response to the above request.
HTTP/1.1 200 OK
Content-Type: application/json
{
"total":69096,
"offset":0,
"limit":10,
"events": [
{ "type":30, "timestamp":1487071279, "devices":[79] },
{ "type":9, "timestamp":1487071279, "devices":[79] },
{ "type":33, "timestamp":1487563829, "devices":[115],
"lpr": {"lpn":"35오2115", "place":"test"} }
...
]
}
Search Parameters
When you request a search, you can specify the search parameters as follows:
types
: event types (default:*
, start from0
)devices
: device numbers (default:*
, start from0
)sort
: sort type (default:0
, see below)since
: YYYY-MM-DD or YYYY-MM-DDtHH:MM:SS format (default:NULL
)until
: YYYY-MM-DD or YYYY-MM-DDtHH:MM:SS format (default:NULL
)limit
: the maximum number of search result (default:10
,1
~1000
)total
: get the total number of events (default:false
) (slower)offset
: the offset of search result (default:0
)last
: last rowid/timestamp of search result (default:NULL
) (ex:rowid:12345678,timestamp:1531094400
)
Event types and device numbers can be described like 0,3-4,7
.
For example, you can request a search like:
GET /api/events?types=33&since=2017-02-20
Sort Types
Value | Description |
---|---|
0 | TIME_DESCENDING |
1 | TIME_ASCENDING |
2 | EVENT_TYPE |
3 | DEVICE_NUMBER |
Extra Parameters
lpr_lpn
: (default:NULL
)lpr_place
: (default:NULL
)lpr_speed
: direction (default:0
)lpr_velocity
: (default:0
)lpr_lane
: (default:NULL
)seaky_pos
: (default:-1
)seaky_bill
: (default:-1
)seaky_code
: (default:-1
)elevator_id
: (default:-1
)elevator_floor
: (default:-1000
)elevator_direction
: (default:-1
)elevator_door
: (default:-1
)elevator_stator
: (default:-1
)bill_id
: (default:NULL
)bill_count
: (default:NULL
)bill_account
: (default:NULL
)bill_status
: (default:-1
)bill_protocol
: (default:-1
)bmetro_type
: (default:-1
)bmetro_station
: (default:-1
)audio_detect_high
: (default:-1
)audio_detect_low
: (default:-1
)audio_detect_category
: (default:-1
)axis_vca_type
: (default:-1
)axis_vca_scenario
: (default:NULL
)axis_vca_object
: (default:0
)axis_vca_vehicle
: (default:0
)safemate_type
: (default:-1
)safemate_desc
: (default:NULL
)intellivix_vca_type
: (default:-1
)intellivix_vca_zone
: (default:NULL
)doowon_vca_type
: (default:-1
)doowon_vca_place
: (default:NULL
)thermal_type
: (default:-1
)thermal_temperature_range
: (default:NULL
)thermal_name
: (default:NULL
)heartbeat_name
: (default:NULL
)wisenet_vca_type
: (default:-1
)wisenet_vca_place
: (default:NULL
)wisenet_vca_count
: (default:0
)wisenet_vca_count_type
: (default:0
)wisenet_vca_detection_level
: (default:0
)optex_sensor
: (default:NULL
)truen_vca_type
: (default:-1
)truen_vca_rule
: (default:NULL
)truen_vca_object
: (default:0
)truen_vca_count
: (default:0
)truen_vca_crowd_level
: (default:0
)face_groups
: (default:NULL
)face_comment
: (default:NULL
)face_temperature
: (default:NULL
)face_mask
: (default:-1
)face_temperature_type
: (default:0
)michang_type
: (default:0
)michang_state
: (default:0
)michang_repeater
: (default:0
)michang_sensor
: (default:0
)michang_place
: (default:NULL
)michang_fire_type
: (default:0
)ivs_type
: (default:0
)itx_ai_type
: (default:0
)itx_ai_place
: (default:NULL
)itx_ai_direction
: (default:0
)itx_ai_object_type
: (default:0
)antkr_type
: (default:0
)bestshot_object
: (default:0
)bestshot_vehicle
: (default:0
)bestshot_color
: (default:0
)bestshot_color2
: (default:0
)bestshot_gender
: (default:0
)bestshot_age
: (default:0
)bestshot_mask
: (default:0
)bestshot_opticals
: (default:0
)bestshot_bag
: (default:0
)ptz_preset_id
: (default:0
)ptz_preset_name
: (default:NULL
)nexreal_ai_type
: (default:0
)nexreal_ai_object
: (default:0
)onvif_va_object
: (default:0
)onvif_va_vehicle
: (default:0
)onvif_va_color
: (default:0
)onvif_va_color2
: (default:0
)onvif_va_gender
: (default:0
)onvif_va_age
: (default:0
)onvif_va_mask
: (default:0
)onvif_va_opticals
: (default:0
)onvif_va_bag
: (default:0
)truen_ai_object
: (default:0
)truen_ai_vehicle
: (default:0
)truen_ai_color
: (default:0
)truen_ai_color2
: (default:0
)truen_ai_gender
: (default:0
)truen_ai_mask
: (default:0
)truen_ai_opticals
: (default:0
)truen_ai_bag
: (default:0
)truen_ai_plate_number
: (default:NULL
)truen_ai_speed
: (default:NULL
)emda_ai_type
: (default:0
)emda_ai_name
: (default:NULL
)emda_ai_object
: (default:0
)emda_ai_direction
: (default:0
)emda_ai_human_gender
: (default:0
)emda_ai_human_age
: (default:NULL
)emda_ai_human_up_clothes
: (default:0
)emda_ai_human_up_color
: (default:0
)emda_ai_human_down_clothes
: (default:0
)emda_ai_human_down_color
: (default:0
)emda_ai_human_hairstyle
: (default:0
)emda_ai_vehicle_type
: (default:0
)emda_ai_vehicle_color
: (default:0
)emda_ai_vehicle_brand
: (default:NULL
)emda_ai_plate_color
: (default:0
)emda_ai_plate_number
: (default:NULL
)emda_ai_face_age
: (default:NULL
)emda_ai_face_gender
: (default:0
)emda_ai_face_beard
: (default:0
)emda_ai_face_mask
: (default:0
)parking_type
: (default:0
)parking_lane_id
: (default:0
)parking_lane_name
: (default:NULL
)parking_lpn
: (default:NULL
)intellivix_ai_type
: (default:0
)intellivix_ai_object
: (default:0
)intellivix_ai_vehicle_type
: (default:0
)intellivix_ai_vehicle_plate_number
: (default:NULL
)intellivix_ai_person_gender
: (default:0
)intellivix_ai_person_ages
: (default:0
)intellivix_ai_person_bag
: (default:0
)intellivix_ai_person_sleeves
: (default:0
)intellivix_ai_person_up_clothes
: (default:0
)intellivix_ai_person_down_clothes
: (default:0
)intellivix_ai_person_white_cane
: (default:0
)intellivix_ai_head_hat
: (default:0
)intellivix_ai_head_glasses
: (default:0
)intellivix_ai_head_mask
: (default:0
)intellivix_ai_head_safety_helmet
: (default:0
)posco_ai_type
: (default:0
)posco_ai_voice
: (default:0
)posco_ai_hot_rolling_2nd_type
: (default:0
)posco_ai_hot_rolling_2nd_model_id
: (default:NULL
)posco_ai_hot_rolling_2nd_video_id
: (default:NULL
)posco_ai_hot_rolling_2nd_time
: (default:NULL
)elsworks_ai_type
: (default:0
)elsworks_ai_object
: (default:0
)critical_type
: (default:0
)ycx_ai_object
: (default:0
)critical_system_type
: (default:0
)micro_ai_type
: (default:0
)micro_ai_object
: (default:0
)micro_ai_direction
: (default:0
)avycon_type
: (default:0
)tiandy_ai_type
: (default:0
)tiandy_ai_rule_type
: (default:0
)kmt_radar_id
: (default:-1
)kmt_radar_distance
: (default:0
)kmt_radar_tamper
: (default:0
)chaja_type
: (default:0
)chaja_object
: (default:0
)chaja_up_color
: (default:0
)chaja_down_color
: (default:0
)chaja_speed
: (default:0
)chaja_count
: (default:0
)chaja_name
: (default:NULL
)neotech_ai_type
: (default:0
)hikvision_ai_type
: (default:0
)hikvision_ai_target
: (default:0
)hikvision_ai_region
: (default:NULL
)hikvision_ai_thermal_type
: (default:0
)hikvision_ai_thermal_temperature
: (default:NULL
)hikvision_ai_audio_type
: (default:0
)nextk_type
: (default:0
)nextk_face_age
: (default:0
)nextk_face_gender
: (default:0
)nextk_face_identify
: (default:0
)nextk_face_memo
: (default:NULL
)nextk_face_name
: (default:NULL
)itx_bridge_type
: (default:0
)itx_bridge_object
: (default:0
)itx_bridge_count
: (default:0
)mgict_type
: (default:0
)mgict_sub_type
: (default:0
)mgict_device
: (default:0
)mgict_state
: (default:0
)force_recording_action
: (default:0
)hatsal_state
: (default:0
)hwasung_type
: (default:0
)hwasung_object
: (default:0
)rex_va_type
: (default:0
)rex_va_object
: (default:0
)aibis_type
: (default:0
)emstone_ai_type
: (default:0
)emstone_ai_zone
: (default:NULL
)emstone_ai_count
: (default:NULL
)emstone_ai_ingress
: (default:NULL
)emstone_ai_egress
: (default:NULL
)emstone_ai_passerby
: (default: 0)emstone_ai_ppe
: (default: 0)antkr_ai_type
: (default:0
)antkr_ai_object
: (default:0
)daom_type
: (default:0
)daom_state
: (default:0
)tootoo_ai_type
: (default:0
)tootoo_ai_object
: (default:0
)bestdigital_ai_type
: (default:0
)bestdigital_ai_object
: (default:0
)chaja_name
: (default:NULL
)empd_ai_type
: (default:0
)empd_ai_object
: (default:0
)cranberry_type
: (default:0
)arslooper_type
: (default:0
) (event_code
)
Event Push
Push event data to NVR.
Authentication
HTTP Basic / Digest authentication is required. The user must have permission to search recording data.
Push URL
Post the event data in JSON format like the following:
POST /api/events
Content-Type: application/json
Content-Length: 39
{
"type": 1,
"devices": [ 0, 1 ]
}
The field type
and devices
are required.
You can specify source_address
for IP camera address instead of devices
:
POST /api/events
Content-Type: application/json
Content-Length: 52
{
"type": 0,
"source_address": "192.168.0.31"
}
Example responses for the request:
HTTP/1.1 200 OK
Content-Length: 23
Content-Type: application/json
{ "reason":"success" }
or
HTTP/1.1 400 Bad Request
Content-Length: 36
Content-Type: application/json
{ "reason": "invalid event 'type'" }
LPR
{
"type": 33,
"devices": [ 0 ], // or "source_address": "192.168.0.31"
"lpr": {
"lpn": "37...2115",
"place": "Door",
"speed": 1,
"velocity": 60,
"lane": "The first",
"coordinates": "120.000000,36.00000",
"facility": "FCLT0001",
"car_image_type": "image/jpeg",
"car_image_data": "..."
},
"file_type": "image/jpeg",
"file_data": "..."
}
lpn
: License Plate Numberplace
: Place (optional)speed
: Direction, 1 or -1 (optional)velocity
: Speed in Km (optional)lane
: Lane (optional)coordinates
: Coordinates for logitude and latitude (optional)facility
: Facility ID (optional)car_image_type
: Car image file type (optional)car_image_data
: Car image file data, base64 encoded (optional)file_type
: Plate image file type (optional)file_data
: Plate image file data, base64 encoded (optional)
Note that both file_type
and file_data
must be specifed for image file.
Audio Detection
{
"type": 41,
"devices": [ 0 ],
"audio": {
"high": 1,
"low": 1,
"category": 1
}
}
-
high
: High voice detection (1 or 0) -
low
: Low voice detection (1 or 0) -
category
: See table belowValue Description 1 Scream 2 Gunshot 3 Explosion 4 Glass Break
SVG
Post the event overlay SVG images like the following:
POST /api/events/svg
Content-Length: ...
<svg id="lpn" channels="0" viewBox="0 0 1920 1080">
...
</svg>
<svg>
tags must have id
, channels
and viewBox
attributes as following:
id
: event name like 'lpn', 'thermal', etc..viewBox
: the position and dimension (DO NOT USEwidth
,height
ATTRIBUTES!)duration
: clear SVG forid
after n seconds (default is0
, never)channels
: camera numbers (start from0
)source-address
: camera IP address
You can specify source-address
instead of channels
attribute.
This is an example of drawing text.
You can read 'Texts of SVG tutorial' document for more details.
<svg id="lpn" channels="0" viewBox="0 0 1920 1080">
// outline
<text font-family="sans"
font-style="normal"
font-weight="bold"
stroke="rgb(0,0,0)"
stroke-opacity="0.3"
stroke-width="2.0"
stroke-linecap="butt"
stroke-linejoin="miter"
text-anchor="start"
x="1000" y="370" font-size="30">
<tspan x="1000" y="370">12가 3456</tspan>
</text>
// fill
<text font-family="sans"
font-style="normal"
font-weight="bold"
fill="rgb(255,255,255)"
fill-opacity="1"
text-anchor="start"
x="1000" y="370" font-size="30">
<tspan x="1000" y="370">12가 3456</tspan>
</text>
</svg>
This is an example of drawing polygon.
You can read 'Polygon of SVG element' document for more details.
<polygon style="fill-opacity:0;
fill:rgb(0,128,0);
stroke:rgb(0,0,255);
stroke-opacity:0.8;
stroke-width:5.0;
stroke-dasharray:15,6"
points="100,400 200,500 300,400 300,800 200,700 100,800" />
Event Types
Code | Name | Description |
---|---|---|
* | all | All Events |
0 | motion | Motion Detection |
1 | sensor | Sensor (Digital Input) |
2 | alarm | Alarm (Digital Output) |
3 | disk | Disk Error |
4 | video_loss | Camera Signal Loss |
5 | host-online | Host Online |
6 | host-offline | Host Offline |
7 | smart | Disk SMART |
8 | video_recovery | Camera Signal Recovery |
9 | vca-presence | VCA Presence |
10 | vca-enter | VCA Enter |
11 | vca-exit | VCA Exit |
12 | vca-appear | VCA Appear |
13 | vca-disappear | VCA Disappear |
14 | vca-stop | VCA Stop |
15 | vca-dwell | VCA Dwell |
16 | vca-direction | VCA Direction |
17 | vca-speed | VCA Speed |
18 | vca-area | VCA Area |
19 | vca-abobj | VCA Abandoned Object |
20 | vca-rmobj | VCA Removed Object |
21 | vca-abrmobj | VCA Abandoned / Removed Object |
22 | vca-tailgating | VCA Tailgating |
23 | vca-linecountera | VCA Counting Line: Direction A |
24 | vca-linecounterb | VCA Counting Line: Direction B |
25 | vca-custom | VCA Custom |
26 | vca-colfilter | VCA Color Filter |
27 | vca-smoke | VCA Smoke |
28 | vca-fire | VCA Fire |
29 | vca-tamper | VCA Tamper |
30 | vca-counter | VCA Counter |
31 | devalarm | Device Alarm |
32 | emcall | Emergency Call |
33 | lpr | License Plate Recognition |
34 | seaky | SEAKY POS |
35 | elevator | Elevator |
36 | 232pos | POS |
37 | flame | Flame |
38 | smoke | Smoke |
39 | bill | Bill Counter |
40 | bmetro | Busan Metro |
41 | audio-detect | Audio Detection |
42 | axis-vca | Axis VCA |
43 | safemate | Safe Mate |
44 | intellivix-vca | IntelliVIX VCA |
45 | doowon-vca | Doowon VCA |
46 | thermal | Thermal |
47 | optex | Section Sensor |
48 | heartbeat | Heartbeat Sensor |
49 | wisenet-vca | Wisenet VCA |
50 | truen-vca | Truen VCA |
51 | face | Face Recognition |
52 | michang | MI-CHANG Fire Detection |
53 | ivs | IVS |
54 | itx-ai | ITX AI |
55 | antkr | Entry |
56 | wisenet-bestshot | Wisenet BestShot |
57 | ptz_preset | PTZ Preset |
58 | nexreal-ai | Nexreal AI |
59 | onvif-va | Onvif VA |
60 | truen-ai | Truen AI |
61 | emda-ai | EMSTONE_D AI |
62 | parking | Parking |
63 | intellivix-ai | IntelliVIX AI |
64 | posco-ai | POSCO AI |
65 | elsworks-ai | HI&TECH AI |
66 | critical | Critical Event |
67 | dongbang | Dongbang Fire Detection |
68 | ycx-ai | YCX AI |
69 | critical-system | Critical System Event |
70 | micro-ai | MICROSYSTEM AI |
71 | avycon | AVYCON |
72 | tiandy-ai | TIANDY AI |
73 | kmt-radar | KMT Radar |
74 | chaja | Chaja |
75 | neotech-ai | NEOTECH AI |
76 | hikvision-ai | HIKVISION AI |
77 | nextk | NextK |
78 | itx_bridge | ItxBridge |
79 | mgict | Mgict |
80 | force_recording | ForceRecording |
81 | hatsal | Hatsal |
82 | hwasung | Hwasung |
83 | rex_va | Rex VA |
84 | aibis | AIBIS |
85 | emstone-ai | EMSTONE AI |
86 | antkr-ai | AntKR AI |
87 | daom | DAOM |
88 | tootoo-ai | TooToo AI |
89 | bestdigital-ai | BestDigital AI |
90 | empd-ai | EMSTONE_P AI |
91 | crb | Cranberry |
92 | arslooper | Arslooper |