Creating a DASH DRM Manifest for the Brightcove Player

In this topic, you will learn how to create an MPEG-DASH manifest (.MPD file) with DRM protection for Brightcove Player.

Overview

The MPEG-DASH manifest (.MPD file) describes a video with MPEG-DASH renditions encrypted using common encryption (CENC) and is compatible with Playready, Widevine, and Marlin content decryption modules (CDMs). Only Playready and Widevine are supported by Brightcove’s Web player, depending on which browser is used.

Browser support

Playback only works on supported desktop Macintosh and Windows browsers.

Browser types Playback technology DRM type
Chrome 34+ Native MSE/EME playback using Shaka-Player* Widevine
MS Edge on Windows 10 Native MSE/EME playback using Shaka-Player* Playready
All other browsers including Safari, IE, and Firefox Silverlight plugin Playready

External DRM content

Requirements for DRM content created outside Brightcove Video Cloud

In order to play video content with DRM protection applied using the Brightcove Player your video must be encoded following these guidelines.

  1. Must be MPEG-DASH Live Profile (not “on-demand”, not “hbbtv”)
  2. All renditions must have the same key frame interval and frame rate (for compatibility with our Silverlight plugin)
  3. Must be encrypted using common encryption (CENC) and have Playready and Widevine support enabled
  4. Playready and Widevine license server URLs must be provided. The Playready license server URL must be included in the manifest file (.mpd). The Widevine license server URL may be provided in the manifest or as a parameter in Javascript
  5. Playready initialization vector needs to be 8 bytes.

Sample manifest

Here is an example MPEG-DASH manifest (.MPD file) generated by Video Cloud.

<?xml version="1.0" ?>
<MPD mediaPresentationDuration="PT1M28S" minBufferTime="PT2.00S" profiles="urn:mpeg:dash:profile:isoff-live:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011" xmlns:mspr="urn:microsoft:playready" xmlns:mas="urn:marlin:mas:1-0:services:schemas:mpd">
   <Period>
      <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="5d97af80-2442-4fe9-b1aafc24ecb6fa28" xmlns:cenc="urn:mpeg:cenc:2013"/>
         <ContentProtection schemeIdUri="urn:uuid:5E629AF5-38DA-4063-8977-97FFBD9902D4">
            <mas:MarlinContentIds>
               <mas:MarlinContentId>urn:marlin:kid:5d97af8024424fe9b1aafc24ecb6fa28</mas:MarlinContentId>
            </mas:MarlinContentIds>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95">
            <mspr:pro>jAIAAAEAAQCCAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AZwBLACsAWABYAFUASQBrADYAVQArAHgAcQB2AHcAawA3AEwAYgA2AEsAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBVAGQAawBLAGIASQBBAHgAbgBOAGcAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAHIAbABpAGMALgBiAHIAaQBnAGgAdABjAG8AdgBlAC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC8AMwA3ADIAMwA0ADkANgAyADcANwAwADAAMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</mspr:pro>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>
         <SegmentTemplate duration="2000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="0" timescale="1000"/>
         <Representation bandwidth="43241" id="4324360320001/audio/und" codecs="mp4a.40.5" audioSamplingRate="22050">
            <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"/>
         </Representation>
      </AdaptationSet>
      <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" scanType="progressive">
         <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="5d97af80-2442-4fe9-b1aafc24ecb6fa28" xmlns:cenc="urn:mpeg:cenc:2013"/>
         <ContentProtection schemeIdUri="urn:uuid:5E629AF5-38DA-4063-8977-97FFBD9902D4">
            <mas:MarlinContentIds>
               <mas:MarlinContentId>urn:marlin:kid:5d97af8024424fe9b1aafc24ecb6fa28</mas:MarlinContentId>
            </mas:MarlinContentIds>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:79f0049a-4098-8642-ab92-e65be0885f95">
            <mspr:pro>jAIAAAEAAQCCAjwAVwBSAE0ASABFAEEARABFAFIAIAB4AG0AbABuAHMAPQAiAGgAdAB0AHAAOgAvAC8AcwBjAGgAZQBtAGEAcwAuAG0AaQBjAHIAbwBzAG8AZgB0AC4AYwBvAG0ALwBEAFIATQAvADIAMAAwADcALwAwADMALwBQAGwAYQB5AFIAZQBhAGQAeQBIAGUAYQBkAGUAcgAiACAAdgBlAHIAcwBpAG8AbgA9ACIANAAuADAALgAwAC4AMAAiAD4APABEAEEAVABBAD4APABQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsARQBZAEwARQBOAD4AMQA2ADwALwBLAEUAWQBMAEUATgA+ADwAQQBMAEcASQBEAD4AQQBFAFMAQwBUAFIAPAAvAEEATABHAEkARAA+ADwALwBQAFIATwBUAEUAQwBUAEkATgBGAE8APgA8AEsASQBEAD4AZwBLACsAWABYAFUASQBrADYAVQArAHgAcQB2AHcAawA3AEwAYgA2AEsAQQA9AD0APAAvAEsASQBEAD4APABDAEgARQBDAEsAUwBVAE0APgBVAGQAawBLAGIASQBBAHgAbgBOAGcAPQA8AC8AQwBIAEUAQwBLAFMAVQBNAD4APABMAEEAXwBVAFIATAA+AGgAdAB0AHAAcwA6AC8ALwBwAHIAbABpAGMALgBiAHIAaQBnAGgAdABjAG8AdgBlAC4AYwBvAG0ALwBsAGkAYwBlAG4AcwBlAC8AMwA3ADIAMwA0ADkANgAyADcANwAwADAAMQA8AC8ATABBAF8AVQBSAEwAPgA8AC8ARABBAFQAQQA+ADwALwBXAFIATQBIAEUAQQBEAEUAUgA+AA==</mspr:pro>
         </ContentProtection>
         <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>
         <SegmentTemplate duration="2000" initialization="$RepresentationID$/init.mp4" media="$RepresentationID$/seg-$Number$.m4f" startNumber="0" timescale="1000"/>
         <Representation bandwidth="237182" id="4324360320001/video/1" codecs="avc1.42c015" frameRate="30" width="400" height="300"/>
         <Representation bandwidth="601518" id="4324360321001/video/1" codecs="avc1.42c015" frameRate="30" width="400" height="300"/>
         <Representation bandwidth="981387" id="4324360323001/video/1" codecs="avc1.42c016" frameRate="30" width="480" height="360"/>
         <Representation bandwidth="1507704" id="4324360324001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
         <Representation bandwidth="2102387" id="4324360325001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
         <Representation bandwidth="2991373" id="4324360326001/video/1" codecs="avc1.42c01e" frameRate="30" width="640" height="480"/>
      </AdaptationSet>
   </Period>
