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 from 0)
  • devices : device numbers (default: *, start from 0)

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.

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 from 0)
  • devices : device numbers (default: *, start from 0)
  • 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

ValueDescription
0TIME_DESCENDING
1TIME_ASCENDING
2EVENT_TYPE
3DEVICE_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 Number
  • place: 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 below

    ValueDescription
    1Scream
    2Gunshot
    3Explosion
    4Glass 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 USE width, height ATTRIBUTES!)
  • duration: clear SVG for id after n seconds (default is 0, never)
  • channels: camera numbers (start from 0)
  • 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

CodeNameDescription
*allAll Events
0motionMotion Detection
1sensorSensor (Digital Input)
2alarmAlarm (Digital Output)
3diskDisk Error
4video_lossCamera Signal Loss
5host-onlineHost Online
6host-offlineHost Offline
7smartDisk SMART
8video_recoveryCamera Signal Recovery
9vca-presenceVCA Presence
10vca-enterVCA Enter
11vca-exitVCA Exit
12vca-appearVCA Appear
13vca-disappearVCA Disappear
14vca-stopVCA Stop
15vca-dwellVCA Dwell
16vca-directionVCA Direction
17vca-speedVCA Speed
18vca-areaVCA Area
19vca-abobjVCA Abandoned Object
20vca-rmobjVCA Removed Object
21vca-abrmobjVCA Abandoned / Removed Object
22vca-tailgatingVCA Tailgating
23vca-linecounteraVCA Counting Line: Direction A
24vca-linecounterbVCA Counting Line: Direction B
25vca-customVCA Custom
26vca-colfilterVCA Color Filter
27vca-smokeVCA Smoke
28vca-fireVCA Fire
29vca-tamperVCA Tamper
30vca-counterVCA Counter
31devalarmDevice Alarm
32emcallEmergency Call
33lprLicense Plate Recognition
34seakySEAKY POS
35elevatorElevator
36232posPOS
37flameFlame
38smokeSmoke
39billBill Counter
40bmetroBusan Metro
41audio-detectAudio Detection
42axis-vcaAxis VCA
43safemateSafe Mate
44intellivix-vcaIntelliVIX VCA
45doowon-vcaDoowon VCA
46thermalThermal
47optexSection Sensor
48heartbeatHeartbeat Sensor
49wisenet-vcaWisenet VCA
50truen-vcaTruen VCA
51faceFace Recognition
52michangMI-CHANG Fire Detection
53ivsIVS
54itx-aiITX AI
55antkrEntry
56wisenet-bestshotWisenet BestShot
57ptz_presetPTZ Preset
58nexreal-aiNexreal AI
59onvif-vaOnvif VA
60truen-aiTruen AI
61emda-aiEMSTONE_D AI
62parkingParking
63intellivix-aiIntelliVIX AI
64posco-aiPOSCO AI
65elsworks-aiHI&TECH AI
66criticalCritical Event
67dongbangDongbang Fire Detection
68ycx-aiYCX AI
69critical-systemCritical System Event
70micro-aiMICROSYSTEM AI
71avyconAVYCON
72tiandy-aiTIANDY AI
73kmt-radarKMT Radar
74chajaChaja
75neotech-aiNEOTECH AI
76hikvision-aiHIKVISION AI
77nextkNextK
78itx_bridgeItxBridge
79mgictMgict
80force_recordingForceRecording
81hatsalHatsal
82hwasungHwasung
83rex_vaRex VA
84aibisAIBIS
85emstone-aiEMSTONE AI
86antkr-aiAntKR AI
87daomDAOM
88tootoo-aiTooToo AI
89bestdigital-aiBestDigital AI
90empd-aiEMSTONE_P AI
91crbCranberry
92arslooperArslooper