如何创建MPEG-DASH的MPD文件来播放webm视频?

时间:2013-02-07 12:28:36

标签: xml html5-video mpeg webm mpeg-dash

我正在关注使用mediaSource API和 MPEG DASH 标准的demo来播放.webm视频。 这是使用的MPD文件:

<?xml version="1.0" encoding="UTF-8"?>
<MPD
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="urn:mpeg:DASH:schema:MPD:2011"
  xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011"
  type="static"
  mediaPresentationDuration="PT888.05S"
  minBufferTime="PT1S"
  profiles="urn:webm:dash:profile:webm-on-demand:2012">
  <Period id="0" start="PT0S" duration="PT888.05S" >
  <AdaptationSet id="0" mimeType="video/webm" codecs="vp8" lang="eng" width="720"      height="306" subsegmentAlignment="true" subsegmentStartsWithSAP="1" bitstreamSwitching="true">
  <Representation id="1" bandwidth="534144">
    <BaseURL>mevq_logo_720x306_0250k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="29052226-29054708">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
  <Representation id="2" bandwidth="1078766">
    <BaseURL>mevq_logo_720x306_0500k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="56003676-56006200">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
  <Representation id="3" bandwidth="1745140">
    <BaseURL>mevq_logo_720x306_0750k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="83686040-83688577">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
  <Representation id="4" bandwidth="2295403">
    <BaseURL>mevq_logo_720x306_1000k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="111588024-111590567">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
  <Representation id="5" bandwidth="3797938">
    <BaseURL>mevq_logo_720x306_1500k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="166960740-166963291">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
  <Representation id="6" bandwidth="6418657">
    <BaseURL>mevq_logo_720x306_2000k_int-150-150.webm</BaseURL>
    <SegmentBase indexRange="222165200-222167753">
      <Initialization range="0-229" />
    </SegmentBase>
  </Representation>
</AdaptationSet>
<AdaptationSet id="1" mimeType="audio/webm" codecs="vorbis" lang="eng" audioSamplingRate="41000" subsegmentStartsWithSAP="1">
  <Representation id="7" bandwidth="115479">
    <BaseURL>evq_vorbis_128kbps_cues-5sec_tracks-2.webm</BaseURL>
    <SegmentBase indexRange="11944509-11947524">
      <Initialization range="0-4501" />
    </SegmentBase>
  </Representation>
</AdaptationSet>

是否有人知道如何获取/计算任何视频的“SegmentBase indexRange”和“初始化范围”?

1 个答案:

答案 0 :(得分:6)

indexRange包含段索引框(sidx)。 它基本上是元数据片段,包含有关播放器在下载文件时应该请求的片段的信息。 这是规范的引用:

  

“indexRange指定包含段索引的字节范围   在表示的所有媒体段中。字节范围   应表达并格式化为字节范围规范,如中所定义   RFC 2616,第14.35.1条。它仅限于单个表达式   识别连续的字节范围。“

sidx框在HERE中描述 并且可以找到解析器HEREHERE(from dash.js project)

初始化 - 根据规范:

  

“指定包含可能的字节范围的URL   初始化细分。“

希望它有所帮助!

相关问题