RFC 3986 URI的结构

mpeg dash 的element BaseURL语法规则遵循RFC 3986,需要做简单了解:

I.1 URI各个部分的名称

 foo://example.com:8042/over/there?name=ferret#nose

 \_/   \______________/\_________/ \_________/ \__/

  |                   |                          |                     |             |              

scheme     authority                    path              query   fragment

  |   _________________________|__

 / \ /                                           \

 urn:example:animal:ferret:nose

 

scheme:协议的名称,以字母开头,后接任意个字母/数字/+/-/.的组合。

                scheme      = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

 

authority:以双斜线”//”开始但不包括”//”, 以紧接着的第一个’/’或者?或者##在这里

                叫着number sign)结束但不包括该符号,或者一直到URL结束为止。

                authority   = [ userinfo "@" ] host [ ":" port ]

                []内的部分是可选部分。

path: authority之后,以/开头,以紧接着的第一个?或者#结束或者直到URL结束为止。

query:以?开头,以紧接着的第一个#结束,或者直到URL结束为止,query常常以

          “key=value”的形式来携带一些认证信息。

fragment: #开头,直到URL结束为止。Fragment常用于标记一个参考主要资源的次要

                 资源。

I.2 URI的参考规则

URI-referenceURI-reference可能是URI或者relative-reference,当URI-reference的前缀不

                      匹配scheme的语法时,表明URI-reference是一个relative-reference

                      Relative-reference所参考的URItarget URI

mpeg dash中,暂时只需要知道BaseURL可能需要参考上级的BaseURL来组合成一个完整的http链接即可,如下:

 

<?xml version="1.0"?>

 

<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 DASH-MPD.xsd"

 

 type="static"

 

 mediaPresentationDuration="PT3256S"

 

 minBufferTime="PT1.2S"

 

 profiles="urn:mpeg:dash:profile:isoff-on-demand:2011">

 

 <BaseURL>http://cdn1.example.com/</BaseURL>

 

 <BaseURL>http://cdn2.example.com/</BaseURL>

 

 <Period>

 

 <!-- English Audio -->

 

 <AdaptationSet mimeType="audio/mp4" codecs="mp4a.0x40" lang="en" subsegmentAlignment="true"

 

subsegmentStartsWithSAP="1">

 

 <ContentProtection schemeIdUri="urn:uuid:706D6953-656C-5244-4D48-656164657221"/>

 

 <Representation id="1" bandwidth="64000">

 

 <BaseURL>7657412348.mp4</BaseURL>

 

 </Representation>

 

 <Representation id="2" bandwidth="32000">

 

 <BaseURL>3463646346.mp4</BaseURL>

 

 </Representation>

 

 </AdaptationSet>

 

</Period>

 

</MPD>

 

访问两个MP4文件的HTTP URL需要组合MPD中的BaseURL和Representation中的BaseURL

 

http://cdn1.example.com/7657412348.mp4

 

http://cdn1.example.com/3463646346.mp4

 

或者

 

http://cdn2.example.com/7657412348.mp4

 

http://cdn2.example.com/3463646346.mp4

 

 

posted @ 2014-12-09 00:01  VLeung  阅读(1833)  评论(0编辑  收藏  举报