

# Amazon IVS 多軌視訊：廣播軟體整合指南
<a name="multitrack-video-sw-integration"></a>

## 簡介
<a name="multitrack-video-sw-integration-intro"></a>

對於宣稱支援 IVS 多軌視訊的第三方廣播軟體工具或服務，該工具或服務必須遵循本指南並實作兩項必要功能：[自動串流組態](#multitrack-video-sw-integration-auto-stream)和[廣播效能指標](#multitrack-video-sw-integration-broadcast-perf-metrics)。我們也強烈建議您實作[建議的功能](#multitrack-video-sw-integration-recommended-features)。

下圖顯示廣播軟體與 Amazon IVS 之間的高層互動：

![\[廣播軟體與 Amazon IVS 之間的高層互動。\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/images/Workflow.png)


### 目標對象
<a name="multitrack-video-sw-integration-intro-audience"></a>

本文件旨在為以下軟體開發人員提供指引，協助他們實作多軌視訊的用戶端支援：
+ *創作者廣播軟體*：這類軟體設計用於串流至 Amazon IVS，或串流至使用 Amazon IVS 多軌視訊的服務。
+ *第三方串流平台*：這類平台提供伺服器端同步轉播或轉碼功能，且使用者將串流至 Amazon IVS，或串流至使用 Amazon IVS 多軌視訊的服務。

### 術語
<a name="multitrack-video-sw-integration-intro-terminology"></a>

本文件會交替使用以下幾個詞彙：
+ **使用者、創作者、廣播者**：使用廣播軟體創作和串流原始內容的最終使用者。
+ **服務、平台**：像 Amazon IVS 之類的視訊平台或服務。
+ **客戶**：可能使用像 Amazon IVS 這類服務來架設視訊網站的企業。

## 必要功能：自動串流組態
<a name="multitrack-video-sw-integration-auto-stream"></a>

自動串流組態可協助使用者快速開始使用，並隨時間自動提升串流品質。不同於使用者手動選擇設定 (例如位元速率、解析度、影格速率)，且設定一次後很少調整，自動串流組態會在每次使用者啟動新串流時，考慮目前的軟體設定、硬體組態和平台支援。例如，當使用者升級設定 (例如，使用新的 GPU)、安裝新的 GPU 驅動程式，或目的地開始支援新的轉碼器 (例如，H.265/HEVC) 時，自動串流組態會反應並提升使用者下一個串流的品質。

### 開始直播
<a name="multitrack-video-sw-integration-auto-stream-going-live"></a>

當使用者開始串流時，您的軟體必須查詢使用者的硬體和軟體設定資訊、呼叫 GetClientConfiguration、設定視訊縮放器/編碼器，以及開啟[增強型 RTMP](https://veovera.org/docs/enhanced/enhanced-rtmp-v2) (E-RTMP) 連線。以下詳細說明這些步驟。

### 使用 GetClientConfiguration
<a name="multitrack-video-sw-integration-auto-stream-use-getclientconfig"></a>

[GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 需要使用者的硬體和軟體設定資訊。

演算法會考慮許多因素來提供符合以下條件的組態：
+ 最佳觀看體驗：最高解析度、最高影格速率、最高位元速率、最多軌數、最新/最佳轉碼器，以及最佳視訊編碼器設定。
+ 確保串流者的設定、廣播軟體、使用者設定的限制和目的地服務均可安全支援。

在實際情況下，我們會遇到很多限制，包括較舊的 GPU、訊號不良的網路、特定的使用者設定、GPU 資源競用，以及平台轉碼器支援不足。當面臨這些限制時，自動串流組態應逐漸且合理地應變。例如：
+ 將串流所需的頻寬在 10.2 Mbps (5 個轉譯版本) 和 1.5 Mbps (2 個轉譯版本) 之間進行變動。
+ 將最高品質視訊軌的最大解析度從 1080p (4 或 5 個轉譯版本) 調降為 480p (2 個轉譯版本) 進行變動。
+ 將轉譯版本的數量在 5 個 (1080p、720p、480p、360p、160p) 和 2 個 (480p、360p) 之間進行變動。
+ 將支援的眾多解析度 (1080p、720p、540p、480p、360p、240p 和 160p) 中的轉譯版本選項進行變動。
+ 將各個轉譯版本的位元速率從 6 Mbps (例如 1080p60 AVC) 調降為 200 Kbps (例如 160p AVC) 進行變動。
+ 將影格速率從高 (60、50 或 48 fps) 調至標準 (30、25 或 24 fps)。
+ 對視訊轉碼器進行變動，以平衡安全性/觀看裝置支援和轉碼效率 (H.264/AVC 和 H.265/HEVC)。
+ 對縮放演算法 (例如 Lanczos、雙立方和雙線性) 進行變動，以平衡 GPU 資源。
+ 根據 GPU 供應商和驅動程式版本 (例如，NVIDIA GeForce RTX 4080 使用 P6，而 NVIDIA GeForce GTX 950 則降至 P4)，對視訊編碼設定 (包括轉碼器設定檔、編碼器預設、前瞻視窗、心理視覺 AQ 和 B 影格數量) 進行變動。

#### 將偏好設定公開給使用者
<a name="multitrack-video-sw-integration-auto-stream-use-getclientconfig-preferences"></a>

您必須啟用使用者來配置下列設定：
+ 輸出解析度
+ 輸出影格速率
+ 視訊軌數量上限
+ 串流位元速率上限

#### 選用：在廣播軟體中設定限制
<a name="multitrack-video-sw-integration-auto-stream-use-getclientconfig-limits-in-software"></a>

您的軟體或服務可能會提供預設值，或限制使用者配置這些設定的能力。例如，如果您的軟體或服務需要保留 GPU 資源，而且您想要限制多軌視訊使用的視訊編碼器工作階段數量，您可以選擇將使用者的**視訊軌數量上限**限制為 3 個，並清楚向使用者指出**自動**代表「最多 3 個」。

#### 根據目的地設定的限制
<a name="multitrack-video-sw-integration-auto-stream-use-getclientconfig-limits-by-destination"></a>

為了讓服務可以識別頻道，並確認每個頻道是否有個別限制，您需要在 GetClientConfiguration 請求中提供串流金鑰。例如，Amazon IVS 為 `STANDARD` 頻道提供 `multitrackInputConfiguration.maximumResolution` 屬性。這可用於限制個別視訊軌的解析度，讓客戶可以為特定創作者提供特殊品質 (例如 720p60 或 1080p60 串流)，或控制他們的輸出成本。

#### 處理警告和錯誤
<a name="multitrack-video-sw-integration-auto-stream-use-getclientconfig-errors"></a>

GetClientConfiguration 會在不同的情況下傳回警告和錯誤，因此您必須實作直接提供給使用者的支援，以同時處理警告和錯誤。

*警告*訊息僅供參考，應允許使用者繼續串流或取消串流。以下是警告訊息的範例：
+ 使用者電腦上安裝的 NVIDIA 驅動程式版本將於 YYYY 年 MM 月 DD 日終止支援。

*錯誤*訊息則會被視為重大問題。不應允許使用者繼續串流。以下是錯誤訊息的範例：
+ 頻道未設定為支援多軌視訊。
+ 過舊/不支援的 GPU 驅動程式版本。
+ 系統不支援您的 GPU。
+ 提供的串流金鑰無效。
+ Amazon IVS 多軌視訊不支援影格速率 59.94。在設定 > 視訊中，選取下列其中一個支援的值：24、25、30、48、50、60。
+ 組態請求缺少必要資料 (GPU 驅動程式版本、GPU 模型等)。

### 設定視訊擴展和編碼
<a name="multitrack-video-sw-integration-auto-stream-configure-video"></a>

[GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 會傳回能提供最佳觀看體驗的擴展和編碼設定，而不會影響應用程式 (例如遊戲/廣播軟體) 效能，並將使用者的設定納入考量。請使用 GetClientConfiguration 傳回的正確擴展和編碼設定。GetClientConfiguration 會考量不同供應商和 GPU 架構隨時間變化的特定需求。

除了擴展和編碼設定 (如預設) 之外，您還必須：
+ *將所有編碼器保持一致，並確保所有轉譯版本的 IDR 具有相同 PTS。*這項要求是為了避免在使用分段 HLS 播送和檢視視訊時，需要將多個版本保持一致的伺服器端轉碼。如果未將視訊軌中的 IDR 保持一致，觀看裝置將會在 ABR 播放中切換轉譯版本時會遇到時間偏移和停頓。(如需視覺化，請參閱[廣播效能指標](#multitrack-video-sw-integration-broadcast-perf-metrics)中的圖表)。
+ *複製所有視訊軌的 SEI/OBU 資料 (例如字幕)。*這項要求是為了讓視訊播放器可以存取 SEI/OBU 資料，無論觀看的單獨品質為何。

### 使用增強型 RTMP 連線
<a name="multitrack-video-sw-integration-auto-stream-enhanced-rtmp"></a>

如需透過增強型 RTMP 進行多軌串流的說明文件，請參閱[增強型 RTMP 第 2 版規格](https://veovera.org/docs/enhanced/enhanced-rtmp-v2)。

與增強型 RTMP 連線時，Amazon IVS 多軌視訊有幾項必要條件：
+ 主要的高畫質視訊軌必須封裝，並以增強型 RTMP 單軌視訊封包的形式傳送。例如，`videoPacketType` 可以是 `CodedFrames`、`CodedFramesX`、`SequenceStart` 和 `SequenceEnd`。
+ 所有其他的視訊軌都必須封裝，並以增強型 RTMP 多軌視訊封包 (例如，`videoPacketType` 為 `Multitrack`) 的形式傳送，且多軌封包類型設定為一軌 (例如，`videoMultitrackType` 為 `OneTrack`)。
+ [GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 傳回 `authentication` 欄位中的串流金鑰，必須用來連線至 RTMP 伺服器。
+ [GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 傳回的 `config_id` 值必須做為查詢引數附加到 RTMP 連線字串中，並使用鍵值 `clientConfigId`。

以下是串流組態的範例：


|  videoPacketType  |  videoMultitrackType  |  trackId  |  Resolution  | 
| --- | --- | --- | --- | 
|  CodedFrames CodedFramesX SequenceStart SequenceEnd  |  NA – videoMultitrackType 不會與單軌增強型 RTMP 一起傳送。  |  NA – trackId 不會與單軌增強型 RTMP 一起傳送。  |  1920x1080  | 
|  Multitrack  |  OneTrack  |  1  |  1280x720  | 
|  Multitrack  |  OneTrack  |  2  |  852x480  | 
|  Multitrack  |  OneTrack  |  3  |  640x360  | 

您的廣播軟體應使用 [GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 在 `ingest_endpoints` 中傳回的資料，以及使用者選取的通訊協定 (RTMP 或 RTMPS)，以識別要連線的端點。使用 `authentication` 中傳回的 `url_template` 和串流金鑰來建立 URL，並將 `config_id` 包含為 `clientConfigId` 查詢引數。如果您讓使用者指定 RTMP 查詢引數 (例如 `?bandwidthtest=1`)，除了指定 `clientConfigId` 之外，還必須附加這些引數。以下是 GetClientConfiguration 回應的範例：

```
{
   "ingest_endpoints": [
      {
         "protocol": "RTMP",
         "url_template": "rtmp://iad05.contribute.live-video.net/app/{stream_key}",
         "authentication": "v1_5f2e593731dad88b6bdb03a3517d306ef88a73e29619ee4b49012d557e881484_65c5dc81_7b2276223a302c2262223a393939392c2274223a5b7b2277223a3634302c2268223a3336302c2262223a3530302c226330223a312c226331223a302c226332223a307d2c7b2277223a313238302c2268223a3732302c2262223a313730302c226330223a312c226331223a302c226332223a307d2c7b2277223a313932302c2268223a313038302c2262223a363030302c226330223a312c226331223a302c226332223a307d5d7d_live_495665160_FC45sNuCYUwLnCVtCnXSjEWkusXzJI"
      },
      {
         "protocol": "RTMPS",
         "url_template": "rtmps://iad05.contribute.live-video.net/app/{stream_key}",
         "authentication": "v1_5f2e593731dad88b6bdb03a3517d306ef88a73e29619ee4b49012d557e881484_65c5dc81_7b2276223a302c2262223a393939392c2274223a5b7b2277223a3634302c2268223a3336302c2262223a3530302c226330223a312c226331223a302c226332223a307d2c7b2277223a313238302c2268223a3732302c2262223a313730302c226330223a312c226331223a302c226332223a307d2c7b2277223a313932302c2268223a313038302c2262223a363030302c226330223a312c226331223a302c226332223a307d5d7d_live_495665160_FC45sNuCYUwLnCVtCnXSjEWkusXzJI"
      }
   ],
   "meta": {
      "config_id": "d34c2f7e-ce3a-4be4-a6a0-f51960abbc4f",
      …
   }
   …
}
```

然後，如果使用者選取 RTMP，您會開啟以下連線：

```
rtmp://iad05.contribute.live-video.net/app/v1_5f2e593731dad88b6bdb03a3517d306ef88a73e29619ee4b49012d557e881484_65c5dc81_7b2276223a302c2262223a393939392c2274223a5b7b2277223a3634302c2268223a3336302c2262223a3530302c226330223a312c226331223a302c226332223a307d2c7b2277223a313238302c2268223a3732302c2262223a313730302c226330223a312c226331223a302c226332223a307d2c7b2277223a313932302c2268223a313038302c2262223a363030302c226330223a312c226331223a302c226332223a307d5d7d_live_495665160_FC45sNuCYUwLnCVtCnXSjEWkusXzJI?clientConfigId=d34c2f7e-ce3a-4be4-a6a0-f51960abbc4f
```

#### 處理視訊中斷連線的問題
<a name="multitrack-video-sw-integration-auto-stream-enhanced-rtmp-disconnects"></a>

多軌視訊系統會強制執行數個限制。一般而言，出現限制有三個原因：

1. 系統安全：為提升可擴展性，IVS 需要限制輸入。例如，每個頻道的串流頻寬限制會影響輸入處理、每個軌道或解析度的位元速率配額會影響輸出容量/成本，以及軌道數量的配額會影響 CDN 複寫/傳遞容量。

1. 系統功能：為確保功能相容性 (例如，平台支援個別轉碼器，或傳輸容器支援進階轉碼器)，服務需要限制輸入。

1. 觀眾體驗：為確保觀眾體驗良好並維護品牌聲譽，服務需要限制輸入。舉例來說，服務控制播放器 ABR 演算法，以提升所有目標使用者裝置 (桌上型電腦、行動裝置、電視/OTT 等) 和應用程式 (瀏覽器、原生等) 的觀看體驗品質。

視訊系統會在下列幾種情況下中斷用戶端連線：
+ 用戶端嘗試使用多軌視訊連線至 RTMP 伺服器，但不使用 [GetClientConfiguration](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-GetClientConfiguration.html) 傳回的串流金鑰。
+ 用戶端提供的多軌視訊不符合 GetClientConfiguration 傳回的規格。例如：
  + 軌道數不相符。
  + 個別軌道的轉碼器不相符。
  + 個別軌道的解析度不相符。
  + 個別軌道的影格速率不相符。
  + 個別軌道的位元速率不相符。
+ 用戶端提供的視訊軌沒有對齊 IDR。
+ 每個軌道上的每個 IDR 之前並不是都有廣播效能指標。

中斷連線可能發生在串流的開頭 (即頻道從未上線) 或串流中途 (即頻道已上線，但偵測到不相符，然後用戶端中斷連線)。

#### 自動重新連線
<a name="multitrack-video-sw-integration-auto-stream-enhanced-rtmp-auto-reconnecting"></a>

GetClientConfiguration 傳回的串流金鑰在 48 小時內有效，或直到呼叫 DeleteStreamKey 使串流金鑰失效為止。IVS 串流的持續時間上限為 48 小時；48 小時後，串流會終止，串流工作階段也會中斷連線。成功的重新連線 (自動或手動) 會啟動新的串流。

您的廣播軟體可能會實作自動重新連線。如果您支援自動重新連線，您應該允許使用者啟用/停用這項功能，並遵循下列準則：
+ 在嘗試連線之間，實作指數退避重試延遲 (包括小型隨機偏差)。
+ 嘗試連線最多重試 25 次。例如，OBS Studio 會重試 25 次，每次重試之間的等待時間呈指數增長，但最長不超過 15 分鐘。實際上，這意味著最後一次重試大約在斷線 3 小時後發生。
+ 如果連線時傳送 `publish` 後立即中斷連線，請呼叫 GetClientConfiguration，重新設定編碼器設定，然後再次嘗試連線。

#### 停止串流並中斷連線
<a name="multitrack-video-sw-integration-auto-stream-enhanced-rtmp-stopping-and-reconnecting"></a>

當使用者停止串流時，如果 TCP 連線仍然開啟 (例如，較低層級連線未重設)，您必須先傳送 FCUnpublish (例如 [OBS Studio 中的實作](https://github.com/obsproject/obs-studio/blob/master/plugins/obs-outputs/librtmp/rtmp.c#L1973-L1999))，然後再關閉 RTMP 連線。此動作非常關鍵，這代表向系統發出使用者想要結束串流的訊號，下游功能依賴此訊號才能正常運作。

## 必要功能：廣播效能指標 (BPM)
<a name="multitrack-video-sw-integration-broadcast-perf-metrics"></a>

為了持續改善自動串流組態，提供最佳串流設定，必須測量和傳送廣播效能指標 (BPM)。

這些指標是透過 SEI (針對 AVC/HEVC) 訊息，以頻內方式收集並傳送。系統會收集兩類資料：
+ *時間戳記*：收集這類資料是為了測量廣播者和觀眾之間的端對端延遲。對於以下用途相當實用：
  + 為廣播者或觀眾提供端對端延遲的預估時間。
  + 分析可能表示系統壓力或網路訊號不良的時間戳記抖動。
  + 參考實際事件時間，以調整和彙總時間序列計數器資料。

  從廣播者傳送的時間戳記是以全球通用參考時鐘為基礎，通常是使用 UTC\$10 時區的 NTP 同步時鐘。RFC3339 通常用於 "網際網路時間" 這類情境。這個絕對參考值讓計算時間差變得相當簡單。
+ *影格計數器*：收集這類資料是為了測量廣播軟體和視訊編碼器在影格層級的效能。對於以下用途相當實用：
  + 為廣播者提供包含其他訊號的效能儀表板，有助他們改善串流設定。
  + 提供可能與環境變化 (例如，新發布的 GPU 驅動程式或作業系統版本/修補程式) 相關的主動訊號。
  + 提供回饋，讓視訊服務安全地迭代和發布 GetClientConfiguration 的改進功能，包括對新硬體供應商、新 GPU 型號、新轉碼器、新驅動程式功能、其他視訊編碼器設定調校，以及新使用者控制的預設項 (例如「雙電腦設定」與「遊戲 \$1 串流設定」) 的支援。

### 插入 SEI/OBU 訊息
<a name="multitrack-video-sw-integration-auto-stream-broadcast-perf-metrics-seiobu-messages"></a>

如需特定的訊息位元組串流定義，請參閱 [BPM 訊息定義](#multitrack-video-sw-integration-performance-metrics-definitions)。

BPM 指標必須插入 IDR 之前的所有視訊軌。三個訊息 (BPM TS、BPM SM 和 BPM ERM) 應一起傳送，但每個訊息應做為一個獨立的 NUT (AVC/HEVC) 傳送。

在第一個區段中傳送的 BPM SM 和 BPM ERM 應該將影格計數器設定為 0。起初，這可能看起來不合理；但是，計數器 (例如，每個轉譯編碼的影格數目) 在編碼完成後才會出現有意義的資料，這樣區段 N 中的影格計數器與區段 N-1 才會一致。建議您將 BPM 指標視為在 IDR 間隔內，透過視訊位元速率傳遞的定時資料序列。如有必要，接收端應使用提供的時間戳記，對資料序列進行精確地重新對齊。

以下提供三種多軌串流的典型案例。一般區段大小為兩秒時，每個轉譯版本的指標將每兩秒傳送一次。

![\[供三種多軌串流的典型案例。\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/images/BPM_-_Insert_SEI_OBU_Messages.png)


## 推薦功能
<a name="multitrack-video-sw-integration-recommended-features"></a>

### 允許自動選取伺服器
<a name="multitrack-video-sw-integration-recommended-features-auto-server-selection"></a>

自動選取伺服器功能可根據全球網路條件的變化，以及可用的擷取 PoP (存取點)，協助使用者選取最適合即時串流連線的擷取伺服器。

如果您的廣播軟體支援自動選取伺服器功能，則根據軟體是否實作 GetClientConfiguration 和/或 FindIngest，我們預期會有不同的行為。每個案例分別列出如下。

如果廣播軟體同時實作 GetClientConfiguration 和 FindIngest：


|  使用者 UI 選取  |  連線至以下值指定的擷取端點  | 
| --- | --- | 
|  Auto  |  GetClientConfiguration  | 
|  透過 FindIngest 擷取特定端點  |  使用者自行選取  | 
|  指定自訂伺服器  |  使用者自行選取  | 

如果廣播軟體實作 GetClientConfiguration，但未實作 FindIngest：


|  使用者 UI 選取  |  連線至以下值指定的擷取端點  | 
| --- | --- | 
|  Auto  |  GetClientConfiguration   | 
|  指定自訂伺服器  |  使用者自行選取  | 

如果廣播軟體未實作 GetClientConfiguration，但實作 FindIngest：


|  使用者 UI 選取  |  連線至以下值指定的擷取端點  | 
| --- | --- | 
|  Auto  |  FindIngest   | 
|  透過 FindIngest 擷取特定端點  |  使用者自行選取  | 
|  指定自訂伺服器  |  使用者自行選取  | 

如果廣播軟體未實作 GetClientConfiguration 或 FindIngest：


|  使用者 UI 選取  |  連線至以下值指定的擷取端點  | 
| --- | --- | 
|  Auto  |  全球擷取 URL： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  | 
|  指定自訂伺服器  |  使用者自行選取  | 

如要進一步了解使用 FindIngest 指定的擷取端點，請參閱[使用 FindIngest 伺服器做為自動串流目的地](#multitrack-video-sw-integration-recommended-features-using-findingest)。

### 允許使用者設定串流目的地
<a name="multitrack-video-sw-integration-recommended-features-streaming-destination"></a>

使用者設定串流目的地時，您應該查詢 [FindIngest](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-FindIngest.html)，並提供他們以下選擇：
+ 選擇 RTMP 或 RTMPS (Amazon IVS 的預設值)。
+ 為伺服器選取**自動**。
+ 從 [FindIngest](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-FindIngest.html) 傳回的清單中選取特定伺服器。
+ 輸入自訂伺服器；例如，使用**指定自訂伺服器**。

您可以根據使用者選取的通訊協定 (RTMP 與 RTMPS) 或其他考量，篩選 FindIngest 傳回的清單。

例如，OBS Studio 中的 Amazon IVS 實作，是透過提供簡單的**伺服器**下拉式清單以及以下選項，來達成此目的：
+ 自動 (RTMPS，建議)
+ 自動 (RTMP)
+ 美國東部：維吉尼亞州阿什本(5)(RTMPS)
+ 美國東部：紐約州紐約市 (50) (RTMPS)
+ 美國東部：紐約州紐約市 (RTMPS)
+ 美國東部：維吉尼亞州阿什本(5)(RTMP)
+ 美國東部：紐約州紐約市 (50) (RTMP)
+ 美國東部：紐約州紐約市 (RTMP)
+ 指定自訂伺服器

如果選取**指定自訂伺服器**，系統會提供文字方塊，讓使用者輸入 RTMP URL。

### 使用 FindIngest 伺服器做為自動串流目的地
<a name="multitrack-video-sw-integration-recommended-features-using-findingest"></a>

如果串流目的地指定為自動，且使用 FindIngest 指定的擷取端點，請使用 [FindIngest](https://docs.aws.amazon.com//ivs/latest//BroadcastSWIntegAPIReference/actions-FindIngest.html) 傳回的最低 `priority` 值項目。若要縮短串流上線所需的時間，您可以快取 FindIngest 回應。如果您快取了回應，請定期更新快取的值。

如果使用者選取 RTMP，請使用 `url_template` 字串做為 RTMP 廣播目的地。如果使用者選取 RTMPS，請使用 `url_template_secure` 字串作為 RTMPS 廣播目的地。如果兩種情況皆有，請將 `{stream_key}` 替換為使用者的串流金鑰。

## 廣播效能指標 (BPM) 訊息定義
<a name="multitrack-video-sw-integration-performance-metrics-definitions"></a>

BPM 訊息是以 [H.264 標準](https://www.itu.int/rec/T-REC-H.264) SEI 語法為基礎。您可以參考以下 H.264 規格中使用者資料未註冊的 SEI 語法：

![\[使用者資料未註冊的 SEI 訊息語法。\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/images/BPM_Definitions.png)


對於 BPM 訊息，所有剖析和註釋規則都遵循 H.264 標準，例如，「u(128)」表示不帶正負號的 128 位元整數，且最高有效位元 MSB 在前。

以下為 BPM 定義了三種 SEI 訊息：
+ BPM TS SEI：[時間戳記訊息](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts)
+ BPM SM SEI：[工作階段指標訊息](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-sm)
+ BPM ERM SEI：[編碼轉譯指標訊息](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-erm)

所有 BPM SEI 訊息都會傳送 `user_data_unregistered()` 語法所要求的 128 位元 UUID，後面接著一個承載位元組的迴圈。然後，產生的訊息會封裝在更高層級的語義 (例如 NALU、RBSP 和啟動碼模擬預防) 中。

### BPM TS (時間戳記) SEI
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts"></a>

BPM TS SEI 訊息會傳遞一或多個相關的時間戳記。例如，用戶端可以在一則SEI 訊息中，為影格組成、影格編碼請求、影格編碼請求完成和封包交錯，發出時間戳記訊號，而且用戶端可以決定這些時間戳記是否應該以壁鐘時間 (RFC3339/ISO8601 樣式) 或 delta (差異) 時鐘或自紀元以來的持續時間形式傳送。在系統中應該有一個時間戳記提供 delta 類型的參考；這應由部署處理，而不是任何語法限制。


|  |  |  | 
| --- |--- |--- |
|  `user_data_unregistered_bpm_ts( payloadSize ) {`  |  **C**  |  **描述項**  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(128)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  st(v)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  i(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  `}`  |   |   | 

#### BPM TS SEI 欄位描述表
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts-fields"></a>


|  欄位  |  說明  | 
| --- | --- | 
|  `uuid_iso_iec_11578`  |  設定為十六進位：`0aecffe752724e2fa62fd19cd61a93b5` 使用未註冊的 SEI 訊息時，需要 UUID 來區分此訊息與任何其他未註冊的訊息。  | 
|  `ts_reserved_zero_4bits`  |  保留以供日後使用。將 設定為 `b('0000')`。接收端應忽略這些位元。  | 
|  `num_timestamps_minus1`  |  `num_timestamps=num_timestamps_minus1+1` `num_timestamps_minus1` 應介於 0 到 15 之間，這表示可以發出介於 1 到 16 個時間戳記的訊號。  | 
|  `timestamp_type`  |  請參閱 [timestamp\$1type 資料表](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts-types)。  | 
|  `timestamp_event`  |  下列其中一項： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html) 當 `num_timestamps_minus1` 大於 0 時 (即發出多個時間戳記的訊號)，沒有語法上的區別符來識別唯一性；因此，在 SEI 迴圈中 `timestamp_event` 應該是唯一的。雖然不排除以相同 `timestamp_event` 發出多個時間戳記的訊號；但是，對這些時間戳記的解釋不在訊息範圍內。  | 

#### timestamp\$1type 資料表
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts-types"></a>

`timestamp_type` 會指定以下類型：
+ "壁鐘" 格式，其中會發出行事曆型的日期和時間訊號。
+ 自紀元以來的持續時間。
+ Delta 時間戳記，發出兩個事件之間差異的時間戳記訊號。
+ 日後可能需要的其他時間戳記格式。


|  timestamp\$1type  |  名稱  |  描述  | 
| --- | --- | --- | 
|  0  |  未定義  |  未定義 – 請勿使用。  | 
|  1  |  `rfc3339_ts`  |  [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) 是 [ISO8601](https://en.wikipedia.org/wiki/ISO_8601) 在網際網路上的應用規範，會限制 ISO8601 中的部分選項。 `timestamp_type==1` 應採用以 RFC3339 為基礎的時間記號。請注意，RFC3339 不支援時區。所有時間戳記都相對於 UTC (也稱為「Zulu」時間)，根據定義，UTC 的偏移值為 00:00。 r`fc3339_ts` 應為字串。`st(v)` 定義詳見 [H.264 標準](https://www.itu.int/rec/T-REC-H.264)的第 7.2 節。 請參閱本表下方關於閏秒的注意事項。 範例：`2024-03-25T15:10:34.489Z` (489 是指毫秒)  | 
|  2  |  `duration_since_epoch_ts`  |  自 1970-01-01T00:00:00Z000 以來的持續時間，以毫秒為單位。 請參閱本表下方關於閏秒的注意事項。  | 
|  3  |  `delta_ts`  |  Delta 時間戳記，表示 2 個事件之間的差異時間，以奈秒為單位。已簽署整數允許發出正數和負數差異訊號。  | 
|  4-255  |  已預留  |  預訂.  | 

**閏秒注意事項：**請注意，全球已達成協議，在 2035 年之前逐步停止使用閨秒。如需詳細資訊，請參閱[維基百科上的閏秒條目](https://en.wikipedia.org/wiki/Leap_second)。建議使用排除閏秒的時間戳記。這與 2035 年之前預期的做法一致，並可避免時間計算可能出現的誤差。

### BPM SM (工作階段指標) SEI
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-sm"></a>

BPM SM SEI 訊息會傳遞與整體發送端工作階段相關的一組指標。在 OBS Studio 中，這表示傳送下列影格計數器：
+ 已轉譯的工作階段影格
+ 已捨棄的工作階段影格
+ 已延遲的工作階段影格
+ 已輸出的工作階段影格

此 SEI 訊息也包含時間戳記。這與 BPM TS SEI 重複；然而，在每個 SEI 訊息中提供明確的時間戳記可提供原子行為單位，並減少接收端上的負載以重新對齊資料。此外，如果需要捨棄或不傳送 BPM TS SEI，我們仍然可以在 BPM SM SEI 訊息中使用明確的時間戳記。


|  |  |  | 
| --- |--- |--- |
|  `user_data_unregistered_bpm_sm( payloadSize ) {`  |  **C**  |  **描述項**  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(128)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  st(v)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  i(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(32)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  `}`  |   |   | 

#### BPM SM SEI 欄位描述表
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-sm-fields"></a>

此 SEI 訊息中的許多欄位與 BPM TS SEI 欄位相似。主要的差異在於 UUID 值、預期的時間戳記數量，以及要傳輸的計數器。


|  欄位  |  說明  | 
| --- | --- | 
|  `uuid_iso_iec_11578`  |  設定為十六進位：`ca60e71c-6a8b-4388-a377-151df7bf8ac2` 使用未註冊的 SEI 訊息時，需要 UUID 來區分此訊息與任何其他未註冊的訊息。  | 
|  `ts_reserved_zero_4bits`  |  保留以供日後使用。將 設定為 `b('0000')`。接收端應忽略這些位元。  | 
|  `num_timestamps_minus1`  |  `num_timestamps=num_timestamps_minus1+1` `num_timestamps_minus1` 應介於 0 到 15 之間，這表示可以發出介於 1 到 16 個時間戳記的訊號。 目前，此值應為 0 (表示單一時間戳記)。  | 
|  `timestamp_type`  |  請參閱 [timestamp\$1type 資料表](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts-types)。如果是 BPM SM SEI，這應該是類型 1 - RFC3339 字串。  | 
|  `timestamp_event`  |  下列其中一項： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html) 當 `num_timestamps_minus1` 大於 0 時 (即發出多個時間戳記的訊號)，沒有語法上的區別符來識別唯一性；因此，在 SEI 迴圈中 `timestamp_event` 應該是唯一的。雖然不排除以相同 `timestamp_event` 發出多個時間戳記的訊號；但是，對這些時間戳記的解釋不在訊息範圍內。 **注意：**Amazon IVS 預期 BPM SM SEI 只會使用 `timestamp_event` 設定為 4 (`BPM_TS_EVENT_PIR`) 的值。隨著增加更多時間戳記事件的支援，這會更加完善。  | 
|  `num_counters_minus1`  |  `num_counters=num_counters_minus1+1` `num_counters_minus1` 應介於 0 到 15 之間，這表示可以發出 1 到 16 個計數器的訊號。 如果是 BPM SM SEI，這應該是 3 (表示 4 個計數器)。  | 
|  `counter_tag`  |  下列其中一項： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  | 
|  `counter_value`  |  指定 `counter_tag` 的 32 位元差異值，相對於上次傳送。例如，使用 60 fps 轉譯時，每 2 秒的 `counter_value` 應為 120。  | 

#### BPM SM 範例
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-sm-example"></a>

以下是傳送至 Amazon IVS 的 BPM SM SEI 範例：
+ `uuid_iso_iec_11578` (16 位元組)：ca60e71c-6a8b-4388-a377-151df7bf8ac2
+ `ts_reserved_zero_4bits` (4 位元)：0x0
+ `num_timestamps_minus1` (4 位元)：0x0 (表示正在傳送 1 個時間戳記)
+ `timestamp_type` (1 位元組)：0x01 (RFC3339 時間戳記 - 字串格式)
+ `timestamp_event` (1 位元組)：0x04 (BPM\$1TS\$1EVENT\$1PIR)
+ `rfc3339_ts`："2024-03-25T15:10:34.489Z"
+ `ts_reserved_zero_4bits` (4 位元)：0x0
+ `num_counters_minus1` (4 位元)：0x3 (表示正在傳送 4 個計數器)
+ `counter_tag` (1 位元組)：0x01 (自上次傳送訊息以來編譯器轉譯的影格)
+ `counter_value` (4 位元組)
+ `counter_tag` (1 位元組)：0x02 (自上次傳送訊息以來編譯器延遲的影格)
+ `counter_value` (4 位元組)
+ `counter_tag` (1 位元組)：0x03 (自上次傳送訊息以來因網路壅塞而捨棄的影格)
+ `counter_value` (4 位元組)
+ `counter_tag` (1 位元組)：0x04 (總影格輸出 (自上次傳送訊息以來所有視訊編碼器轉譯接收端的總和)
+ `counter_value` (4 位元組)

### BPM ERM (編碼轉譯指標) SEI
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-erm"></a>

BPM ERM SEI 訊息會傳遞與每個編碼轉譯相關的一組指標。在 OBS Studio 中，這表示傳送下列影格計數器：
+ 已輸入的轉譯影格
+ 已略過的轉譯影格
+ 已輸出的轉譯影格

此 SEI 訊息也包含時間戳記。這與 BPM TS SEI 重複；然而，在每個 SEI 訊息中提供明確的時間戳記可提供原子行為單位，並減少接收端上的負載以重新對齊資料。此外，如果需要捨棄或不傳送 BPM TS SEI，我們仍然可以在 BPM ERM SEI 訊息中使用明確的時間戳記。


|  |  |  | 
| --- |--- |--- |
|  `user_data_unregistered_bpm_erm( payloadSize ) {`  |  **C**  |  **描述項**  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(128)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  st(v)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  i(64)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  u(4)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(8)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |  5  |  b(32)  | 
|  [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  |   |   | 
|  `}`  |   |   | 

#### BPM ERM SEI 欄位描述表
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-erm-fields"></a>

此 SEI 訊息中的許多欄位與 BPM TS SEI 欄位和 BPM SM SEI 欄位相似。主要的差異在於 UUID 值、預期的時間戳記數量，以及要傳輸的計數器。


|  欄位  |  說明  | 
| --- | --- | 
|  `uuid_iso_iec_11578`  |  設定為十六進位：`f1fbc1d5-101e-4fb5-a61e-b8ce3c07b8c0` 使用未註冊的 SEI 訊息時，需要 UUID 來區分此訊息與任何其他未註冊的訊息。  | 
|  `ts_reserved_zero_4bits`  |  保留以供日後使用。將 設定為 `b('0000')`。接收端應忽略這些位元。  | 
|  `num_timestamps_minus1`  |  `num_timestamps=num_timestamps_minus1+1` `num_timestamps_minus1` 應介於 0 到 15 之間，這表示可以發出介於 1 到 16 個時間戳記的訊號。 目前，此值應為 0 (表示單一時間戳記)。  | 
|  `timestamp_type`  |  請參閱 [timestamp\$1type 資料表](#multitrack-video-sw-integration-performance-metrics-definitions-bpm-ts-types)。 這應該是類型 1 - RFC3339 字串。  | 
|  `timestamp_event`  |  下列其中一項： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html) 當 `num_timestamps_minus1` 大於 0 時 (即發出多個時間戳記的訊號)，沒有語法上的區別符來識別唯一性；因此，在 SEI 迴圈中 `timestamp_event` 應該是唯一的。雖然不排除以相同 `timestamp_event` 發出多個時間戳記的訊號；但是，對這些時間戳記的解釋不在訊息範圍內。 **注意：**Amazon IVS 預期 BPM ERM SEI 只會使用 `timestamp_event` 設定為 4 (`BPM_TS_EVENT_PIR`) 的值。隨著增加更多時間戳記事件的支援，這會更加完善。  | 
|  `num_counters_minus1`  |  `num_counters=num_counters_minus1+1` `num_counters_minus1` 應介於 0 到 15 之間，這表示可以發出 1 到 16 個計數器的訊號。 如果是 BPM ERM SEI，這應該是 2 (表示 3 個計數器)。  | 
|  `counter_tag`  |  下列其中一項： [\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/ivs/latest/LowLatencyUserGuide/multitrack-video-sw-integration.html)  | 
|  `counter_value`  |  指定 `counter_tag` 的 32 位元差異值，相對於上次傳送。例如，使用 60 fps 轉譯時，每 2 秒的 `counter_value` 應為 120。  | 

#### BPM ERM 範例
<a name="multitrack-video-sw-integration-performance-metrics-definitions-bpm-erm-example"></a>

以下是傳送至 Amazon IVS 的 BPM ERM SEI 範例：
+ `uuid_iso_iec_11578` (16 位元組)：f1fbc1d5-101e-4fb5-a61e-b8ce3c07b8c0
+ `ts_reserved_zero_4bits` (4 位元)：0x0
+ `num_timestamps_minus1` (4 位元)：0x0 (表示正在傳送 1 個時間戳記)
+ `timestamp_type` (1 位元組)：0x01 (RFC3339 時間戳記 - 字串格式)
+ `timestamp_event` (1 位元組)：0x04 (BPM\$1TS\$1EVENT\$1PIR)
+ `rfc3339_ts`："2024-03-25T15:10:34.489Z"
+ `ts_reserved_zero_4bits` (4 位元)：0x0
+ `num_counters_minus1` (4 位元)：0x2 (表示正在傳送 3 個計數器)
+ `counter_tag` (1 位元組)：0x01 (自上次傳送訊息以來的編碼轉譯影格輸入)
+ `counter_value` (4 位元組)
+ `counter_tag` (1 位元組)：0x02 (自上次傳送訊息以來略過的編碼轉譯影格)
+ `counter_value` (4 位元組)
+ `counter_tag` (1 位元組)：0x03 (自上次傳送訊息以來的編碼轉譯影格輸出)
+ `counter_value` (4 位元組)