

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

# 整合 MPEG-DASH 來源
<a name="manifest-dash"></a>

AWS Elemental MediaTailor 支援遵循 DASH 動態設定檔準則的`.mpd`隨需視訊 (VOD) 資訊清單。MediaTailor 接受多期間和單一期間 DASH 相容資訊清單輸入，並提供多期間 DASH 相容資訊清單輸出。

輸入資訊清單必須具有下列項目：
+ SCTE-35 事件串流搭配 `splice insert ` 或 ` time signal` 的接合資訊設定。可以以 Clear XML 或以 base64 編碼的二進位提供此設定。
+ `Segment templates` 與 `segment timelines`。

對於已發佈的資訊清單，MediaTailor 要求來自原始伺服器的更新保持不變：
+ 期間開始時間，指定於 `start` 屬性。
+ 顯示期間之片段範本中的 `presentationTimeOffset` 值。

最佳實務是為廣告時段提供與內容串流期間相同的 `AdaptationSet`和 `Representation` 設定。 AWS Elemental MediaTailor 使用這些設定來轉碼廣告以符合內容串流，以便在兩者之間順暢切換。

下列各節提供 MediaTailor 如何處理 DASH 資訊清單中廣告的詳細資訊。

**Topics**
+ [DASH 廣告標記](dash-ad-markers.md)
+ [DASH 廣告時段持續時間](dash-ad-avail-duration.md)
+ [DASH 資訊清單區段編號](dash-manifest-segment-numbering.md)
+ [DASH MPD 範例](manifest-dash-example.md)
+ [DASH 位置功能](dash-location-feature.md)

# DASH 廣告標記
<a name="dash-ad-markers"></a>

MediaTailor 

AWS Elemental MediaTailor 使用以下邏輯，使用 SCTE-35 提示輸出標記來識別 DASH 資訊清單中的廣告時段：
+ **多期間 DASH**：MediaTailor `TimeSignal` 會在每個包含 `SpliceInsert`或提示輸出標記`Period`的第一個 `Event` 中插入廣告。MediaTailor 會忽略 中的其他`Event`標記`Period`。
+ **單一期間 DASH**：MediaTailor `TimeSignal` 會在 `Event`中插入每個包含 `SpliceInsert`或提示輸出標記`Period`的廣告。

根據預設， 會將 DASH 資訊清單 AWS Elemental MediaTailor 管理為多期間資訊清單。您可以變更您的組態，以處理來自您的原始伺服器的單一期間 DASH 資訊清單。如需相關資訊，請參閱[建立 MediaTailor 播放組態](configurations-create.md)。

下列各節提供 DASH 廣告標記處理的其他詳細資訊，並提供來自原始伺服器的裝飾資訊清單。

## DASH 原始清單檔案 XML 要求
<a name="dash-ad-markers-examples"></a>

原始伺服器 DASH 資訊清單中的廣告標記必須正確格式化，MediaTailor 才能識別廣告休息時間。下列主題以清晰的 XML 描述這些格式要求。

### `SpliceInsert` 以清晰的 XML 顯示
<a name="dash-splice-xml"></a>

`SpliceInsert` 清晰 XML 中的廣告標記必須包含下列項目：
+ `EventStream` 必須具有下列屬性： `schemeIdUri=urn:scte:scte35:2013:xml`
+ `Event` 必須保留 `scte35:SpliceInfoSection` 
+ `scte35:SpliceInfoSection` 必須保留 `scte35:SpliceInsert` 
+ `scte35:SpliceInsert` 必須具有下列屬性： `outOfNetworkIndicator="true"`

**Example `SpliceInsert` 以 XML 顯示**  
在下列範例中，必要的 SCTE 標記以粗體顯示。  

```
<Period start="PT444806.040S" id="123586" duration="PT15.000S">
  <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
    <Event duration="1350000">
      <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="180832" tier="4095">
        <scte35:SpliceInsert spliceEventId="4026531855" spliceEventCancelIndicator="false" outOfNetworkIndicator="true" spliceImmediateFlag="false" uniqueProgramId="1" availNum="1" availsExpected="1">
            <scte35:Program><scte35:SpliceTime ptsTime="5672624400"/></scte35:Program>
            <scte35:BreakDuration autoReturn="true" duration="1350000"/>
        </scte35:SpliceInsert>
      </scte35:SpliceInfoSection>
    </Event>
  .
  .
  .
</Period>
```

