

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

# 壓縮的 DASH 資訊清單
<a name="compacted"></a>

中提供了壓縮 DASH 資訊清單的功能，以改善 VOD 和即時低功耗裝置的效能和處理 AWS Elemental MediaPackage。

MediaPackage 的預設 DASH 資訊清單包含每個表示法 （軌跡） 的重複資料。對於有些播放程式，要處理具有這所有資料的資訊清單既困難且緩慢。為了減輕一些負擔，MediaPackage 可以透過將一些屬性從`Representation`物件移至`AdaptationSet`物件來壓縮資訊清單。以此方式，不需在資訊清單中為每個呈現定義屬性，而是在更高層級定義一次即可。然後呈現會從調節集繼承這些屬性。

**Example 預設 DASH 資訊清單**  
在下列範例中，`SegmentTemplate` 物件及其所有元素會列在每個 `Representation.` 中。資訊清單中的每個調節集會有相同的配置：  

```
<AdaptationSet mimeType="video/mp4" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
   <Representation id="1" width="640" height="360" frameRate="30/1" bandwidth="749952" codecs="avc1.640029">
      <SegmentTemplate timescale="30000" media="index_video_1_0_$Number$.mp4?m=1543947824" initialization="index_video_1_0_init.mp4?m=1543947824" startNumber="1">
         <SegmentTimeline>
           <S t="62000" d="60000" r="9"/>
         </SegmentTimeline>
      </SegmentTemplate>
   </Representation>
   <Representation id="2" width="854" height="480" frameRate="30/1" bandwidth="1000000" codecs="avc1.640029">
      <SegmentTemplate timescale="30000" media="index_video_3_0_$Number$.mp4?m=1543947824" initialization="index_video_3_0_init.mp4?m=1543947824" startNumber="1">
         <SegmentTimeline>
           <S t="62000" d="60000" r="9"/>
         </SegmentTimeline>
      </SegmentTemplate>
   </Representation>
   <Representation id="3" width="1280" height="720" frameRate="30/1" bandwidth="2499968" codecs="avc1.640029">
      <SegmentTemplate timescale="30000" media="index_video_5_0_$Number$.mp4?m=1543947824" initialization="index_video_5_0_init.mp4?m=1543947824" startNumber="1">
         <SegmentTimeline>
           <S t="62000" d="60000" r="9"/>
         </SegmentTimeline>
      </SegmentTemplate>
   </Representation>
</AdaptationSet>
```

**Example 精簡的 DASH 資訊清單**  
在這個範例中，`SegmentTemplate` 物件和其所有元素都收合成一個，並移動到 `AdaptationSet`。播放裝置了解此調節集中的每個呈現會使用此相同的範本：  

```
<AdaptationSet mimeType="video/mp4" segmentAlignment="true" subsegmentAlignment="true" startWithSAP="1" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
   <SegmentTemplate timescale="30000" media="index_video_$RepresentationID$_0_$Number$.mp4?m=1543947824" initialization="index_video_$RepresentationID$_0_init.mp4?m=1543947824" startNumber="1">
     <SegmentTimeline>
       <S t="62000" d="60000" r="9"/>
     </SegmentTimeline>
   </SegmentTemplate>
   <Representation id="1" width="640" height="360" frameRate="30/1" bandwidth="749952" codecs="avc1.640029"/>
   <Representation id="2" width="854" height="480" frameRate="30/1" bandwidth="1000000" codecs="avc1.640029"/>
   <Representation id="3" width="1280" height="720" frameRate="30/1" bandwidth="2499968" codecs="avc1.640029"/>
</AdaptationSet>
```

 如需精簡 DASH 資訊清單的詳細資訊，請參閱 [AWS Elemental MediaPackage 如何精簡資訊清單](#how-cpact-works)。

## AWS Elemental MediaPackage 精簡資訊清單
<a name="how-cpact-works"></a>

若要從 AWS Elemental MediaPackage 主控台壓縮 DASH 資訊清單，請在 DASH 端點上選擇 **Compact** for **Manifest 配置**。為了確保追蹤在正確的時間可用，MediaPackage 會檢查來源內容中的影格率和音訊取樣率，以判斷資訊清單是否可以壓縮。

**注意**  
字幕追蹤一律使用相同的速率，因此 MediaPackage 一律使用字幕壓縮調整集。

MediaPackage 會採取下列動作：
+ 如果調整集中所有表示法的速率相同，MediaPackage 會將所有`SegmentTemplate`物件摺疊為一個，並將其移至`AdaptationSet`關卡。以此方式，範本中的資訊不會在整個資訊清單中重複。若要允許播放裝置跨表示法使用相同的範本資訊，MediaPackage 會將`$RepresentationID$`變數新增至 `media`並`initialization`請求 URLs。播放裝置會將此變數取代為其目前正在請求的表示式 ID。MediaPackage 也會在`ContentProtection`元素存在時，將其移至適應集。
+ 如果各表示法的速率不同，MediaPackage 會壓縮 `SegmentTemplate` ，並將頻率最高的 移至 `AdaptationSet`。具有不同速率的呈現會保有自己的區段範本。此呈現的速率會覆寫位於調節集的呈現。
+ 如果影片調整集中使用的影格率正好有兩個，MediaPackage 會壓縮如下：
  + 使用 24 和 48 時，精簡的範本會對影格率使用 48，以及對時間基礎使用 48000。
  + 使用 25 和 50 時，精簡的範本會對影格率使用 50，以及對時間基礎使用 50000。
  + 使用 29.97 和 59.94 時，精簡的範本會對影格率使用 59.95，以及對時間基礎使用 60000。
  + 使用 30 和 60 時，精簡的範本會對影格率使用 60，以及對時間基礎使用 60000。

  如果有兩個視訊影格率使用中，但兩者不是以上所述的任一個加倍模式，則無法將該集精簡。
+ 如果調節集中的呈現間沒有重複的速率，則將無法將該集精簡。