DASH MPD 文件内容解析

拿个MPD内容举个例子:

<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Broadpeak BkS350 Origin Packager (version=1.10.12-18737) -->
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd" type="dynamic" availabilityStartTime="1970-01-01T00:00:00Z" publishTime="2020-08-07T12:23:37.803894Z" minimumUpdatePeriod="PT8S" timeShiftBufferDepth="PT24S" maxSegmentDuration="PT8S" minBufferTime="PT8S" profiles="urn:mpeg:dash:profile:isoff-live:2011,urn:com:dashif:dash264">
<Period id="1" start="PT0S">
<EventStream schemeIdUri="urn:de:dtag:eit:2017" value="18" timescale="10000000">
<Event presentationTime="15968027365242607" duration="31550000000" id="2138119006" contentEncoding="base64">RVZFTlRJRD0yNUY0LFZFUlNJT049MTUsRkxBRz0wLFNUQVJUVElNRT1FNkJDMTE1OTU3LERVUkFUSU9OPTUyMzUsU1RBVFVTPTQsREVTQ180RD02NDY1NzUwRDQ4NjE3NzYxNjk2OTIwNDY2OTc2NjUyRDMwNDIwNTQyNjU3MjY1Njk3NDIwNjZGQzcyMjA2NTY5NkUyMDUzNzA2OTY1NkMzRjhBNDM3MjY5NkQ2NTJENTM2NTcyNjk2NTJDMjA1NTUzNDEyMDMyMzAzMTM2OEE0MTZDNzQ2NTcyNzM2NjcyNjU2OTY3NjE2MjY1M0EyMDYxNjIyMDMxMzIsREVTQ19CQj0xNyxERVNDX0JDPTU3</Event>
</EventStream>
<AdaptationSet id="1" group="1" contentType="audio" segmentAlignment="true" audioSamplingRate="48000" mimeType="audio/mp4" codecs="mp4a.40.2" startWithSAP="1">
<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2">
</AudioChannelConfiguration>
<!-- Common Encryption -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="C8EFFF27-6E1A-D9E6-693F-3E0B64C8EFEC">
</ContentProtection>
<!-- PlayReady -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" schemeIdUri="urn:uuid:9A04F079-9840-4286-AB92-E65BE0885F95" value="MSPR 2.0">
</ContentProtection>
<!-- Widevine -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" schemeIdUri="urn:uuid:EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED">
</ContentProtection>
<InbandEventStream schemeIdUri="urn:de:dtag:eit:2017" value="18">
</InbandEventStream>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="48000" initialization="KabelEins_SD-$RepresentationID$.dash" media="KabelEins_SD-$RepresentationID$-$Time$.dash">
<!-- 2020-08-07T12:23:04.540250Z / 1596802984 - 2020-08-07T12:23:28.540250Z -->
<SegmentTimeline>
<S t="76646543257932" d="384000" r="2"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="audio_129713_deu=129200" bandwidth="129200">
</Representation>
</AdaptationSet>
<AdaptationSet id="2" group="2" contentType="video" par="16:9" minBandwidth="576400" maxBandwidth="2276800" maxWidth="960" maxHeight="540" minFrameRate="25" maxFrameRate="50" segmentAlignment="true" sar="1:1" mimeType="video/mp4" startWithSAP="1">
<!-- Common Encryption -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:cenc="urn:mpeg:cenc:2013" schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="C8EFFF27-6E1A-D9E6-693F-3E0B64C8EFEC">
</ContentProtection>
<!-- PlayReady -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" schemeIdUri="urn:uuid:9A04F079-9840-4286-AB92-E65BE0885F95" value="MSPR 2.0">
</ContentProtection>
<!-- Widevine -->
<ContentProtection xmlns="urn:mpeg:dash:schema:mpd:2011" schemeIdUri="urn:uuid:EDEF8BA9-79D6-4ACE-A3C8-27DCD51D21ED">
</ContentProtection>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:ColourPrimaries" value="5">
</SupplementalProperty>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:TransferCharacteristics" value="5">
</SupplementalProperty>
<SupplementalProperty schemeIdUri="urn:mpeg:mpegB:cicp:MatrixCoefficients" value="5">
</SupplementalProperty>
<InbandEventStream schemeIdUri="urn:de:dtag:eit:2017" value="18">
</InbandEventStream>
<Role schemeIdUri="urn:mpeg:dash:role:2011" value="main"/>
<SegmentTemplate timescale="600" initialization="KabelEins_SD-$RepresentationID$.dash" media="KabelEins_SD-$RepresentationID$-$Time$.dash">
<!-- 2020-08-07T12:23:04.523333Z / 1596802984 - 2020-08-07T12:23:36.523333Z -->
<SegmentTimeline>
<S t="958081790714" d="4800" r="3"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="video=576400" bandwidth="576400" width="480" height="270" frameRate="25" codecs="avc1.640015" scanType="progressive">
</Representation>
<Representation id="video=1138400" bandwidth="1138400" width="640" height="360" frameRate="25" codecs="avc1.64001E" scanType="progressive">
</Representation>
<Representation id="video=2276800" bandwidth="2276800" width="960" height="540" frameRate="50" codecs="avc1.64001F" scanType="progressive">
</Representation>
</AdaptationSet>
</Period>
<UTCTiming schemeIdUri="urn:mpeg:dash:utc:http-iso:2014" value="https://time.akamai.com/?iso"/>

