标签:
目前ABR(adaptive bitrate 自适应码率技术)是一种主流的视频播放格式,HLS,HSS和HDS运用得比较广泛。多屏视频播放也是一个趋势,包括手机,平板,电脑,电视机,机顶盒等融合在一起,不同的场合不同的网络情况,可能会选择不同的设备去播放视频。
在视频solution的测试中,我们的系统一般的终端播放格式就包含了HLS,HSS,HDS,会根据不同的device去选择不同的播放格式,比如iPhone会选择HLS,PC会选择HSS等。对于不加密的HLS,HSS,HDS都有player来播放,HLS用iPhone,Mac上的safari就可以播放,或者是quicktime,HSS则可以选择silverlight的插件进行播放,HDS是用comcast lab做的一个插件。而对于加密的HLS,HSS,HDS,加密的系统多种多样,测试过的有comcast的CKM,verimatrix,VG,Insys,Irdeto,Playready等,大多数时候没有player来测试。这时workaround就是按照下面的流程来测试,比如HSS 的manifest 文件中,如果进行了DRM加密后,需要check 是否有ProtectionHeader 的字段,可以看到下面用Insys DRM加密后有一大段Key的info。
1. wget (curl) HSS manifest.
2. check HSS manifest include key info.
3. check DRM system related logs and make sure key is create successfully.
4. check our system related logs.
5. wget ts segment and compared with no-DRM segment.
HSS with Insys DRM
<?xml version="1.0"?> <SmoothStreamingMedia MajorVersion="2" MinorVersion="2" CanPause="true" CanSeek="true" Duration="1360000000" Timescale="10000000"> <Protection> <ProtectionHeader SystemID="{9A04F079-9840-4286-AB92-E65BE0885F95}">2gIAAAEAAQDQAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AWABlADQAaQBQADQAZwBkAE8AVQArAEEAbABUAEkAcwBWAHMAOABhAFcAUQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgA2ADMAMQBqADcAeQB2AHcALwBuAE0APQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAOgAvAC8AcAByAC0AcwB0AGEAZwBlAC4AZAByAG0ALgBpAG4AcwB5AHMAYwBkAC4AbgBlAHQALwByAGkAZwBoAHQAcwBtAGEAbgBhAGcAZQByAC4AYQBzAG0AeAA8AC8ATABBAF8AVQBSAEwAPgA8AEQAUwBfAEkARAA+AEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAQQBBAEEAPQA9ADwALwBEAFMAXwBJAEQAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA== </ProtectionHeader> </Protection> <StreamIndex Type="text" Name="cc_frag_eng_" Language="eng_" SubType="CAPT" Chunks="69" Timescale="10000000" Url="QualityLevels({bitrate})/Fragments(cc_frag_eng_={start time})"> <QualityLevel Index="0" Bitrate="1308347" FourCC="TTML"/> <QualityLevel Index="1" Bitrate="1004888" FourCC="TTML"/> <QualityLevel Index="2" Bitrate="1814104" FourCC="TTML"/> <QualityLevel Index="3" Bitrate="3668563" FourCC="TTML"/> <QualityLevel Index="4" Bitrate="7040300" FourCC="TTML"/> <c t="20020000" d="20020000"/> <c t="40040000" d="20020000"/> <c t="60060000" d="20020000"/>
HSS with no DRM
<?xml version="1.0"?> <SmoothStreamingMedia MajorVersion="2" MinorVersion="2" CanPause="true" CanSeek="true" Duration="1360000000" Timescale="10000000"> <StreamIndex Type="text" Name="cc_frag_eng_" Language="eng_" SubType="CAPT" Chunks="69" Timescale="10000000" Url="QualityLevels({bitrate})/Fragments(cc_frag_eng_={start time})"> <QualityLevel Index="0" Bitrate="1308347" FourCC="TTML"/> <QualityLevel Index="1" Bitrate="1004888" FourCC="TTML"/> <QualityLevel Index="2" Bitrate="1814104" FourCC="TTML"/> <QualityLevel Index="3" Bitrate="3668563" FourCC="TTML"/> <QualityLevel Index="4" Bitrate="7040300" FourCC="TTML"/> <c t="20020000" d="20020000"/> <c t="40040000" d="20020000"/> <c t="60060000" d="20020000"/> <c t="80080000" d="20020000"/> <c t="100100000" d="20020000"/> <c t="120120000" d="20020000"/> <c t="140140000" d="20020000"/> <c t="160160000" d="20020000"/> <c t="180180000" d="20020000"/> <c t="200200000" d="20020000"/> <c t="220220000" d="20020000"/> <c t="240240000" d="20020000"/> <c t="260260000" d="20020000"/> <c t="280280000" d="20020000"/> <c t="300300000" d="20020000"/> <c t="320320000" d="20020000"/> <c t="340340000" d="20020000"/>
HLS master m3u8 会包含几种bitrate的信息,而每一种sub bitrate m3u8则包含没个ts segment的信息。如果是加密带有DRM信息的HLS 文件,master m3u8不含有Key和license的信息,而每一种sub bitrate m3u8则会含有key的信息。今天在项目的系统中调试了Verimatrix, VG DRM这两种DRM,下面可以看看key的部分还是有不同的。
HLS sub m3u8 manifest with Verimatrix DRM
#EXTM3U #EXT-X-TARGETDURATION:11 #EXT-X-VERSION:4 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-KEY:METHOD=AES-128,URI="http://127.0.0.1:8260/hls/client/keyfile/vod003" #EXTINF:10.01, 1308347/30960.ts #EXTINF:10.01, 1308347/931860.ts #EXTINF:10.01, 1308347/1832760.ts #EXTINF:10.01, 1308347/2733660.ts #EXTINF:10.01, 1308347/3634560.ts #EXTINF:10.01, 1308347/4535460.ts #EXTINF:10.01, 1308347/5436360.ts #EXTINF:10.01, 1308347/6337260.ts #EXTINF:10.01, 1308347/7238160.ts #EXTINF:10.01, "1308347.m3u8.2" 33L, 634C
HLS sub m3u8 manifest with VG DRM
#EXTM3U #EXT-X-TARGETDURATION:11 #EXT-X-VERSION:4 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXT-X-KEY:METHOD=AES-128,URI="8170110000080C0D9277D62C121EF1A2763B6E00", IV=0xB7295D642E8F4A65316B8221CB4654A0 #EXTINF:10.01, 1308347/30960.ts #EXTINF:10.01, 1308347/931860.ts #EXTINF:10.01, 1308347/1832760.ts #EXTINF:10.01, 1308347/2733660.ts #EXTINF:10.01, 1308347/3634560.ts #EXTINF:10.01, 1308347/4535460.ts #EXTINF:10.01, 1308347/5436360.ts #EXTINF:10.01, 1308347/6337260.ts #EXTINF:10.01,
HLS sub m3u8 manifest with no DRM
#EXTM3U #EXT-X-TARGETDURATION:11 #EXT-X-VERSION:4 #EXT-X-MEDIA-SEQUENCE:0 #EXT-X-PLAYLIST-TYPE:VOD #EXTINF:10.01, 1308347/30960.ts #EXTINF:10.01, 1308347/931860.ts #EXTINF:10.01, 1308347/1832760.ts #EXTINF:10.01, 1308347/2733660.ts #EXTINF:10.01, 1308347/3634560.ts #EXTINF:10.01, 1308347/4535460.ts #EXTINF:10.01, 1308347/5436360.ts #EXTINF:10.01, 1308347/6337260.ts #EXTINF:10.01,
标签:
原文地址:http://www.cnblogs.com/yatingyang/p/4347675.html