Skip to content

1. Upload a video file, process it, display it, stop the process and remove the source

  1. Use the endpoint POST /video
curl -X 'POST' \
  'https://atr.senseaeronautics.com/video' \
  -H 'accept: application/json' \
  -H 'Content-Type: multipart/form-data' \
  -H 'api_key: <your-api-key>' \
  -F 'video=@sample_video.mp4;type=video/mp4'

A succesfull upload will provide a response like this:

{
  "source_uuid": "ba652053-0678-4f2a-88cb-0228695fbfd6"
}

This source_uuid is unique to the source and may be used to remove it or starting to process it. The response format is identical to the one given by the POST /stream

  1. Check that the video has been succesfully uploaded with the endpoint GET /sources
curl -X 'GET' \
  'https://atr.senseaeronautics.com/sources' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>'

The response will look something like this:

{
  "sources": {
    "ba652053-0678-4f2a-88cb-0228695fbfd6": {
      "uri": "sample_video.mp4",
      "resolution": null,
      "type": "video",
      "size": 90189450
    }
  }
}
  1. Start to process the video with the endpoint POST /start
curl -X 'POST' \
  'https://atr.senseaeronautics.com/start?source_uuid=ba652053-0678-4f2a-88cb-0228695fbfd6' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -d ''

The response will be:

{
  "process_uuid": "75002685-f400-4deb-aec7-0403d9496803",
  "feed_url": "https://atr.senseaeronautics.com/process/75002685-f400-4deb-aec7-0403d9496803/feed?api_key=<your-api-key>",
  "detection_data_url": "https://atr.senseaeronautics.com/process/75002685-f400-4deb-aec7-0403d9496803/detection_data?api_key=<your-api-key>
}

The process_uuid is unique to this process and may be used for controlling it. The provided "feed_url" allows to display the processed video feed on a web browser.

  1. Stop the process

As this example uses a video file, the process will stop on its own once the end of the file is reached. However, if the input was a video stream, we would want to stop it before we are able to run new processes and to avoid overflowing our quota. This can be done with the endpoint POST /process/{process_uuid}/stop:

curl -X 'POST' \
  'https://atr.senseaeronautics.com/process/75002685-f400-4deb-aec7-0403d9496803/stop' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -d ''
  1. Now that we are done, if we wish, we can remove the input source with the DELETE /source endpoint.
curl -X 'DELETE' \
  'https://atr.senseaeronautics.com/source?source_uuid=ba652053-0678-4f2a-88cb-0228695fbfd6' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>'