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", "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": ""}], "timestamp_local": "2024-09-17 09:52:30.565732+00:00"}
{"camera_id": "camera-1", "timestamp": "2024-09-17T09:52:36.222153Z", "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": ""}], "timestamp_local": "2024-09-17 09:52:36.222153+00:00"}

Webhooks

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.

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": {
"camera_id": "camera-1",
"filename": "camera-1_screenshots/24-09-17-09-53-17.079895.jpg",
"timestamp": "2024-09-17T09:53:17.079895Z",
"timestamp_local": "2024-09-17 09:53:17.079895+00:00",
"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": ""
}
]
}
}

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/3b0da839-e992-4c4c-b3fe-fa280fab7aca",
"id": "camera-1",
"event": "video_file",
"video_filename": "camera-1_videos/24-09-17-10-53-10.868727.mp4"
},
"data": {
"camera_id": "camera-1",
"video_filename": "camera-1_videos/24-09-17-10-53-10.868727.mp4",
"url": "RESERVED",
"timestamp": "2024-09-17T10:53:10.868727Z",
"timestamp_local": "2024-09-17 10:53:10.868727+00:00",
"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": ""
}
]
}
}

Floating button icon
CTRL + .