Skip to content

2. Process a dolby stream and visualize it processed on dolby.io

  1. Use the endpoint POST /stream for posting your dolby stream. Like this:
curl -X 'POST' \
  'https://atr.senseaeronautics.com/stream' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "input_url": "https://director.millicast.com/api/director/subscribe/{dolby_account_id}/
    {your_stream_name}?token={dolby_token}",
    }

If you are not using a token, you can post the stream as:

curl -X 'POST' \
  'https://atr.senseaeronautics.com/stream' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "input_url": "https://director.millicast.com/api/director/subscribe/{dolby_account_id}/
    {your_stream_name}",
    }

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 source 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. Post your desired output with the endpoint POST /output
curl -X 'POST' \
  'https://atr.senseaeronautics.com/output' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -H 'Content-Type: application/json' \
  -d '{
  "type": "rtmp",
  "url":  "rtmp://rtmp-auto.millicast.com:1935/v2/pub/<stream_name>?token=<stream_token>"
}'

The response will provide the unique output uuid identifier:

{
  "output_uuid": "7cdf1062-c303-437b-8717-18a8e13c0450"
}

This key will be required for launching an output later.

  1. Check the output was succesfully uploaded with GET /outputs
curl -X 'GET' \
  'http://0.0.0.0:5000/outputs' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>'

The response will look like:

{
  "outputs": {
    "7cdf1062-c303-437b-8717-18a8e13c0450": {
      "type": "rtmp",
      "url": "rtmp://rtmp-auto.millicast.com:1935/v2/pub/<stream_name>?token=<stream_token>"
    }
  }
}
  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 watch the processed video feed on a web browser.

  1. Launch output

Now that we have a running process and succesfully uploaded an output, we can start writing to the output with the endpoint POST /process/{process_uuid}/{output_uuid}:

curl -X 'POST' \
  'http://0.0.0.0:5000/process/91f42dec-b4aa-4d21-a79b-a4a894ea8785/91f42dec-b4aa-4d21-a79b-a4a894ea8785' \
  -H 'accept: application/json' \
  -H 'api_key: <your-api-key>' \
  -d ''

A response with code 200 is provided if the output is launched correctly. Other possible responses are listed on the swagger documentation.