Video prediction Webhook
Getting updated video prediction data through the webhook.
Because the video prediction is an asynchronous process which can a few minutes to complete, users do not get prediction results when running a video prediction. This means that, in order to get the prediction results, the user needs to call the media results endpoint after a certain time and it may take a few tries until the prediction results are ready (polling).
The video prediction Webhook allows you to subscribe the video prediction service and to get prediction results as soon as the prediction is finalised, thus doing away with the need for polling.
How to use the webhook
In order to be able to use the Webhook the steps listed below should be followed:
- Create a custom endpoint that accepts the payload served by the webhook. Make sure you deploy the endpoint into a live environment that is secure and available (HTTPS).
- Reach out to your Customer Success Manager and provide information on your endpoint (the consumer of the endpoint data)
- We will enable the webhook for you and route it accordingly.
- After you run video predictions, the endpoint will forward the video prediction results into your endpoint via the webhook. You can push those results into your own front-end through some websocket.
Webhook payload
Below here's an example of what the video prediction webhook payload looks like.
{
"media_type": "video",
"media_id": "f5f0b1d0-24ea-4809-9c3b-10aa7f3a9786",
"metrics": {
"focus": 33.41148472957578,
"focus_first_two": 65.36522885282967,
"focus_last_two": 10.649246411447642,
"cognitive_demand": 90.03412773067865,
"cognitive_demand_end": 88.24339649840836,
"cognitive_demand_start": 91.53180923620239
},
"status": "done",
"results": {
"formatted": "https://files.neuronsinc.com/media_nvai_formatted.mp4",
"heat": "https://files.neuronsinc.com/media_nvai_heat.mp4",
"fog": "https://files.neuronsinc.com/media_nvai_fog.mp4",
"metrics": "https://files.neuronsinc.com/media_nvai_metrics.json",
"brand_detection": "https://files.neuronsinc.com/media_brand_detection.json",
"brand_detection_metrics": "https://files.neuronsinc.com/media_brand_detection_metrics.json",
"thumb_heat": "https://files.neuronsinc.com/media_nvai_heat_thumbnail.jpeg",
"thumb_form": "https://files.neuronsinc.com/media_nvai_formatted_thumbnail.jpeg",
"thumb_fog": "https://files.neuronsinc.com/media_nvai_fog_thumbnail.jpeg"
}
}
Information on how to interpret video prediction results can be found here.
Updated 22 days ago