dolby.io RASP API Configuration

The dolby Rasp API configuration can be found in:

  • {System-System bucket}/configuration/transcode-templates/rasp
  • Your system includes an hls example.

General Layout

{
	"name": "{{BASE_FILE_NAME}}",
	"urls": [
		{
			"url": "{{READ_ONLY_ACCESS_URL}}",
			"mime": "video/mp4",
			"credential_key": "{{CREDENTIAL_KEY}}",
			"id": "v0"
		}
	],
	"vurl_cors_policy": {
		"origins": [
			"ORIGIN-URL_1.com",
			"SUB-DOMAIN.ORIGIN-URL_1.com",
		]
	},
	"asset_mime": "video/mp4",
	"vurls": [
		{
			"vurl": "/{{BASE_FILE_NAME}}-hdr/hls.m3u8",
			"config": {
				"encode_profile": {
					"container": {
						"kind": "hls/fmp4"
					},
					"video": {
						"height": 720,
						"width": 1280,
						"bitrate_kb": 4000,
						"codec": "h264",
						"range": "hdr10",
						"preset": "veryfast"
					},
					"audio": [
						{
							"codec": "aac",
							"bitrate_kb": 128,
							"channels": 2
						}
					]
				}
			},
			"config_mime": "application/json",
			"authentication": {
				"kind": "http_header_token",
				"token": "{{RASP_AUTHORIZATION_KEY}}"
			},
			"mime": "application/x-mpegurl"
		}
	]
}
📘

TOKENS

Items wrapped in double { characters are tokens that get automatically replaced by the system during runtime.

{{READ_ONLY_ACCESS_URL}}

{{BASE_FILE_NAME}}

{{CREDENTIAL_KEY}}

📘

DOCUMENTATION

[> 📘 https://[YOUR-SUB-DOMAIN].dolbyrasp.com/documentation/](> 📘 https://[YOUR-SUB-DOMAIN].dolbyrasp.com/documentation/)

In order for the Rasp API to authenticate your users requests for media you will need to call the /credentials api endpoint via POSTMAN, cUrl, or JavaScript FETCH, an example is shown below.

curl --location 'https://[YOUR-SUB-DOMAIN].dolbyrasp.com/api/credentials' \
--header 'Content-Type: application/json' \
--data '{
  "key_name": "<NAME_OF_BUCKET>",
  "kind": "cloud_s3",
  "body": {
    "access_key_id": "***********",
    "secret_access_key": "***********"
  }
}'
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")

$body = @"
{
  `"key_name`": `"<NAME_OF_BUCKET>`",
  `"kind`": `"cloud_s3`",
  `"body`": {
    `"access_key_id`": `"***********`",
    `"secret_access_key`": `"***********`"
  }
}
"@

$response = Invoke-RestMethod 'https://[YOUR-SUB-DOMAIN].dolbyrasp.com/api/credentials' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

const raw = JSON.stringify({
  "key_name": "<NAME_OF_BUCKET>",
  "kind": "cloud_s3",
  "body": {
    "access_key_id": "***********",
    "secret_access_key": "***********"
  }
});

const requestOptions = {
  method: "POST",
  headers: myHeaders,
  body: raw,
  redirect: "follow"
};

fetch("https://[YOUR-SUB-DOMAIN].dolbyrasp.com/api/credentials", requestOptions)
  .then((response) => response.text())
  .then((result) => console.log(result))
  .catch((error) => console.error(error));
🚧

CREDENTIAL KEY

The name of the key "<NAME_OF_BUCKET>" in the curl POST above is used to replace the {{CREDENTIAL_KEY}} token in subsequent requests to produce the HLS results.