蓝色部分是EIT信息,base64解密之后息的是:EVENTID=25F4,VERSION=15,FLAG=0,STARTTIME=E6BC115957,DURATION=5235,STATUS=4,DESC_4D=6465750D48617761696920466976652D3042054265726569742066FC722065696E20537069656C3F8A4372696D652D53657269652C2055534120323031368A416C7465727366726569676162653A206162203132,DESC_BB=17,DESC_BC=57 

红色部分是加密信息,里面有playready 和 widevine 加密default_KID="C8EFFF27-6E1A-D9E6-693F-3E0B64C8EFEC"  kid信息。

紫色部分是音频分片信息 绿色是视频信息

来看音频信息:

<SegmentTemplate timescale="48000" initialization="KabelEins_SD-$RepresentationID$.dash" media="KabelEins_SD-$RepresentationID$-$Time$.dash">
<!-- 2020-08-07T12:23:04.540250Z / 1596802984 - 2020-08-07T12:23:28.540250Z -->
<SegmentTimeline>
<S t="76646543257932" d="384000" r="2"/>
</SegmentTimeline>
</SegmentTemplate>
<Representation id="audio_129713_deu=129200" bandwidth="129200">
</Representation>

timescale 时间精度,也就是1秒的分辨率

initialization 初始化分片格式 KabelEins_SD-$RepresentationID$.dash 根据后面的RepresentationID audio_129713_deu=129200可知道该音频的初始化分片为 KabelEins_SD-audio_129713_deu=129200.dash 

media 媒体文件名称KabelEins_SD-$RepresentationID$-$Time$.dash 根据后面的RepresentationID  audio_129713_deu=129200和 SegmentTimeline 值可以知道实际分片:

<SegmentTimeline>
<S t="76646543257932" d="384000" r="2"/>
</SegmentTimeline>

t 开始时间 d duration 实际分片时间是 d/timscale = 8s ,r repeat ,那么当前mpd文件 有三个分片 time 为:

76646543257932/76646543257932+384000=76646543641932/76646543257932+384000+384000=76646544025932

KabelEins_SD-audio_129713_deu=129200-76646543257932.dash

KabelEins_SD-audio_129713_deu=129200-76646543641932.dash

KabelEins_SD-audio_129713_deu=129200-76646544025932.dash

同理可以推出视频信息,那么针对该MPD内容我们可以得出如下的信息:

1.dash流里有eit信息

2.dash流为加密流含有两种加密 playready 和 widevine

3.音频流只有一个格式分片 初始化分片(主要用于解码器预载)KabelEins_SD-audio_129713_deu=129200.dash  音频分片有三个 KabelEins_SD-audio_129713_deu=129200-76646543257932.dash/KabelEins_SD-audio_129713_deu=129200-76646543641932.dash/KabelEins_SD-audio_129713_deu=129200-76646544025932.dash 每个分片时长8s

4.视频流有多个带宽,分片时长为8s :

初始化分片 KabelEins_SD-video=576400.dash 分片信息 KabelEins_SD-video=576400-958081790714.dash/KabelEins_SD-video=576400-958081795514.dash/KabelEins_SD-video=576400-958081800314.dash/KabelEins_SD-video=576400-958081805114.dash/KabelEins_SD-video=576400-958081809914.dash

初始化分片 KabelEins_SD-video=1138400.dash 分片信息 KabelEins_SD-video=1138400-958081790714.dash/KabelEins_SD-video=1138400-958081795514.dash/KabelEins_SD-video=1138400-958081800314.dash/KabelEins_SD-video=1138400-958081805114.dash /KabelEins_SD-video=576400-958081809914.dash

初始化分片 KabelEins_SD-video=2276800.dash 分片信息 KabelEins_SD-video=2276800-958081790714.dash/KabelEins_SD-video=2276800-958081795514.dash/KabelEins_SD-video=2276800-958081800314.dash/KabelEins_SD-video=2276800-958081805114.dash/KabelEins_SD-video=576400-958081809914.dash

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值