Integrate Axinom Multi-DRM with Bitmovin

Written by:
September 12th, 2016

Multi DRM with Axinom and Bitmovin

The following tutorial will show you how to use Axinom DRM together with the Bitmovin Cloud Encoding system to create a video distribution platform, ready to target multiple devices and browsers.

By following this tutorial and using the supporting links that you will find below, you can create a video on demand service with the same speed and quality as Netflix. Axinom provides, as part of Axinom DRM a License Server product that supports multiple DRM technologies. The current DRM technologies supported by Axinom DRM are Microsoft PlayReady, Widevine Modular and Apple FairPlay Streaming. In this blog post we give a high-level overview of integrating Axinom Multi DRM with Bitmovin.

Request your evaluation account today at https://drm.axinom.com/evaluation-account/ and receive one month of free evaluation along with a fact sheet and full documentation of Axinom DRM.

Encode and DRM-Protect Content with Bitmovin

In order to produce DRM-protected content the Bitmovin Cloud Encoding API is used. The easiest way to get started is to use one of our API clients.

Create an Encoding Job with a PlayReady Config

Let’s look at the example using the PHP API client. The important part here is to use the PlayReadyDRMConfig object. For testing you can also use the data provided in our example below:

$playreadyDRMConfig = new PlayReadyDRMConfig();
$playreadyDRMConfig->keySeed = 'KEY_SEED';
$playreadyDRMConfig->kid = '7459975db2f848eda32556e4f34d19c7';
$playreadyDRMConfig->laUrl = 'https://drm-playready-licensing.axtest.net/AcquireLicense';
$playreadyDRMConfig->method =  DRMEncryptionMethods::MPEG_CENC;

$jobConfig = new JobConfig();
...
$jobConfig->drmConfig = $playreadyDRMConfig;
$job = Job::create($jobConfig);

The parameters of the PlayReady configuration have the following meaning:

  • keySeed: The Key Seed to be used to generate the Content Key based on the Content Key ID. Use the Key Seed provided to you in your Axinom DRM account fact sheet.
  • kid: The content key ID in hex format.
  • laUrl: Axinom DRM testing environment’s PlayReady license acquisition URL.
  • method: Currently we support MPEG-CENC.

Create an Encoding Job with a Widevine Config

Let’s look at the example using the PHP API client. The important part here is to set the WidevineDRMConfig object providing your Widevine data.

$widevineDRMConfig = new WidevineDRMConfig();
$widevineDRMConfig->provider = 'SIGNER';
$widevineDRMConfig->signingKey = 'SIGNING_KEY';
$widevineDRMConfig->signingIV = 'SIGNING_IV';
$widevineDRMConfig->requestUrl = 'https://keyserver.axtest.net/api/GetContentKey';
$widevineDRMConfig->contentId = '7459975d-b2f8-48ed-a325-56e4f34d19c7';
$widevineDRMConfig->method = DRMEncryptionMethods::MPEG_CENC;

$jobConfig = new JobConfig();
...
$jobConfig->drmConfig = $widevineDRMConfig;
$job = Job::create($jobConfig);

The parameters of the Widevine configuration have the following meaning:

  • provider: The name of the identity that signs the Widevine request. Use the name provided to you in your Axinom DRM account fact sheet.
  • signingKey: The key to be used to sign the Widevine request. Use the key provided to you in your Axinom DRM account fact sheet.
  • signingIV: The IV to be used to sign the Widevine request. Use the IV provided to you in your Axinom DRM account fact sheet.
  • requestUrl: The URL of the Axinom Widevine Key Server’s GetContentKey API function.
  • contentId: The ID of a Content Key to be requested.
  • method: Currently we support MPEG-CENC.

Axinom offers as part of Axinom DRM the Axinom Widevine Key Server which implements Google’s Common Encryption API for Widevine DRM. Additionally, the Axinom Widevine Key Server adds support for other DRM systems as well. See the Axinom DRM documentation provided to you after signup for more details.

Create an Encoding Job with a Multi DRM Config

It is also possible to encrypt your content to be played by multiple DRM systems, in this case PlayReady and Widevine clients. You need to get a common content encryption key and key identifier from both systems. With these values you can encrypt the content as follows:

$combinedWidevinePlayreadyDRMConfig = new CombinedWidevinePlayreadyDRMConfig();
$combinedWidevinePlayreadyDRMConfig->pssh = 'CAESEAs1DAhLy0uWqHOMJPbpkcUaDXdpZGV2aW5lX3Rlc3QiJDBCMzUwQzA4LTRCQ0ItNEI5Ni1BODczLThDMjRGNkU5OTFDNSoCSEQ=';
$combinedWidevinePlayreadyDRMConfig->key = 'CONTENT_KEY';
$combinedWidevinePlayreadyDRMConfig->kid = '7459975db2f848eda32556e4f34d19c7';
$combinedWidevinePlayreadyDRMConfig->laUrl = 'https://drm-playready- licensing.axtest.net/AcquireLicense';
$combinedWidevinePlayreadyDRMConfig->method =  DRMEncryptionMethods::MPEG_CENC;

