Number的计算方法:
Number = curTime(秒级)/片段时长 + startNumer
startNumber可以是正数,也可以是负数,对于直播来说,startNumber从0开始即可,对于时移来说,就是偏移的秒数除以片段时长得到
例子:
<?xml version="1.0"?>
<MPD
type="dynamic"
xmlns="urn:mpeg:dash:schema:mpd:2011"
availabilityStartTime="1970-01-01T00:00:00Z"
minimumUpdatePeriod="PT5S"
minBufferTime="PT5S"
timeShiftBufferDepth="PT5M"
suggestedPresentationDelay="PT10S"
profiles="urn:mpeg:dash:profile:isoff-live:2011"
xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
<Period start="PT0S" id="dash">
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="720"
maxHeight="576"
maxFrameRate="25">
<SegmentTemplate timescale="1000" duration="5000" startNumber="-298292" initialization="haizeiwang-init.m4v" media="haizeiwang-$Number$.m4v"/>
<Representation id="haizeiwang_H264" mimeType="video/mp4" codecs="avc1.4d500b" width="720" height="576" frameRate="25" sar="1:1" startWithSAP="1" bandwidth="50877"/>
</AdaptationSet>
</Period>
</MPD>
或者
<?xml version="1.0"?>
<MPD
type="dynamic"
xmlns="urn:mpeg:dash:schema:mpd:2011"
availabilityStartTime="1970-01-01T00:00:00Z"
minimumUpdatePeriod="PT5S"
minBufferTime="PT5S"
timeShiftBufferDepth="PT5M"
suggestedPresentationDelay="PT10S"
profiles="urn:mpeg:dash:profile:isoff-live:2011"
xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd">
<Period start="PT0S" id="dash">
<AdaptationSet
id="1"
segmentAlignment="true"
maxWidth="720"
maxHeight="576"
maxFrameRate="25">
<Representation id="haizeiwang_H264" mimeType="video/mp4" codecs="avc1.4d500b" width="720" height="576" frameRate="25" sar="1:1" startWithSAP="1" bandwidth="50877">
<SegmentTemplate timescale="1000" duration="5000" startNumber="-298292" initialization="haizeiwang-init.m4v" media="haizeiwang-$Number$.m4v"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>