首先,为了编码我的视频(240p、720p、2k),我正在使用MP4Box -crypt L1/crypt.xml output_240.mp4 -out output_240_encrypted.mp4
crypt.xml
<?xml version="1.0" encoding="UTF-8" ?>
<GPACDRM type="CENC AES-CTR">
<DRMInfo type="pssh" version="0">
<BS ID128="EDEF8BA979D64ACEA3C827DCD51D21ED"/>
<BS value="1" bits="32"/>
<BS ID128="0x279926496a7f5d25da69f2b3b2799a7f"/>
</DRMInfo>
<CrypTrack first_IV="0x986F2358300DECB2FDBDF0BA1095F779">
<key KID="0x279926496a7f5d25da69f2b3b2799a7f" value="0x3362e6a4b9a74bae56d7d52cc4d69973"/>
</CrypTrack>
</GPACDRM>
当所有视频都加密后,我正在制作清单文件MP4Box -dash 3000 -rap -pssh=m -profile live -out L1/ecdn/manifest.mpd output_240_encrypted.mp4#video output_720_encrypted.mp4#video output_2k_encrypted.mp4#video
清单.mpd
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 1.0.1-rev0-gd8538e8a-master at 2021-03-13T16:52:22.319Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.500S" type="static" mediaPresentationDuration="PT0H0M27.366S" maxSegmentDuration="PT0H0M3.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011" xmlns:cenc="urn:mpeg:cenc:2013">
<ProgramInformation moreInformationURL="http://gpac.io">
<Title>manifest.mpd generated by GPAC</Title>
</ProgramInformation>
<Period duration="PT0H0M27.366S">
<AdaptationSet segmentAlignment="true" maxWidth="3840" maxHeight="2160" maxFrameRate="30" par="16:9" lang="und" startWithSAP="1">
<ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="27992649-6a7f-5d25-da69-f2b3b2799a7f"/>
<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
<cenc:pssh>AAAANHBzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAABQAAAABJ5kmSWp/XSXaafKzsnmafw==</cenc:pssh>
</ContentProtection>
<Representation id="1" mimeType="video/mp4" codecs="avc1.4D4015" width="424" height="240" frameRate="30" sar="160:159" bandwidth="556592">
<SegmentTemplate media="output_240_encrypted_dash$Number$.m4s" initialization="output_240_encrypted_dashinit.mp4" timescale="30000" startNumber="1" duration="90000"/>
</Representation>
<Representation id="2" mimeType="video/mp4" codecs="avc1.4D401F" width="1280" height="720" frameRate="30" sar="1:1" bandwidth="2434464">
<SegmentTemplate media="output_720_encrypted_dash$Number$.m4s" initialization="output_720_encrypted_dashinit.mp4" timescale="30000" startNumber="1" duration="90000"/>
</Representation>
<Representation id="3" mimeType="video/mp4" codecs="avc1.4D4033" width="3840" height="2160" frameRate="30" sar="1:1" bandwidth="19269424">
<SegmentTemplate media="output_2k_encrypted_dash$Number$.m4s" initialization="output_2k_encrypted_dashinit.mp4" timescale="30000" startNumber="1" duration="90000"/>
</Representation>
</AdaptationSet>
</Period>
</MPD>
但是,清单包含一个 PSSH,我的 Dash.js 播放器和一些在线 Pssh-box 解析器认为该 PSSH 无效。我做错了什么?
PS 我正在尝试对视频进行编码,以便我可以在我的播放器中使用 Axinom 许可服务器。