本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。
DASH MPD 範例
下列各節提供 DASH 原始 MPDs和個人化 MPDs的範例。了解這些範例可協助您設定 MediaTailor 工作流程並進行疑難排解。
了解 DASH MPD 結構
透過 HTTP 的動態自適應串流 (DASH) 使用媒體簡報描述 (MPD) 資訊清單來交付串流內容。MPD 是描述媒體內容結構和可用性的 XML 文件。
- MPD (媒體簡報描述)
-
MPD 是 DASH 串流中描述媒體內容結構和可用性的主要資訊清單檔案。它包含組成串流內容的期間、調整集、表示和客群的相關資訊。
此資訊清單類型在各種內容中也是由數個其他名稱所知道,包括 DASH 資訊清單、DASH MPD、主資訊清單 (與 HLS 比較時) 或簡報資訊清單。
在 MediaTailor 工作流程中,MPD 是播放請求的進入點,也是廣告個人化開始的位置。
- 期間
-
期間是 DASH 簡報的暫時區段。每個期間包含一或多個適應集,並代表媒體時間的範圍。在廣告插入工作流程中,通常會使用個別的期間來描述內容和廣告。
在 MediaTailor 工作流程中,期間用於分隔主要內容與廣告內容,每個廣告通常以自己的期間表示。
- AdaptationSet
-
AdaptationSet 會將一或多個媒體內容元件的一組可互換編碼版本分組。例如,一個 AdaptationSet 可能包含多個視訊品質等級,而另一個可能包含多個音訊語言選項。
在 MediaTailor 工作流程中,廣告插入期間會保留 AdaptationSets,以在內容和廣告之間維持一致的媒體類型。
- 代表
-
表示法是 AdaptationSet 內媒體內容的特定編碼版本。每個表示法通常在位元速率、解析度或其他編碼參數上有所不同,允許用戶端根據網路條件和裝置功能選取最適當的版本。
在 MediaTailor 工作流程中,廣告期間的呈現會盡可能與內容期間的呈現相符,以確保順暢的檢視體驗。
如需 DASH 資訊清單類型的詳細資訊,請參閱 DASH 資訊清單類型。
即時 DASH MPD 範例
本節提供即時 DASH MPDs的範例。每個範例都會列出從原始伺服器接收的 MPD,並在 MediaTailor 使用廣告個人化 MPD 之後。
DASH MPD 接合插入範例
接合插入的 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 時間訊號範例
時間訊號的 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 範例
本節提供隨需視訊 (VOD) DASH MPDs的範例。每個範例都會列出從原始伺服器接收的 MPD,並在 MediaTailor 使用廣告個人化 MPD 之後。
VOD DASH MPDs遵循與即時 MPDs相同的結構,但它們通常在 MPD 元素中具有type="static"
屬性,並且可能包含不同內容區段的多個期間。
如需 VOD DASH MPDs的範例,請參閱 上的 MediaTailor 文件DASH 廣告標記。
個人化 MPDs的主要差異
當 MediaTailor 個人化 DASH MPDs時,會進行幾項重要的變更:
- 期間處理
-
-
為廣告內容建立新的期間
-
調整期間開始時間以維持時間軸連續性
-
處理和移除具有 SCTE-35 標記的 EventStream 元素
-
- AdaptationSet 和表示法處理
-
-
廣告時段中的 AdaptationSets 會建立以符合內容 AdaptationSets
-
會針對廣告內容的不同品質層級建立表示式
-
SegmentTemplate 元素已更新以指向廣告內容
-
了解這些變更可協助您疑難排解 MediaTailor 工作流程中的問題,並確保 CDN 和播放器的組態正確。
相關主題
如需 DASH MPDs和 MediaTailor 的詳細資訊,請參閱下列主題:
-
DASH 資訊清單類型 - DASH 資訊清單類型的詳細說明
-
使用 CDN 最佳化 MediaTailor 廣告個人化和內容交付 - 搭配 MediaTailor 使用 CDN 的相關資訊
-
MediaTailor 廣告插入的運作方式 - MediaTailor 廣告插入的運作方式概觀