</MPD>

License information

In order to create your own DASH-DRM stream that is compatible with the Brightcove Player your encoding system must create a similar manifest (MPD) to that provided above that includes information about the DRM license. Your MPD can omit the Marlin sections which are not used by the Brightcove Player today.

Specifying the PlayReady License Key

The Brightcove Player requires that the PlayReady license information be embedded in the MPD as a base-64 encoded string. You can see the value in this example in the <mspr:pro> tag above. The encoded key information is shown decoded below. Information on the format of the PlayReady header can be found here: http://www.microsoft.com/playready/documents/.

<WRMHEADER xmlns="http://schemas.microsoft.com/DRM/2007/03/PlayReadyHeader" version="4.0.0.0"><DATA><PROTECTINFO><KEYLEN>16</KEYLEN><ALGID>AESCTR</ALGID></PROTECTINFO><KID>gK+XXUIk6U+xqvwk7Lb6KA==</KID><CHECKSUM>UdkKbIAxnNg=</CHECKSUM><LA_URL>https://prlic.brightcove.com/license/3723496277001</LA_URL></DATA></WRMHEADER>

Specifying the Widevine License URL

Notice here that the Widevine license server URL is provided in the MPD in this line:

<ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" bc:licenseAcquisitionUrl="https://wvlic.brightcove.com/proxy/4324249227001" xmlns:bc="urn:brightcove:2015"/>

Alternatively you can provide the Widevine license server URL as a parameter to the player in JavaScript in the page where it is embedded. Here’s an example of how to call the Brightcove Player specifying a license server with the source URL:

myPlayer.src({
  "src": sourceUrl,
  "type": "application/dash+xml",
  "keySystemOptions": [{
    "name": "com.widevine.alpha",
    "options": {"licenseUrl": licenseServerUrl}
  }]
});

Preloading

There are a number of settings from which you can choose to control the preloading of video data. See the Player Configuration Guide, preload section for complete details. The default behavior is the Brightcove Player will preload the video metadata (for example title and duration), along with several seconds of video data. If you would like to change preload behavior, you can specify the following option in your player configuration:

"preload": "none"

Here’s an example of a player configuration with that setting:

{
  "account_id": "3723496277001",
  "autoadvance": 0,
  "embed_id": "default",
  "player": {
    "template": {
      "name": "single-video-template",
      "version": "1.14.26"
    }
  },
  "player_id": "82f443bc-82f5-4074-bf9c-de2920c89b24",
  "player_name": "DRM Demo",
  "preload": "none",
  "scripts": [
    "https://players.brightcove.net/videojs-dash/videojs-dash.min.js"
  ],
  "stylesheets": [
    "https://players.brightcove.net/videojs-dash/videojs-dash.css"
  ],
  "video_cloud": {
    "policy_key": "BCpkADawqM2ENcgyE-9...EFGSP8b5dC",
    "video": null
  }
}