【Azure 媒体服务】AMS的Manifest文件中SmoothStreamingMedia片段中<c t="6161940" d="749970" r="2" n="0" />, c, t, d, r, n 的解析

问题描述

在Azure媒体服务(AMS: Azure Media Service)中,不管是点播,直播都需要下载manifest文件。而文件中有一段【<c t="6161940" d="749970" r="2" n="0" />】内容,这些内容如何解释呢?

<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreamingMedia MajorVersion="2" MinorVersion="2" Duration="256333" TimeScale="1000">
               <StreamIndex Chunks="34" Type="video" Url="QualityLevels({bitrate})/Fragments(video={start time})" QualityLevels="6" Language="und" Subtype="" Name="video" TimeScale="90000">
                              <QualityLevel Index="0" Bitrate="5500000" FourCC="H264" MaxWidth="1920" MaxHeight="1080" CodecPrivateData="00000007640028ACD940780227E584000003000400000300F03C60C6580000000168EB0" />
                              <c t="3151940" d="736961" r="2" n="0" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" r="2" />
                              <c d="750060" />
                              <c d="736961" />
               </StreamIndex>
               <StreamIndex Chunks="34" Type="audio" Url="QualityLevels({bitrate})/Fragments(audio_und={start time})" QualityLevels="1" Language="und" Subtype="" Name="audio_und" TimeScale="48000">
                              <QualityLevel AudioTag="255" Index="0" BitsPerSample="16" Bitrate="128000" FourCC="AACL" CodecPrivateData="119056E500" Channels="2" PacketSize="4" SamplingRate="48000" />
                              <c t="3288152" d="289351" r="2" n="0" />
                              <c d="400384" />
                              <c d="289351" />
                              <c d="401408" />
                              <c d="289351" r="2" />
                              <c d="400384" />
                              <c d="289351" />
                              <c d="401408" />
                              <c d="289351" r="2" />
                              <c d="400384" />
                              <c d="289351" />
                              <c d="401408" />
                              <c d="289351" r="2" />
                              <c d="400384" />
                              <c d="401408" />
                              <c d="289351" r="3" />
                              <c d="400384" />
                              <c d="401408" />
                              <c d="289351" r="2" />
                              <c d="400384" />
                              <c d="289351" />
                              <c d="401408" />
                              <c d="289351" r="2" />
                              <c d="400384" />
                              <c d="289351" />
                              <c d="401408" />
               </StreamIndex>
               <StreamIndex Chunks="0" Type="text" ParentStreamIndex="video" Url="QualityLevels({bitrate})/Fragments(amssignal={start time})" ManifestOutput="TRUE" QualityLevels="1" Subtype="ADI3" Name="amssignal" TimeScale="10000000">
                              <QualityLevel Index="0" Bitrate="0" FourCC="DATA" CodecPrivateData="" />
               </StreamIndex>
               <StreamIndex Chunks="0" Type="text" ParentStreamIndex="video" Url="QualityLevels({bitrate},{CustomAttributes})/Fragments(scte35={start time})" ManifestOutput="TRUE" QualityLevels="1" Subtype="DATA" Name="scte35" TimeScale="1000">
                              <QualityLevel Index="0" Bitrate="1" FourCC="" CodecPrivateData="">
                                             <CustomAttributes>
                                                            <Attribute Name="Scheme" Value="urn:scte:scte35:2013a:bin" />
                                             </CustomAttributes>
                              </QualityLevel>
               </StreamIndex>
               <StreamIndex Chunks="0" Type="text" ParentStreamIndex="video" Url="QualityLevels({bitrate})/Fragments(simplesignal={start time})" ManifestOutput="TRUE" QualityLevels="1" Subtype="ADI3" Name="simplesignal" TimeScale="1000">
                              <QualityLevel Index="0" Bitrate="1" FourCC="" CodecPrivateData="" />
               </StreamIndex>
</SmoothStreamingMedia>

 

问题解答

以上Manifest中播放使用的流媒体传输协议为SmoothStreaming。它分为两部分内容,第一部分为视频内容(StreamIndex Chunks="34" Type="video" ),第二部分为音频内容(<StreamIndex Chunks="34" Type="audio")。

在次两部分内容中,除了指定视频/音频的比特率,分辨率,格式之外,还制定了视频/音频的开始时间。信息都包含在【 <c t="3151940" d="736961" r="2" n="0" />】中。

c : 表示分片,因为SmoothStreaming为分片传输,所以在Manifest中每一个 <c  t="" d="" />及表示流媒体的一段内容

t : 表示 (FragmentTime)分片开始的时间点,如以上内容表示当前分片从时间点3151940开始

d :  表示(FragmentDuration)分片的持续时间,如以上内容表明当前分片的长度为736961

r :  (还没有调查出)

n : 表示分片在流中的序号,随时间递增。当前为0,表示为第一个分片。

 

参考资料

这个Smooth Streaming protocol相关文档https://docs.microsoft.com/zh-cn/openspecs/windows_protocols/ms-sstr/8383f27f-7efe-4c60-832a-387274457251?redirectedfrom=MSDN ,这个c 是分片。N是分片在流中的序号,随时间递增,d是(FragmentDuration)分片的持续时间, t是(FragmentTime)分片(开始)时间(点)

 

其他相关参考链接:

https://docs.microsoft.com/en-us/previous-versions/iis/smooth-streaming-client/iis-smooth-streaming-client-manifest-format 

https://docs.microsoft.com/en-us/iis/extensions/smooth-streaming-client/manifest-merge 

 

posted @ 2021-04-17 18:29  路边两盏灯  阅读(104)  评论(0编辑  收藏  举报