### `TimeSignal` 以清晰的 XML 顯示
<a name="dash-signal-xml"></a>

`TimeSignal` 清晰 XML 中的廣告標記必須包含下列項目：
+ `EventStream` 必須具有下列屬性： `schemeIdUri=urn:scte:scte35:2013:xml`
+ `Event` 必須保留 `scte35:SpliceInfoSection`
+ `scte35:SpliceInfoSection` 必須保留 `scte35:TimeSignal`
+ `scte35:SpliceInfoSection` 也必須保留 `scte35:SegmentationDescriptor`
+ `scte35:SegmentationDescriptor` 必須具有下列屬性，其中 值是有效的 [Cue-out 號碼](#dash-signal-xml-values)： `segmentationTypeId="xx"`
+ `scte35:SegmentationDescriptor` 必須保留 `scte35:SegmentationUpid` 
<a name="dash-signal-xml-values"></a>
**Cue-out 號碼**  
以下是 支援的提示號碼`segmentationTypeId`。


| 分割訊息 | segmentationTypeId 值 | 十六進位值 | 
| --- | --- | --- | 
| 經銷商公告結束 | 51 | 0x51 | 
| 經銷商公告開始 | 50 | 0x32 | 
| 經銷商置放機會結束 | 55 | 0x37 | 
| 經銷商置放機會開始 | 54 | 0x36 | 
| 結束休息時間 | 35 | 0x23 | 
| 供應商公告結束 | 49 | 0x31 | 
| 供應商公告開始 | 48 | 0x30 | 
| 提供者浮水印置放機會結束 | 57 | 0x39 | 
| 供應商浮水印置放機會開始 | 56 | 0x38 | 
| 提供者置放機會結束 | 53 | 0x35 | 
| 供應商置放機會開始 | 52 | 0x34 | 
| 開始休息時間 | 34 | 0x22 | 

**Example `TimeSignal` XML 中的**  
在下列範例中，必要的 SCTE 標記以粗體顯示。  

```
<Period start="PT346530.250S" id="178443" duration="PT61.561S">
  <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
    <Event duration="5310000">
      <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="183003" tier="4095">
        <scte35:TimeSignal>
          <scte35:SpliceTime ptsTime="3442857000"/>
         </scte35:TimeSignal>
        <scte35:SegmentationDescriptor segmentationEventId="1414668" segmentationEventCancelIndicator="false" segmentationDuration="8100000" segmentationTypeId="52" segmentNum="0" segmentsExpected="0">
            <scte35:DeliveryRestrictions webDeliveryAllowedFlag="false" noRegionalBlackoutFlag="false" archiveAllowedFlag="false" deviceRestrictions="3"/>
            <scte35:SegmentationUpid segmentationUpidType="12" segmentationUpidLength="2">0100</scte35:SegmentationUpid>
          </scte35:SegmentationDescriptor>
        </scte35:SpliceInfoSection>
    </Event>
  .
  .
  .
</Period>
```

## DASH 原始清單檔案 base64 編碼的二進位需求
<a name="dash-base64"></a>

原始伺服器 DASH 資訊清單中的廣告標記必須正確格式化，MediaTailor 才能識別廣告休息時間。下列主題說明 base64 編碼二進位檔中的這些格式需求。

base64 編碼資訊清單中的 `SpliceInsert` `TimeSignal`和廣告標記都必須包含下列項目：
+ `EventStream` 必須具有下列屬性： `urn:scte:scte35:2014:xml+bin`
+ `Event` 必須保留 `scte35:Signal`
+ `scte35:Signal` 必須保留包含 base64 編碼二進位檔`scte35:Binary`的 。

解碼的二進位檔必須提供`splice_info_section`與清晰 XML 廣告標記所需資訊相同的資訊。
+ 命令類型必須是 `splice_insert()`或 `time_signal()`
+ 其他設定必須符合 [`TimeSignal` 以清晰的 XML 顯示](#dash-signal-xml)和 中所述的設定[`SpliceInsert` 以清晰的 XML 顯示](#dash-splice-xml)。

 解碼的二進位必須提供 `splice_info_section`，其具有與 `scte35:SpliceInfoSection` 元素中 Clear XML 將提供的一組相同資訊。此命令類型必須是 `splice_insert()` 或 `time_signal()`，並且其他設定必須遵守前述針對 Clear XML 交付所述的資訊。

以下範例顯示此選項，必要標記以粗體表示。

```
<Period start="PT444806.040S" id="123586" duration="PT15.000S">
    <EventStream schemeIdUri="urn:scte:scte35:2014:xml+bin" timescale="1">
      <Event presentationTime="1541436240" duration="24" id="29">
        <scte35:Signal xmlns="http://www.scte.org/schemas/35/2016">
          <scte35:Binary>/DAhAAAAAAAAAP/wEAUAAAHAf+9/fgAg9YDAAAAAAAA25aoh</scte35:Binary>
        </scte35:Signal>
      </Event>
      <Event presentationTime="1541436360" duration="24" id="30">
        <scte35:Signal xmlns="http://www.scte.org/schemas/35/2016">
          <scte35:Binary>QW5vdGhlciB0ZXN0IHN0cmluZyBmb3IgZW5jb2RpbmcgdG8gQmFzZTY0IGVuY29kZWQgYmluYXJ5Lg==</scte35:Binary>
        </scte35:Signal>
      </Event>
  .
  .
  .
</Period>
```

以下是前述範例中所列第一個事件解碼的二進位檔。`splice_command_type` 的設定為 5，這表示 `splice_insert`。

```
{
        "table_id": 252,
        "section_syntax_indicator": false,
        "private_indicator": false,
        "section_length": 33,
        "protocol_version": 0,
        "encrypted_packet": false,
        "encryption_algorithm": 0,
        "pts_adjustment": 0,
        "cw_index": 0,
        "tier": "0xFFF",
        "splice_command_length": 16,
        "splice_command_type": 5,
        "splice_command": {
          "splice_event_id": 448,
          "splice_event_cancel_indicator": false,
          "out_of_network_indicator": true,
          "program_splice_flag": true,
          "duration_flag": true,
          "splice_immediate_flag": false,
          "utc_splice_time": {
            "time_specified_flag": false,
            "pts_time": null
          },
          "component_count": 0,
          "components": null,
          "break_duration": {
            "auto_return": false,
            "duration": {
              "pts_time": 2160000,
              "wall_clock_seconds": 24.0,
              "wall_clock_time": "00:00:24:00000"
            }
          },
          "unique_program_id": 49152,
          "avail_num": 0,
          "avails_expected": 0
        },
        "splice_descriptor_loop_length": 0,
        "splice_descriptors": null,
        "Scte35Exception": {
          "parse_status": "SCTE-35 cue parsing completed with 0 errors.",
          "error_messages": [],
          "table_id": 252,
          "splice_command_type": 5
        }
      }
```

# DASH 廣告時段持續時間
<a name="dash-ad-avail-duration"></a>

在播放期間，當 AWS Elemental MediaTailor 遇到廣告時段時，它會以廣告取代部分或全部時段。MediaTailor 會在廣告時段開始時開始廣告替換，並包含廣告，如下所示：
+ 如果廣告時段指定持續時間，MediaTailor 會包含盡可能多符合持續時間界限的廣告，而不會覆寫後續的內容。
+ 如果未提供持續時間，MediaTailor 會包含廣告，直到廣告時段結束為止。對於多期間資訊清單，這是期間結尾。對於單一期間資訊清單，這是事件的結尾。MediaTailor 不會在廣告時段結束後播放廣告，並在遇到結尾時截斷目前廣告，而不是覆寫後續的內容。

**如何 AWS Elemental MediaTailor 尋找廣告時段持續時間**  
AWS Elemental MediaTailor 會依下列順序搜尋持續時間設定：

1. `Event` `duration`

1. 對於接合插入，`scte35:BreakDuration` `duration`

1. 對於時間信號，`scte35:SegmentationDescriptor` `segmentationDuration`

如果 AWS Elemental MediaTailor 找不到任何這些設定，它會在沒有持續時間的情況下管理廣告包含。

以下範例顯示具有 `duration` 的 `Event`。

```
  <Period start="PT444806.040S" id="123586" duration="PT15.000S">
          <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
            <Event duration="1350000">
              <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="180832" tier="4095">
                <scte35:SpliceInsert spliceEventId="4026531855" spliceEventCancelIndicator="false" outOfNetworkIndicator="true" spliceImmediateFlag="false" uniqueProgramId="1" availNum="1" availsExpected="1">
                  <scte35:Program><scte35:SpliceTime ptsTime="5672624400"/></scte35:Program>
                  <scte35:BreakDuration autoReturn="true" duration="1350000"/>
                </scte35:SpliceInsert>
              </scte35:SpliceInfoSection>
            </Event>
              ...
```

以下範例顯示的廣告時段未指定持續時間。`Event` 沒有 `duration`，並且 `scte35:SpliceInsert` 元素不包含 `scte35:BreakDuration` 子元素。

```
  <Period start="PT444836.720S" id="123597" duration="PT12.280S">
          <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
            <Event>
              <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="180832" tier="4095">
                <scte35:SpliceInsert spliceEventId="4026531856" spliceEventCancelIndicator="false" outOfNetworkIndicator="true" spliceImmediateFlag="false" uniqueProgramId="1" availNum="1" availsExpected="1">
                  <scte35:Program><scte35:SpliceTime ptsTime="5675385600"/></scte35:Program>
                </scte35:SpliceInsert>
              </scte35:SpliceInfoSection>
            </Event>
            ...
```

# DASH 資訊清單區段編號
<a name="dash-manifest-segment-numbering"></a>

MediaTailor 支援 中使用 `<SegmentTimeline>`和 `media` 屬性`<SegmentTemplate>`定義的媒體區段。您可以使用 `$Number$` 或 `$Time$` 識別符在 `media` 屬性中指定媒體區段清單。

 以下範例顯示的 `SegmentTemplate` 具有使用 `$Number$` 識別符的 `media` 屬性設定。

```
        <SegmentTemplate initialization="index_subtitles_4_0_init.mp4?m=1532451703" media="index_subtitles_4_0_$Number$.mp4?m=1532451703" presentationTimeOffset="1062336677920" startNumber="2349899" timescale="90000">
                <SegmentTimeline>
                  <S d="540540" r="2" t="1062338840080"/>
                  <S d="69069" t="1062340461700"/>
                </SegmentTimeline>
              </SegmentTemplate>
```

 以下範例顯示的 `SegmentTemplate` 具有使用 `$Time$` 識別符的 `media` 屬性設定。

```
        <SegmentTemplate initialization="asset_720p_8000K_9_init.mp4" media="asset_720p_8000K_9_$Time$.mp4" startNumber="1" timescale="90000">
                <SegmentTimeline>
                  <S d="180000" r="2" t="0"/>
                  <S d="147000" t="540000"/>
                </SegmentTimeline>
              </SegmentTemplate>
```

# DASH MPD 範例
<a name="manifest-dash-example"></a>

下列各節提供 DASH 原始 MPDs和個人化 MPDs的範例。了解這些範例可協助您設定 MediaTailor 工作流程並進行疑難排解。

如需如何將查詢參數套用至 DASH 資訊清單和區段的資訊，請參閱 [MediaTailor DASH 隱含工作階段初始化](manifest-query-parameters-dash-implicit-session-initialization.md)。

## 了解 DASH MPD 結構
<a name="dash-mpd-overview"></a>

透過 HTTP 的動態自適應串流 (DASH) 使用媒體簡報描述 (MPD) 資訊清單來交付串流內容。MPD 是描述媒體內容結構和可用性的 XML 文件。

MPD （媒體簡報描述）  
MPD 是 DASH 串流中描述媒體內容結構和可用性的主要資訊清單檔案。它包含組成串流內容的期間、調整集、表示和客群的相關資訊。  
此資訊清單類型在各種內容中也是由多個其他名稱所知道，包括 DASH 資訊清單、DASH MPD、主資訊清單 （與 HLS 比較時） 或簡報資訊清單。  
在 MediaTailor 工作流程中，MPD 是播放請求的進入點，也是廣告個人化開始的位置。

Period  
期間是 DASH 簡報的暫時區段。每個期間包含一或多個適應集，並代表媒體時間的範圍。在廣告插入工作流程中，通常會使用個別的期間來描述內容和廣告。  
在 MediaTailor 工作流程中，期間用於分隔主要內容與廣告內容，每個廣告通常以自己的期間表示。

AdaptationSet  
AdaptationSet 會將一或多個媒體內容元件的一組可互換編碼版本分組。例如，一個 AdaptationSet 可能包含多個視訊品質等級，而另一個可能包含多個音訊語言選項。  
在 MediaTailor 工作流程中，廣告插入期間會保留 AdaptationSets，以在內容和廣告之間維持一致的媒體類型。

代表  
表示法是 AdaptationSet 內媒體內容的特定編碼版本。每個表示法通常會因位元速率、解析度或其他編碼參數而有所不同，允許用戶端根據網路條件和裝置功能選取最適當的版本。  
在 MediaTailor 工作流程中，廣告期間的呈現會盡可能與內容期間的呈現相符，以確保順暢的檢視體驗。

如需 DASH 資訊清單類型的詳細資訊，請參閱 [DASH 資訊清單類型](dash-manifest-types.md)。

如需 中 DASH 資訊清單結構和組態的相關資訊 AWS Elemental MediaPackage，請參閱 DASH 概觀上的 MediaPackage 使用者指南一節。

## 即時 DASH MPD 範例
<a name="dash-manifest-live-examples"></a>

本節提供即時 DASH MPDs的範例。每個範例都會列出從原始伺服器收到的 MPD，並在 MediaTailor 使用廣告個人化 MPD 之後。

### DASH MPD 接合插入範例
<a name="dash-manifest-splice-insert-example"></a>

**接合插入的 DASH 原始伺服器 MPD 範例**  
來自 MPD 的下列範例會在 DASH 從內容來源接收的資訊清單中顯示廣告時段。此範例使用`SpliceInsert`標記來表示廣告時段。

```
<Period start="PT173402.036S" id="46041">
  <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
    <Event duration="9450000">
      <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="183265" tier="4095">
        <scte35:SpliceInsert spliceEventId="99" spliceEventCancelIndicator="false" outOfNetworkIndicator="true" spliceImmediateFlag="false" uniqueProgramId="1" availNum="1" availsExpected="1">
          <scte35:Program><scte35:SpliceTime ptsTime="7835775000"/></scte35:Program>
          <scte35:BreakDuration autoReturn="true" duration="9450000"/>
        </scte35:SpliceInsert>
        <scte35:SegmentationDescriptor segmentationEventId="99" segmentationEventCancelIndicator="false" segmentationDuration="9450000">
          <scte35:DeliveryRestrictions webDeliveryAllowedFlag="true" noRegionalBlackoutFlag="true" archiveAllowedFlag="true" deviceRestrictions="3"/>
          <scte35:SegmentationUpid segmentationUpidType="8" segmentationUpidLength="0"/>
          <scte35:SegmentationTypeID segmentationType="52"/>
          <scte35:SegmentNum segmentNum="1"/>
          <scte35:SegmentsExpected segmentsExpected="1"/>
        </scte35:SegmentationDescriptor>
      </scte35:SpliceInfoSection>
    </Event>
  </EventStream>
  <AdaptationSet mimeType="video/mp4" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
    <Representation id="1" width="960" height="540" frameRate="30000/1001" bandwidth="1000000" codecs="avc1.4D401F">
      <SegmentTemplate timescale="30000" media="index_video_1_0_$Number$.mp4?m=1528475245" initialization="index_video_1_0_init.mp4?m=1528475245" startNumber="178444" presentationTimeOffset="10395907501">
        <SegmentTimeline>
          <S t="10395907501" d="60060" r="29"/>
          <S t="10397709301" d="45045"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
  <AdaptationSet mimeType="audio/mp4" segmentAlignment="0" lang="eng">
    <Representation id="2" bandwidth="96964" audioSamplingRate="48000" codecs="mp4a.40.2">
      <SegmentTemplate timescale="48000" media="index_audio_2_0_$Number$.mp4?m=1528475245" initialization="index_audio_2_0_init.mp4?m=1528475245" startNumber="178444" presentationTimeOffset="16633452001">
        <SegmentTimeline>
          <S t="16633452289" d="96256" r="3"/>
          <S t="16633837313" d="95232"/>
          <S t="16633932545" d="96256" r="4"/>
          <S t="16634413825" d="95232"/>
          <S t="16634509057" d="96256" r="5"/>
          <S t="16635086593" d="95232"/>
          <S t="16635181825" d="96256" r="4"/>
          <S t="16635663105" d="95232"/>
          <S t="16635758337" d="96256" r="5"/>
          <S t="16636335873" d="71680"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
</Period>
```

在此原始 MPD 範例中：
+ `<EventStream>` 元素包含指出廣告時段的 SCTE-35 標記
+ `<scte35:SpliceInsert>` 元素提供有關廣告時段的詳細資訊
+ `<scte35:BreakDuration>` 元素指定廣告休息時間的持續時間
+ `<AdaptationSet>` 元素定義可用的視訊和音訊串流

**接合插入的 DASH 個人化 MPD 範例**  
AWS Elemental MediaTailor 使用廣告規格個人化廣告時段。這些個人化處理可反映出，從播放器與目前進行中廣告活動接收到的瀏覽者資料。

下列範例顯示 AWS Elemental MediaTailor 個人化廣告時段之後的廣告時段。

```
<Period id="178443_1" start="PT96H15M30.25S">
  <BaseURL>http://111122223333.cloudfront.net/nbc_fallback_2/</BaseURL>
  <AdaptationSet bitstreamSwitching="false" frameRate="30/1" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
    <SegmentTemplate startNumber="1" timescale="90000"/>
    <Representation bandwidth="10000000" codecs="avc1.640028" height="1080" id="1" width="1920">
      <SegmentTemplate initialization="nbc_fallback_ad_2_1080p_10init.mp4" media="nbc_fallback_ad_2_1080p_10_$Number%09d$.mp4" startNumber="1" timescale="90000">
        <SegmentTimeline>
          <S d="180000" r="13" t="0"/>
          <S d="176940" t="2520000"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
    <Representation bandwidth="4000000" codecs="avc1.64001f" height="720" id="2" width="1280">
      <SegmentTemplate initialization="nbc_fallback_ad_2_720p_9init.mp4" media="nbc_fallback_ad_2_720p_9_$Number%09d$.mp4" startNumber="1" timescale="90000">
        <SegmentTimeline>
          <S d="180000" r="13" t="0"/>
          <S d="176940" t="2520000"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
  <AdaptationSet mimeType="audio/mp4" segmentAlignment="0" lang="eng">
    <Representation id="8" bandwidth="128000" audioSamplingRate="48000" codecs="mp4a.40.2">
      <SegmentTemplate initialization="nbc_fallback_ad_2_audio_2init.mp4" media="nbc_fallback_ad_2_audio_2_$Number%09d$.mp4" startNumber="1" timescale="90000">
        <SegmentTimeline>
          <S d="180000" r="13" t="0"/>
          <S d="176940" t="2520000"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
</Period>
```

在此個人化 MPD 範例中：
+ MediaTailor 已建立廣告內容的新期間
+ `<BaseURL>` 元素指向廣告內容位置
+ `<AdaptationSet>` 元素會維護與內容類似的結構
+ 這些`<Representation>`元素為廣告內容提供不同的品質等級

### DASH MPD 時間訊號範例
<a name="dash-manifest-time-signal-example"></a>

**時間訊號的 DASH 原始伺服器 MPD 範例**  
來自 MPD 的下列範例會在 DASH 從內容來源接收的資訊清單中顯示廣告時段。此範例使用`TimeSignal`標記來表示廣告時段。

```
<Period start="PT173402.036S" id="46041">
  <EventStream timescale="90000" schemeIdUri="urn:scte:scte35:2013:xml">
    <Event duration="9450000">
      <scte35:SpliceInfoSection protocolVersion="0" ptsAdjustment="183265" tier="4095">
        <scte35:TimeSignal>
          <scte35:SpliceTime ptsTime="7835775000"/>
        </scte35:TimeSignal>
        <scte35:SegmentationDescriptor segmentationEventId="99" segmentationEventCancelIndicator="false" segmentationDuration="9450000">
          <scte35:DeliveryRestrictions webDeliveryAllowedFlag="true" noRegionalBlackoutFlag="true" archiveAllowedFlag="true" deviceRestrictions="3"/>
          <scte35:SegmentationUpid segmentationUpidType="8" segmentationUpidLength="0"/>
          <scte35:SegmentationTypeID segmentationType="52"/>
          <scte35:SegmentNum segmentNum="1"/>
          <scte35:SegmentsExpected segmentsExpected="1"/>
        </scte35:SegmentationDescriptor>
      </scte35:SpliceInfoSection>
    </Event>
  </EventStream>
  <AdaptationSet mimeType="video/mp4" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
    <Representation id="1" width="960" height="540" frameRate="30000/1001" bandwidth="1000000" codecs="avc1.4D401F">
      <SegmentTemplate timescale="30000" media="index_video_1_0_$Number$.mp4?m=1528475245" initialization="index_video_1_0_init.mp4?m=1528475245" startNumber="178444" presentationTimeOffset="10395907501">
        <SegmentTimeline>
          <S t="10395907501" d="60060" r="29"/>
          <S t="10397709301" d="45045"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
</Period>
```

在此原始 MPD 範例中：
+ 使用 `<scte35:TimeSignal>`元素，而不是 `<scte35:SpliceInsert>`
+ `<scte35:SegmentationDescriptor>` 提供有關廣告時段的其他資訊

**時間訊號的 DASH 個人化 MPD 範例**  
AWS Elemental MediaTailor 使用廣告規格個人化廣告時段。這些個人化處理可反映出，從播放器與目前進行中廣告活動接收到的瀏覽者資料。

下列範例顯示 AWS Elemental MediaTailor 個人化廣告時段之後的廣告時段。

```
<Period id="178443_1" start="PT96H15M30.25S">
  <BaseURL>http://111122223333.cloudfront.net/nbc_fallback_2/</BaseURL>
  <AdaptationSet bitstreamSwitching="false" frameRate="30/1" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
    <SegmentTemplate startNumber="1" timescale="90000"/>
    <Representation bandwidth="10000000" codecs="avc1.640028" height="1080" id="1" width="1920">
      <SegmentTemplate initialization="nbc_fallback_ad_2_1080p_10init.mp4" media="nbc_fallback_ad_2_1080p_10_$Number%09d$.mp4" startNumber="1" timescale="90000">
        <SegmentTimeline>
          <S d="180000" r="13" t="0"/>
          <S d="176940" t="2520000"/>
        </SegmentTimeline>
      </SegmentTemplate>
    </Representation>
  </AdaptationSet>
</Period>
```

時間訊號的個人化 MPD 類似於接合插入的 MPD，MediaTailor 會為廣告內容建立新的期間。

## VOD DASH MPD 範例
<a name="dash-manifest-vod-examples"></a>

本節提供隨需視訊 (VOD) DASH MPDs的範例。每個範例都會列出從原始伺服器收到的 MPD，並在 MediaTailor 使用廣告個人化 MPD 之後。

VOD DASH MPDs遵循與即時 MPDs相同的結構，但它們通常在 MPD 元素中具有`type="static"`屬性，並且可能包含不同內容區段的多個期間。

如需 VOD DASH MPDs的範例，請參閱 上的 MediaTailor 文件[DASH 廣告標記](dash-ad-markers.md)。

## 個人化 MPDs的主要差異
<a name="dash-manifest-key-differences"></a>

當 MediaTailor 個人化 DASH MPDs時，會進行幾項重要的變更：

期間處理  
+ 為廣告內容建立新的期間
+ 調整期間開始時間以維持時間軸連續性
+ 處理和移除具有 SCTE-35 標記的 EventStream 元素

AdaptationSet 和表示法處理  
+ 廣告時段中的 AdaptationSets 會建立以符合內容 AdaptationSets
+ 會針對廣告內容的不同品質層級建立表示式
+ SegmentTemplate 元素已更新以指向廣告內容

了解這些變更可協助您疑難排解 MediaTailor 工作流程中的問題，並確保 CDN 和播放器的組態正確。

## 相關主題
<a name="dash-manifest-related-topics"></a>

如需 DASH MPDs和 MediaTailor 的詳細資訊，請參閱下列主題：
+ [DASH 資訊清單類型](dash-manifest-types.md) - DASH 資訊清單類型的詳細說明
+ [使用 CDN 最佳化 MediaTailor 廣告個人化和內容交付](integrating-cdn.md) - 搭配 MediaTailor 使用 CDN 的相關資訊
+ [MediaTailor 廣告插入的運作方式](what-is-flow.md) - MediaTailor 廣告插入的運作方式概觀
+ 如需 DASH 資訊清單結構和 MediaPackage 組態的完整資訊，請參閱 DASH 概觀上的 MediaPackage 使用者指南一節。

# DASH 位置功能
<a name="dash-location-feature"></a>

本節提供有關 DASH 定位功能的資訊，這項功能在 AWS Elemental MediaTailor中為預設啟用狀態。如果您建立內容交付網路 (CDN) 路由規則來存取 MediaTailor 資訊清單，請閱讀本節。如果您要使用伺服器端報告搭配不支援黏性 HTTP 重新導向的播放器使用，也請閱讀本節內容。

**什麼是定位功能？**  
不支援黏性功能的播放器可以透過定位功能，在其資訊清單更新請求中提供黏性行為。

AWS Elemental MediaTailor 使用無工作階段初始化，而且需要玩家的黏性 HTTP 重新導向行為。透過伺服器端報告，當玩家向 MediaTailor 提出資訊清單更新請求時，服務會發出 302 暫時重新導向，將玩家導向個人化資訊清單的端點。MediaTailor 在回應中包含工作階段 ID，做為查詢參數。這個作業的目的是要讓播放器遵循 URL 來完成整段工作階段，但是不支援黏性 HTTP 重新導向的播放器會捨棄該重新導向，而返回原始的 URL。當玩家返回原始 URL 時，針對每個新請求，MediaTailor 會建立新的工作階段，而不是保留原始工作階段。這可能會導致資訊清單發生損毀。

DASH 規格在位置功能中提供此問題的解決方案，該功能預設為在 AWS Elemental MediaTailor 組態中啟用。啟用此功能時，MediaTailor 會將絕對 URL 放在資訊清單`<Location>`標籤中。不支援黏性 HTTP 重新導向的播放器，可以使用 `<Location>` 請求中提供的 URL 來更新資訊清單。

**我是否需要在我的組態中停用定位功能？**  
此定位功能會覆寫您設定用於存取 AWS Elemental MediaTailor 資訊清單的任何 CDN 路由規則，因此您可能需要停用它。此定位功能不會影響內容或廣告片段的 CDN 快取。

請從下面清單中找出您的情況，並判斷您是否需要針對您的組態停用定位功能及如何處理：
+ 如果您沒有設定用於存取 AWS Elemental MediaTailor 資訊清單的 CDN 路由規則，請保留啟用定位設定。
+ 否則，請使用下列規則：
  + 如果您不使用伺服器端報告或播放器全部都支援黏性 HTTP 重新導向，則請停用定位功能。如需如何在主控台上執行此作業的資訊，請參閱[建立 MediaTailor 播放組態](configurations-create.md)。
  + 否則，請聯絡 [AWS Support](https://aws.amazon.com/premiumsupport/)。

**我是否需要使用定位功能？**  
對於不支援黏性 HTTP 重新導向的玩家，您需要使用位置功能。為您的所有資訊清單更新請求使用 `<Location>` 標籤中所提供的 URL。

**範例**  
URL 範例和 `<Location>` 標籤範例。
+   
**Example 範例：初始請求 URL**  

  ```
  https://777788889999.mediatailor.us-east-1.amazonaws.com/v1/dash/5ca4c1892b1f213a1247fad47b3e34c454a7d490/testLocationTag/index.mpd
  ```
+   
**Example 範例：重新導向的 302 回應**  

  ```
  /v1/dash/5ca4c1892b1f213a1247fad47b3e34c454a7d490/testLocationTag/index.mpd?aws.sessionId=0e5d9b45-ae97-49eb-901b-893d043e0aa6
  ```
+   
**Example 範例：資訊清單的位置標籤**  

  ```
  <Location>https://777788889999.mediatailor.us-east-1.amazonaws.com/v1/dash/5ca4c1892b1f213a1247fad47b3e34c454a7d490/testLocationTag/index.mpd?aws.sessionId=0e5d9b45-ae97-49eb-901b-893d043e0aa6</Location>
  ```