Message formats for executable files
Upon launch, the executable file connects to three channels:
The stats channel is used for sending its state (memory, CPU, etc.)
The raw-events channel is used for sending generated events
The control channel (the channel name is formed as <analytics type name>.<binary uid>), through this channel, the executable file receives tasks for processing
Statistics
The executable file sends messages to the stats channel every 2-3 seconds. The message format is as follows:
{
"channel": "stats", // Channel name in push1st
"data": {
"binaryUid": "a6e862d2-c6ea-11ec-88bc-59d920260ee8", // UID of the executable file
"coresUsed": 12, // The number of cores used by the executable file
"cpuUsageAvg": 28, // The number of cores used by the executable file
"memUsageRssBytes": 343629824, // Rss memory usage
"memUsageTotalBytes": 2325626880, // Total memory usage (Rss + Shr + Virt)
"netBytesInPerSec": 206342, // Incoming bytes per second
"netBytesOutPerSec": 7924, // Outgoing bytes per second
"streams": { // A block with a description of the states of the cases running on this executable file
"3d1a7e78-2458-11ed-9b5d-21123bef9093": { // Case identifier
"frameProcessRate": 5.128205, // The number of frames processed per second
"starttime": 1663023697, // Case launch time on the executable file
"status": "up", // Current state (can be up, down, stopped)
"streamUid": "ebb04683-8d33-4a94-8aac-c9ea9c6b45db", // Video stream identifier
"uptime": 120344 // Case uptime
},
"streamsCount": 1 // The total number of cases on the executable file
}
},
"event": "stats"
}
Events
When any event is recorded, the executable file must send the corresponding message to the raw-events channel. The message format may vary depending on the type of analytics. In general, the message format is as follows:
{
"channel": "raw-events", // Channel name in push1st
"data": {
"AnalyticsType": "motion-detect", // Analytics type
"CameraGroupUid": "3f3348a9-ae87-4902-947f-725fd25751e3", // CameraGroup identifier
"JobUid": "beddb758-303e-11ed-8c49-bd223ebfa82e", // Analytics case UID
"StreamUid": "470b1c5e-748f-49a4-91e5-62f7ac53b8eb", // Video stream UID
"apiPort": "8086", // Port for the executable file API
"binaryUid": "f45d2b96-9adb-11ec-8995-a3b0e5228375", // Executable file UID
"timestampMs": 1663145196202, // Event generation time
.... // Data related to a specific analytics type may then be transmitted
},
"event": "event"
}
Control channel
The control channel is used to pass the case to the executable file for processing. Its name is formed as <analytics type name>.<binary uid> and is used by the orchestrator to create, delete, and edit cases.
{
"name":"stream_event",
"channels":[
"face-recognition.cc71f36e-14c5-11ed-9bd9-bb5c75b9991b"
],
"data":{
"type":"job_create", // Command for the executable file, which can be job_create, job_update, job_delete
"data":{
"CaseType":"face-recognition", // Analytics type
"CameraGroupUid":"be8ba3dd-419f-4a8b-93ab-907b58a7c063", CameraGroup identifier
"Source":{ // Information about the video stream for analytics
"Uid":"8d1267c7-554a-4481-856c-4efb8c518d7d",
"Url":"rtsp://demo.<vms>.io:5554/live/8d1267c7-554a-4481-856c-4efb8c518d7d/?token=F2v53E_ZDg_zXSswjSU2GF5rfhFpWnN7V_4_vbiuryeLLm7rcR3-H6jJwtI2e-5eelwpTSaoDAQ9oncDmGeOF1N_5MVuLJcJxdrUK8TILKAam7Es1Bg7gGEezzfhCDLTIu_f5M1R6oQkfyL5i1XA_A~~",
"Output":{
"Encoding":"none",
"FPS":5
}
},
"JobUid":"16a7dfd4-14bc-11ed-9bd9-bb5c75b9991b" // Analytics case identifier
.... // Data related to a specific analytics type may then be transmitted in this block
}
}
}