Sending Metadata to AI Bridge via REST not working

We have our AI Bridge up and running in Kubernetes, we have a camera connected successfully ANALYTICS_EVENTS working successfully.

We are having trouble with getting the metadata to work, this is what I have:

When we query the AI Bridge for the camera and the metadata topics, we successfully get:

{
  "data": {
    "metadataTopics": [
      {
        "appID": "28a6bc9a-0833-46c6-958e-19da4ee6d9e5",
        "metadataFormat": "ONVIF_ANALYTICS",
        "topicName": "plates",
        "topicAvailability": {
          "rest": "http://lpraibridge.anpr.lan:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics",
          "kafka": "metadata.28a6bc9a-0833-46c6-958e-19da4ee6d9e5.plates.onvif_analytics",
          "grpc": "grpc://lpraibridge.anpr.lan:8383"
        }
      }
    ],
    "cameras": [
      {
        "videoStreams": [
          {
            "id": "ff2aba6d-4656-4e2f-8e86-d4c4f4ca1413/28dc44c3-079e-4c94-8ec9-60363451eb40"
          }
        ],
        "id": "ff2aba6d-4656-4e2f-8e86-d4c4f4ca1413"
      }
    ]
  }
}

But when we try and use REST to POST some metadata (dummy metadata) to the VideoStream ID listed in the query result above, nothing happens (as if AI Bridge is not recognizing that URL):

POST http://lpraibridge.anpr.lan:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics/

body:

<tt:MetadataStream xmlns:tt="http://www.onvif.org/ver10/schema">
    <tt:VideoAnalytics>
        <tt:Frame UtcTime="2023-12-18T19:42:59.397+00:00" SourceStreamID="ff2aba6d-4656-4e2f-8e86-d4c4f4ca1413/28dc44c3-079e-4c94-8ec9-60363451eb40">
            <tt:Object ObjectId="1">
                <tt:Appearance>
                    <tt:Class>
                        <tt:ClassCandidate>
                            <tt:Type>Vehicle</tt:Type>
                            <tt:Likelihood>0.86</tt:Likelihood>
                        </tt:ClassCandidate>
                    </tt:Class>
                    <tt:VehicleInfo>
                        <tt:Type>Car</tt:Type>
                        <tt:Brand>Ford</tt:Brand>
                        <tt:Model>Mustang</tt:Model>
                    </tt:VehicleInfo>
                    <tt:Shape>
                        <tt:BoundingBox bottom="0.46875" right="0.321875" top="0.515625" left="0.275"/>
                        <tt:CenterOfGravity y="0.298" x="0.492"/>
                    </tt:Shape>
                </tt:Appearance>
            </tt:Object>
        </tt:Frame>
    </tt:VideoAnalytics>
</tt:MetadataStream>

There is no response in Postman, there are no logs in the proxy pod regarding this, although the analytics events run successfully (i.e. connection is clearly being made).

Any ideas on how to start debugging?

Im also stuck here how do i know if the metadata has reached the VMS or not, and im also wondering how exactly do you display the metadata on already present camera streams in VMS?

For metadata connectivity debugging,

Please consult Introduction to metadata (milestonesys.com) for how to utilize metadata in XProtect, including displaying bounding boxes with the video.

Hi,

Just to add to @Hans Kierulff​ answer.

The graphql query will give you the rest URL with the hostname being the cluster hostname and that is correct. When running from within an application, running on the cluster, the load balancer will redirect the HTTP request to the right pod.

Both requests should work for your application when running on the cluster:

POST http://lpraibridge.anpr.lan:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics/ 
 
# Or including the cameraID_StreamID in the request URL
 
POST http://lpraibridge.anpr.lan:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics/<cameraID_streamID>

Meanwhile, you should replace the hostname in the URL to the name of the pod when testing using postman.

POST http://<aib-broker-pod-hostname>:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics/
 
# Or including the cameraID_StreamID in the request URL
 
POST http://<aib-broker-pod-hostname>:8382/metadata/28a6bc9a-0833-46c6-958e-19da4ee6d9e5/plates/onvif_analytics/<cameraID_streamID>

As of today, the Ingress service for AIBridge exposes only routes for `aibridge-health` and `aibridge-proxy`. However, we provide a debug template for the Ingress that you can use when testing your application, which will expose more endpoints for you to use from an external application to the K8s cluster such as postman.

Hope this answer helps you identify and solve the issue!

Have a nice day,