$jobConfig = new JobConfig();
...
$jobConfig->drmConfig = $combinedWidevinePlayreadyDRMConfig;
$job = Job::create($jobConfig);

The parameters of the combined configuration have the following meaning:

  • key: This is the common content encryption key in hex format.
  • kid: This is the common content key ID in hex format.
  • laUrl: Axinom DRM testing environment’s PlayReady license acquisition URL.
  • pssh: The Widevine pssh box that can be obtained using the Axinom Widevine Key Server.
  • method: Currently we only support MPEG-CENC.

Create an Axinom DRM Entitlement Message and an Axinom DRM License Token

Axinom DRM Entitlement Message is an Axinom DRM specific message to authorize and instruct the Axinom DRM License Server to generate a license. Axinom DRM Entitlement Message is represented as a JSON data structure. It shall be delivered to the Axinom DRM License Server along with a license request as a signed JSON Web Token, henceforth referred to as Axinom DRM License Token, in the X-AxDRM- Message HTTP header.

The following is a sample Axinom DRM Entitlement Message.

{
    "version": 1,
    "com_key_id": "69e54088-e9e0- 4530-8c1a- 1eb6dcd0d14e",
    "message": {
        "type": "entitlement_message",
        "keys": [
            {
                "id": "7459975d-b2f8- 48ed-a325- 56e4f34d19c7"
            }
        ]
    }
}
  • com_key_id: The ID of the Communication Key that is used for signing when encoding the message into an Axinom DRM License Token.
  • keys[0].id: The ID of the Content Key to be included in the license.

The following is a sample Axinom DRM Entitlement Message encoded into an Axinom DRM License Token.

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNzQ1OTk3NWQtYjJmOC00OGVkLWEzMjUtNTZlNGYzNGQxOWM3In1dfX0.2wf-pgc-TcSMCuIT6nCCk3nOw8S-fd_S0K8GkskfOrU

Note: A customer of Axinom DRM will typically implement an authorization backend to serve Axinom DRM License Tokens to player applications. See the Axinom DRM documentation for recommended workflows.

Setup the Bitmovin Player to Work with Axinom DRM

In order for the Bitmovin Adaptive Streaming HTML5 Player to request DRM licenses from the Axinom DRM License Server the player must be configured accordingly. The Axinom DRM License Server’s license acquisition URLs for desired DRM systems must be specified. Additionally, the configuration must instruct the player to include Axinom DRM License Tokens in the X-AxDRM- Message HTTP header for license requests.

Axinom DRM License Server License Acquisition URLs

  • PlayReady: http://drm-playready-licensing.axtest.net/AcquireLicense
  • Widevine: http://drm-widevine-licensing.axtest.net/AcquireLicense

Note: Both HTTP and HTTPS can be used.

Configuring the Bitmovin Adaptive Streaming HTML5 Player

Add sample config that specifies Axinom DRM License Server’s PlayReady and Widevine license acquisition URLs. For both DRMs the player configuration instructs the player to include an Axinom DRM License Token in the X-AxDRM- Message HTTP header for license requests. The Axinom DRM License Token must be the same token acquired as described in “Create an Axinom DRM Entitlement Message”.

var conf = {
  ...
  source: {
          hls: 'https://yourserver/manifests/stream.m3u8',
          dash: 'https://yourserver/manifests/stream.mpd',
          drm: {
            widevine: {
                LA_URL: 'https://drm-widevine-licensing.axtest.net/AcquireLicense',
                headers: [{
                  name: 'X-AxDRM-Message',
                  value: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNzQ1OTk3NWQtYjJmOC00OGVkLWEzMjUtNTZlNGYzNGQxOWM3In1dfX0.2wf-pgc-TcSMCuIT6nCCk3nOw8S-fd_S0K8GkskfOrU'
                }]
            },
            playready: {
                LA_URL: 'https://drm-playready-licensing.axtest.net/AcquireLicense',
                headers: [{
                  name: 'X-AxDRM-Message',
                  value: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiNjllNTQwODgtZTllMC00NTMwLThjMWEtMWViNmRjZDBkMTRlIiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiNzQ1OTk3NWQtYjJmOC00OGVkLWEzMjUtNTZlNGYzNGQxOWM3In1dfX0.2wf-pgc-TcSMCuIT6nCCk3nOw8S-fd_S0K8GkskfOrU'
                }]
            }
        }
     }
};

The Bitmovin Player API is well documented and perfectly equipped to deal with Multi DRM integrations. You can find more information on how to configure it in our support section under Player Documentation.

Simple Share Buttons