動態內嵌通知

在本主題中,您將了解使用動態內嵌 API 提交的動態傳遞內嵌工作的通知。

動態內嵌 API 通知

您可以指定一或多個回呼 URL,以接收內嵌程序結果的通知。您指定的網址應適用於可以接受POST請求的應用。通知將以 JSON 格式發送。

設定

這是一個例子。

  • 發布 ID 為 57838016001 的用戶
  • 想要使用動態內嵌來上傳位於 https://s3.amazonaws.com/bucket/mysourcevideo.mp4 的來源視訊檔案
  • 想要上傳目錄中的現有標題,其中包含影片識別碼為 5199670523001
  • 使用多平台標準靜態配置文件
  • 想要在分別位於 https://host1/path1 和 https://host2/path2 的兩個端點接收回調

DI 請求看起來像這樣:

張貼請求

要求主體

    {
      "master": {
        "url": "https://s3.amazonaws.com/bucket/mysourcevideo.mp4"
      },
      "profile": "multi-platform-standard-static",
      "callbacks": ["https://host1/path1”, “https://host2/path2”]
    }

通知範例

通知作為 POST 請求發送,請求正文中的通知作為 JSON [1] .這是來自典型視頻攝取作業的全套通知:

{
      "entity": "default\/audio192",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/audio192",
      "language": "en",
      "variant": "main",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/audio64",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/audio64",
      "language": "en",
      "variant": "main",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/audio96",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/audio96",
      "language": "en",
      "variant": "main",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/audio128",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/audio128",
      "language": "en",
      "variant": "main",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "5660367449001",
      "entityType": "DIGITAL_MASTER",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video450",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video450",
      "bitrate": 451,
      "width": 480,
      "height": 270,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "5660367449001",
      "entityType": "TITLE",
      "version": "1",
      "action": "PUBLISH",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "thumbnail",
      "entityType": "ASSET",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "poster",
      "entityType": "ASSET",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video900",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video900",
      "bitrate": 901,
      "width": 640,
      "height": 360,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video700",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video700",
      "bitrate": 700,
      "width": 640,
      "height": 360,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video1200",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video1200",
      "bitrate": 1204,
      "width": 960,
      "height": 540,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video1700",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video1700",
      "bitrate": 1703,
      "width": 960,
      "height": 540,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video3500",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video3500",
      "bitrate": 3498,
      "width": 1920,
      "height": 1080,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video2000",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video2000",
      "bitrate": 2000,
      "width": 1280,
      "height": 720,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "default\/video3800",
      "entityType": "DYNAMIC_RENDITION",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "dynamicRenditionId": "default\/video3800",
      "bitrate": 3804,
      "width": 1920,
      "height": 1080,
      "accountId": "57838016001",
      "status": "SUCCESS"
    }
{
      "entity": "5660367449001",
      "entityType": "TITLE",
      "version": "1",
      "action": "CREATE",
      "jobId": "d3ef8751-2b88-4141-95d5-83f0393aca07",
      "videoId": "5660367449001",
      "accountId": "57838016001",
      "status": "SUCCESS"
    }

通知欄位

料號 描述
status FAILED如果再現的攝取或創建不成功,SUCCESS如果請求成功
accountId 帳號 ID
videoId 視訊識別碼
jobId 動態內嵌要求的工作識別碼
entity TITLE 的實體名稱或視頻的視頻雲 ID
entityType 該種資產報告-例如:標題 (視訊)、數位代理程式、資產 (轉譯、註解檔案或影像)
bitrate 再現比特率
width 演繹的幀寬度
height 渲染的幀高
errorMessage 解釋為什麼攝取失敗
version 一個字符串總是等於"1"
action 發生的行動-例如,創建

解譯通知

通知包含"action": "CREATE""status": "SUCCESS"表示一個過程的完成。

  • 如果entityTypeTITLE , 那麼攝取的視頻處理就完成了。
  • 為了entityType: TITLE , action: PUBLISH指的是視頻被激活的時間。對於立即激活的視頻,這與CREATE時間。
  • 如果entityTypeASSET , DYNAMIC_RENDITION或者DIGITAL_MASTER , 那麼演繹版、圖像、清單、WebVTT 文件或數字母版已成功添加到您的視頻中。

防火牆

如果您的組織對通過防火牆的傳入流量的來源有嚴格的政策,我們允許使用AWS us-east-1 / Virginia IP。這可能會有所變更,因此所有 AWS IP 都應該列入白名單。看https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html了解更多信息。