Skip to main content

Webhooks and Outputs

CSV

Shipping Container Live output is saved in a CSV file. You can use Notepad++ to get "live" updates in the CSV output file. Here is a sample CSV output:

timestamp,texts,dscore,label,file,box,rotation,source_url,position_sec
2024-09-17 09:52:30.565732+00:00,"[{'value': '45G1', 'score': 1.0}]",0.862,Size and Type Codes,/camera-1_screenshots/24-09-17-09-52-30.565732.jpg,"{'xmin': 1119, 'ymin': 242, 'xmax': 1184, 'ymax': 280}",0,/tmp/uploads/container-video.mp4,0.03
2024-09-17 09:52:30.565732+00:00,"[{'value': 'FYCU', 'score': 1.0}]",0.836,Owner Code and Category Identifier,/camera-1_screenshots/24-09-17-09-52-30.565732.jpg,"{'xmin': 1018, 'ymin': 184, 'xmax': 1092, 'ymax': 231}",0,/tmp/uploads/container-video.mp4,0.03

JSON Lines

You may also output JSON Lines. Here is a sample JSONLines output:

{"camera_id": "camera-1", "timestamp": "2024-09-17T09:52:30.565732Z", "timestamp_local": "2024-09-17 09:52:30.565732+00:00", "timestamp_camera": "2024-09-17 09:52:30.218457+00:00", "filename": "24-09-17-09-52-30.565732.jpg", "results": [{"box": {"xmin": 1119, "ymin": 242, "xmax": 1184, "ymax": 280}, "dscore": 0.862, "label": "Size and Type Codes", "rotation": 0, "texts": [{"value": "45G1", "score": 1.0}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "0.03", "user_data": ""}, {"box": {"xmin": 1018, "ymin": 184, "xmax": 1092, "ymax": 231}, "dscore": 0.836, "label": "Owner Code and Category Identifier", "rotation": 0, "texts": [{"value": "FYCU", "score": 1.0}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "0.03", "user_data": ""}, {"box": {"xmin": 1119, "ymin": 191, "xmax": 1263, "ymax": 238}, "dscore": 0.806, "label": "Serial Number", "rotation": 0, "texts": [{"value": "1074611", "score": 0.999}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "0.03", "user_data": ""}]}
{"camera_id": "camera-1", "timestamp": "2024-09-17T09:52:36.222153Z", "timestamp_local": "2024-09-17 09:52:36.222153+00:00", "timestamp_camera": null, "filename": "24-09-17-09-52-36.222153.jpg", "results": [{"box": {"xmin": 342, "ymin": 215, "xmax": 499, "ymax": 261}, "dscore": 0.872, "label": "Serial Number", "rotation": 0, "texts": [{"value": "1074735", "score": 0.999}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "1.17", "user_data": ""}, {"box": {"xmin": 343, "ymin": 263, "xmax": 413, "ymax": 301}, "dscore": 0.817, "label": "Size and Type Codes", "rotation": 0, "texts": [{"value": "45G1", "score": 1.0}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "1.17", "user_data": ""}, {"box": {"xmin": 240, "ymin": 215, "xmax": 318, "ymax": 261}, "dscore": 0.804, "label": "Owner Code and Category Identifier", "rotation": 0, "texts": [{"value": "FYCU", "score": 1.0}], "source_url": "/tmp/uploads/container-video.mp4", "position_sec": "1.17", "user_data": ""}]}

Webhooks

Container Information

Shipping Container Live On-Premise uses webhooks to send notifications when container info is detected in the video stream. If there are multiple containers, Shipping Container Live will send a separate request for each one.

  • The webhook data uses the timestamp set at frame arrival time as measured by Shipping Container Live. And also timestamp_camera set at capture time as measured by the camera (only if RTCP Sender Report was generated by the camera).
  • The response contains both the UTC timestamp and the local timestamp that reflects the timezone set in Shipping Container Live's config.

Example webhook JSON data:

{
"hook": {
"target": "https://webhook.site/12345",
"id": "camera-1",
"event": "recognition",
"filename": "camera-1_screenshots/24-09-17-09-53-17.079895.jpg"
},
"data": {
"results": [
{
"box": {"xmin": 519, "ymin": 101, "xmax": 539, "ymax": 266},
"dscore": 0.735,
"label": "Owner Code and Category Identifier",
"rotation": 0,
"texts": [{"value": "FYCU", "score": 0.996}],
"source_url": "/tmp/uploads/container-video.mp4",
"position_sec": "12.21",
"user_data": ""
},
{
"box": {"xmin": 532, "ymin": 284, "xmax": 561, "ymax": 591},
"dscore": 0.702,
"label": "Serial Number",
"rotation": 90,
"texts": [{"value": "1074714", "score": 0.985}],
"source_url": "/tmp/uploads/container-video.mp4",
"position_sec": "12.21",
"user_data": ""
},
{
"box": {"xmin": 583, "ymin": 86, "xmax": 603, "ymax": 260},
"dscore": 0.636,
"label": "Size and Type Codes",
"rotation": 90,
"texts": [{"value": "45G1", "score": 1.0}],
"source_url": "/tmp/uploads/container-video.mp4",
"position_sec": "12.21",
"user_data": ""
}
],
"timestamp": "2024-09-17T09:53:17.079895Z",
"timestamp_local": "2024-09-17 09:53:17.079895+00:00",
"timestamp_camera": "2024-09-17 09:53:16.956842+00:00",
"camera_id": "camera-1",
"filename": "camera-1_screenshots/24-09-17-09-53-17.079895.jpg"
}
}

Dwell Time

When dwell_time is turned on, a second POST request is sent later to the same url with no images attached and a different json field:

{
"hook": {
"event": "dwell_time",
"id": "camera-1",
"target": "https://webhook.site/12345"
},
"data": {
"results": [
{
"dwell_time": 4.0,
"first_seen": "2021-10-27 06:20:55.161444+00:00",
"last_seen": "2021-10-27 06:20:59.161444+00:00",
"texts": [
{"value": "FYCU", "score": 0.5}
],
"label": "Owner Code and Category Identifier",
"trajectory": [ // list of historical positions or null
{
"position_sec": 7.27,
"texts": [
{
"box": {"xmin": 1519, "ymin": 89, "xmax": 1594, "ymax": 111},
"dscore": 0.266
},
{
"box": {"xmin": 1243, "ymin": 110, "xmax": 1310, "ymax": 121},
"dscore": 0.345
}
],
"timestamp": "2021-10-27 06:20:55.161444Z",
"timestamp_local": "2021-10-27 06:20:55.161444+00:00",
"timestamp_camera": "2021-10-27 06:20:55.132891+00:00"
},
...
],
"user_data": "User's custom data"
},
{
"dwell_time": 4.0,
"first_seen": "2021-10-27 06:20:55.161444+00:00",
"last_seen": "2021-10-27 06:20:59.161444+00:00",
"texts": [
{"value": "1074714", "score": 0.63}
],
"label": "Serial Number",
"trajectory": [ // list of historical positions or null
{
"position_sec": 7.27,
"texts": [
{
"box": {"xmin": 1519, "ymin": 89, "xmax": 1594, "ymax": 111},
"dscore": 0.266
},
{
"box": {"xmin": 1243, "ymin": 110, "xmax": 1310, "ymax": 121},
"dscore": 0.345
}
],
"timestamp": "2021-10-27 06:20:55.161444Z",
"timestamp_local": "2021-10-27 06:20:55.161444+00:00",
"timestamp_camera": "2021-10-27 06:20:55.132891+00:00"
},
...
],
"user_data": "User's custom data"
}
],
"timestamp": "2021-10-27T06:20:55.161444Z",
"timestamp_local": "2021-10-27 06:20:55.161444+00:00",
"timestamp_camera": "2021-10-27 06:20:55.132891+00:00",
"camera_id": "camera-1"
}
}

Video Clip

When webhook video is turned on, another POST request is sent later to the same url with a video file attached in a video field (if video = file is set) and a different json field:

{
"hook": {
"target": "https://webhook.site/12345",
"id": "camera-1",
"event": "video_file",
"video_filename": "camera-1_videos/24-09-17-10-53-10.868727.mp4"
},
"data": {
"results": [
{
"texts": [{"value": "FYCU", "score": 0.996}],
"label": "Owner Code and Category Identifier",
"user_data": ""
},
{
"texts": [{"value": "1074714", "score": 0.985}],
"label": "Serial Number",
"user_data": ""
},
{
"texts": [{"value": "45G1", "score": 1.0}],
"label": "Size and Type Codes",
"user_data": ""
}
],
"timestamp": "2024-09-17T10:53:10.868727Z",
"timestamp_local": "2024-09-17 10:53:10.868727+00:00",
"timestamp_camera": null,
"url": "RESERVED",
"video_filename": "camera-1_videos/24-09-17-10-53-10.868727.mp4",
"camera_id": "camera-1"
}
}

Floating button icon
CTRL + .