我从 http://dash-mse-test.appspot.com/media.html 获得了一个示例 mpd 文件下面是包含单个表示的片段。
...
<Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
<BaseURL>car_cenc-20120827-89.mp4</BaseURL>
<SegmentBase indexRange="2755-3230">
<Initialization range="0-2754" />
</SegmentBase>
</Representation>
...
SegmentBase 是什么意思? indexRange 的值是什么意思?
初始化结束范围始终比indexRange起始值小1。即上面的2755-1 = 2754(Initialization的值)
谁能帮我理解这些数字的意义?
编辑1:
根据下面@sander的回答,我理解segmentindex是字节范围。但是,我仍然对如何使用这个值感到困惑。
例如:
<Representation bandwidth="4190760" codecs="avc1.640028" height="1080" id="1" mimeType="video/mp4" width="1920">
<BaseURL>car-20120827-89.mp4</BaseURL>
<SegmentBase indexRange="674-1149">
<Initialization range="0-673" />
</SegmentBase>
</Representation>
此表示中只有一个片段包含单个文件中的整个视频剪辑。 (文件大小约为90mb)。
初始化范围提到0-673。因此,从文件的第 0 个字节到文件的第 673 个字节包含视频的初始化段。我的理解对吗?
如果是这样,该文件大约为 90mb。如何按字节范围获取其他段? SegmentBase仅提到indexRange 674-1149。
顺便说一句,我正在使用这个播放器来理解段索引。
查看使用 Chrome 的检查工具发送的 header 请求,有很多请求发生在小字节范围内,但我不确定如何从 MPD 获取这些字节范围。
谢谢
最佳答案
此文件的确切格式在DASH specification (ISO/IEC 23009-1)中描述。 。 SegmentBase
元素在第 5.3.9.2 章中进行了描述。
我对此片段的解释是,该表示由单个 mp4 文件组成,该文件作为一个片段传送给播放器。 indexRange
是该段内的字节范围,表示段索引(mp4 文件中的 sidx
框),Initialization
元素指示包括任何相关初始化数据(mp4 文件中的各种 header 框)的字节范围。正如您所注意到的,这些范围整齐地覆盖了该段的开头,其余部分可能填充了媒体样本数据。字节范围告诉播放器应该从哪里加载相关数据。
编辑:sidx
框包含引用此单个 mp4 文件的子段的字节范围。引用自ISO/IEC 14496-12:2012(E) :
Each Segment Index box documents how a (sub)segment is divided into one or more subsegments (which may themselves be further subdivided using Segment Index boxes).
A subsegment is defined as a time interval of the containing (sub)segment, and corresponds to a single range of bytes of the containing (sub)segment. The durations of all the subsegments sum to the duration of the containing (sub)segment.
根据 sidx
框中的内容,播放器可以确定需要下载 mp4 文件的哪些部分才能播放视频的特定片段。
关于video-streaming - mpd 文件中的段范围是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27501164/