

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 廣告休息時間的 SCTE-35 訊息
<a name="ca-scte-35-messages"></a>

使用 MediaTailor，您可以根據來源位置和 VOD 來源資源建立內容頻道。然後，您可以根據頻道的排程為每個節目設定一或多個廣告休息時間。您可以使用以 SCTE-35 規格為基礎的訊息來調節廣告休息時間的內容。例如，您可以使用 SCTE-35 訊息來提供廣告休息時間的中繼資料。如需 SCTE-35 規格的詳細資訊，請參閱[數位程式插入提示訊息](https://webstore.ansi.org/Standards/SCTE/ANSISCTE352022)。

您透過兩種方式之一設定廣告休息時間：
+ 連接 `time_signal` SCTE-35 訊息與`segmentation_descriptor`訊息。`segmentation_descriptor` 此訊息包含更進階的中繼資料欄位，例如內容識別符，可傳達廣告休息時間的詳細資訊。MediaTailor 會將廣告中繼資料寫入輸出資訊清單，做為 `EXT-X-DATERANGE`(HLS) 或 `EventStream`(DASH) 廣告標記 SCTE-35 資料的一部分。
+ 連接 `splice_insert` SCTE-35 訊息，提供廣告休息時間的基本中繼資料。
+ HLS：
  + 當廣告標記類型為 時`Daterange`，MediaTailor 會將廣告休息時間指定為資訊清單中的`EXT-X-DATERANGE`標籤。
  + 當廣告標記類型為 時`Scte35 Enhanced`，MediaTailor 會使用下列標籤指定廣告休息時間：
    + MediaTailor 會將 放置在廣告場板`EXT-X-CUE-OUT`的第一個區段上，表示從內容切到廣告休息時間。它包含預期的廣告休息時間持續時間，例如 `EXT-X-CUE-OUT:Duration=30`。
    + `>EXT-X-ASSET`：此標籤會顯示在與 相同的區段上，`EXT-X-CUE-OUT`並在建立或更新程式時包含 AdBreak 中提供的廣告休息中繼資料。它一律包含 `CAID`。
    + `EXT-OATCLS-SCTE35`：此標籤會出現在與 相同的區段上`EXT-X-CUE-OUT`，並包含 SCTE-35 訊息的 base64 編碼位元組。
    + `EXT-X-CUE-OUT-CONT`：此標籤會出現在廣告板內的每個後續區段上，並包含持續時間和經過時間資訊。它還包含 base64 編碼的 SCTE-35 訊息和 `CAID`。
    + `EXT-X-CUE-IN`：此標籤會在廣告休息時間結束後出現在內容的第一個區段上，並指出從廣告休息時間縮減回內容。

下圖顯示使用 SCTE-35 訊息在頻道中設定廣告休息時間的兩種方式：
+ 使用`splice_insert()`訊息來設定具有基本中繼資料的廣告休息時間。
+ 使用`time_signal()`訊息與`segmentation_descriptor()`訊息來設定具有更詳細中繼資料的廣告休息時間。

![\[使用 SCTE-35 訊息在頻道中設定廣告休息時間的兩種方式。\]](http://docs.aws.amazon.com/zh_tw/mediatailor/latest/ug/images/scte-35-splice-insert-vs-time-signal-segmentation-descriptor.png)


如需使用 的資訊`time_signal`，請參閱 2022 SCTE-35 規格第 9.7.4 節，[數位程式插入提示訊息](https://webstore.ansi.org/Standards/SCTE/ANSISCTE352022)。

廣告休息時間資訊會出現在輸出 `splice_info_section` SCTE-35 資料中。使用 MediaTailor，您可以將單一`segmentation_descriptor`訊息與單一`time_signal`訊息配對。

**注意**  
如果您傳送訊息`segmentation_descriptor`，則必須將其做為`time_signal`訊息類型的一部分傳送。`time_signal` 訊息僅包含 MediaTailor 使用指定時間戳記建構`splice_time`的欄位。

下表說明 MediaTailor 為每個`segmentation_descriptor`訊息所需的欄位。如需詳細資訊，請參閱 2022 SCTE-35 規格的第 10.3.3.1 節，您可以在 [ANSI Webstore 網站](https://webstore.ansi.org/Standards/SCTE/ANSISCTE352022)購買。


**`segmentation_descriptor` 訊息的必要欄位**  

| 欄位 | Type | 預設值 | Description | 
| --- | --- | --- | --- | 
| segmentation\$1event\$1id | integer | 1 | 這會寫入 segmentation\$1descriptor.segmentation\$1event\$1id。 | 
| segmentation\$1upid\$1type | integer | 14 (0x0E) | 這會寫入 segmentation\$1descriptor.segmentation\$1upid\$1type。值必須介於 0 到 256 之間，包括 。 | 
| segmentation\$1upid | string | "" （空字串） | 這會寫入 segmentation\$1descriptor.segmentation\$1upid。值必須是十六進位字串，其中包含字元 0-9和 A-F。 | 
| segmentation\$1type\$1id | integer | 48 (0x30) | 這會寫入 segmentation\$1descriptor.segmentation\$1type\$1id。值必須介於 0 到 256 之間，包括 。 | 
| segment\$1num | integer | 0 | 這會寫入 segmentation\$1descriptor.segment\$1num。值必須介於 0 到 256 之間，包括 。 | 
| segments\$1expected | integer | 0 | 這會寫入 segmentation\$1descriptor.segments\$1expected。值必須介於 0 到 256 之間，包括 。 | 
| sub\$1segment\$1num | integer | null | 這會寫入 segmentation\$1descriptor.sub\$1segment\$1num。值必須介於 0 到 256 之間，包括 。 | 
| sub\$1segments\$1expected | integer | null | 這會寫入 segmentation\$1descriptor.sub\$1segments\$1expected。值必須介於 0 到 256 之間，包括 。 | 

下表顯示 MediaTailor 自動為部分`segmentation_descriptor`訊息欄位設定的值。


**MediaTailor 為`segmentation_descriptor`訊息欄位設定的值**  

| 欄位 | Type | Value | 
| --- | --- | --- | 
| segmentation\$1event\$1cancel\$1indicator | Boolean | True | 
| program\$1segmentation\$1flag | Boolean | True | 
| delivery\$1not\$1restricted\$1flag | Boolean | True | 

MediaTailor 一律將 `segmentation_duration_flag`設定為 `True`。MediaTailor 會將狀態內容的持續時間以刻度填入 `segmentation_duration` 欄位。

**注意**  
當 MediaTailor 傳送訊息時`time_signal`，會將`splice_info_section`訊息中的 `splice_command_type` 欄位設定為 6 (0x06)。

在 HLS 輸出中，對於`AdBreak`具有`time_signal`訊息的 ，輸出`EXT-X-DATERANGE`標籤包含設定為`splice_info_section`訊息序列化版本的`SCTE-35`欄位。例如，下列`EXT-X-DATERANGE`標籤顯示`splice_info_section`訊息的序列化版本：

```
#EXT-X-DATERANGE:ID=\"1\",START-DATE=\"2020-09-25T02:13:20Z\",DURATION=300.0,SCTE35-OUT=0xFC002C00000000000000FFF00506800000000000160214435545490000000100E000019BFCC00E0030000000000000
```

在 DASH 輸出中，對於`AdBreak`具有`time_signal`訊息的 ，輸出`EventStream`元素包含具有 `scte35:SpliceInfoSection` `scte35:TimeSignal`和 元素的`scte35:SegmentationDescriptor`元素做為其子系。`scte35:TimeSignal` 元素具有子`scte35:SpliceTime`元素，而`scte35:SegmentationDescriptor`元素具有子`scte35:SegmentationUpid`元素。例如，下列 DASH 輸出會顯示`EventStream`元素的子元素結構：

```
<EventStream schemeIdUri="urn:scte:scte35:2013:xml" timescale="90000">
    <Event duration="27000000">
        <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="0" tier="4095">
            <scte35:TimeSignal>
                <scte35:SpliceTime ptsTime="0" />
            </scte35:TimeSignal>
            <scte35:SegmentationDescriptor segmentNum="0" segmentationDuration="27000000" segmentationEventCancelIndicator="false" segmentationEventId="1" segmentationTypeId="48" segmentsExpected="0">
                <scte35:SegmentationUpid segmentationUpidFormat="hexBinary" segmentationUpidType="14">012345</scte35:SegmentationUpid>
            </scte35:SegmentationDescriptor>
        </scte35:SpliceInfoSection>
    </Event>
</EventStream>
```

您已了解如何使用 SCTE-35 訊息在頻道組件中設定廣告休息時間、這些訊息的結構和必要欄位，以及包含 SCTE-35 訊息的範例 HLS 和 DASH 輸出。