How to create combined Multi DRM protected content

Overview

The Bitmovin API and player allows you to use multiple DRMs in parallel. This means that you encode, encrypt and package your content once and you can playback with several different DRMs, such as Widevine, PlayReady, PrimeTime, etc. This is especially important if you want to increase your device reach.

Due to fragmentation in the market it is not possible to reach all major devices with just one DRM. Therefore, you need to use multiple in parallel, which is possible as all DRM systems use AES for encryption. If you use the same key in the different DRM systems for the same video you just need to add additional metadata for each DRM to this video and then it can be played back by with DRM systems. In detail it’s a little bit more complex as this needs additional logic on the encoding as well as on the player side, but Bitmovin provides you with solutions for both.

What you also need for such a setup is a 3rd party multi DRM provider such as Irdeto, EZDRM, ExpressPlay, Axinom, etc. It’s also possible to create your own licensing backend if you have a contract with Google (Widevine), Microsoft (PlayReady), Adobe (PrimeTime) or Apple (Fairplay) directly and you implement the specification.

Combined DRM Requirements

"combined DRM" means that you only have to encode your content once, but you can use with different DRM solutions. MPEG-CENC is an encryption standard that is independent from DRM providers and allows the decryption of the same media file (encoded and encrypted once) using multiple DRM systems (Widevine, PlayReady, etc.) to support various client devices.

FairPlay DRM does not support it at the moment, as it encrypts its content differently, so you have to encode your content again with the encryption method that is supported by the DRM solution.

About this example

The code snippets shown here are based on the full example called CencDrmContentProtection.java, using our Bitmovin SDK for Java.

Hint: If you haven't created any encodings with our Service yet, its recommended to start with our quick start guide called "Get Started with the Bitmovin API" first, before you continue :)

Encoding with DRM Configuration

The key part to create an encoding that encodes and encrypt content with DRM solutions that support MPEG-CENC, is to add a CencDRM Configuration to a Muxing.

To encrypt your content so it can be used with Widevine DRM, an encryption key (referred to as key later on) is required. All other values are optional, however sometimes required by specific DRM vendors, therefore have to be set (kid, pssh, ...).

General configuration values:

  • key: (required) You need to provide a key that will be used to encrypt the content (16 byte encryption key, represented as 32 hexadecimal characters)
  • kid: (optional) also known as Key ID, or ContentID. Its a unique identifer for your content (16 byte initialization vector, represented as 32 hexadecimal characters)

HINT: Some DRM providers provide you with a dedicated service to create and safely store Encryption Keys, so you don't have to create and manage them by yourself. These values, along with the Apple certificate, are required to generate a proper playback license using DRM solution providers like Irdeto, EZDRM, ExpressPlay, Axinom, etc. to control playback permissions on the client side. Learn more.

Widevine DRM specific configuration options:

  • pssh: Base64 encoded String, PSSH payload Example: QWRvYmVhc2Rmc2FkZmFzZg==

PlayReady DRM specific configuration options: You can either provide an pssh string or an laUrl in this configuration.

  • pssh: (optional)Base64 encoded String, PSSH payload Example: QWRvYmVhc2Rmc2FkZmFzZg==
  • laUrl: (optional) The License Aquistion URL that shall be used by the player.

FairPlay DRM specific configuration options:

  • iv: The initialization vector is optional. If it is not provided we will generate one for you. (16 byte initialization vector, represented as 32 hexadecimal characters)
  • uri: If provided, this URI will be used for license acquisition, (e.g. skd://userspecifc?custom=information)

Java SDK Example - createDrmConfig() Method (Line in Example)

private static CencDrm createDrmConfig(
    Encoding encoding, Muxing muxing, Output output, String outputPath) throws BitmovinException {
  CencDrm cencDrm = new CencDrm();
  cencDrm.addOutputsItem(buildEncodingOutput(output, outputPath));
  cencDrm.setKey("cab5b529ae28d5cc5e3e7bc3fd4a544d");
  cencDrm.setKid("08eecef4b026deec395234d94218273d");
  
  CencWidevine widevineDrm = new CencWidevine();
  widevineDrm.setPssh("QWRvYmVhc2Rmc2FkZmFzZg==");
  cencDrm.setWidevine(widevineDrm);
  
  CencPlayReady playReadyDrm = new CencPlayReady();
  playReadyDrm.setLaUrl("http://playready.directtaps.net/pr/svc/rightsmanager.asmx");
  //playReadyDrm.setPssh("QWRvYmVhc2Rmc2FkZmFzZg==");
  cencDrm.setPlayReady(playReadyDrm);
  
  CencFairPlay cencFairPlay = new CencFairPlay();
  cencFairPlay.setIv("e7fada52ac654bbe80367505dceeb318");
  cencFairPlay.setUri("skd://userspecifc?custom=information");
  cencDrm.setFairPlay(cencFairPlay);
  
  return bitmovinApi.encoding.encodings.muxings.fmp4.drm.cenc.create(
      encoding.getId(), muxing.getId(), cencDrm);
}

Get Started with a Bitmovin SDK

Bitmovin API SDKDescription
JavaIntegrate the SDK into your Java Project easily and add it to the config of your dependency manager like Maven or Gradle. Learn more
Javascript/TypescriptIntegrate the SDK into your Javascript/Typescript based project easily by adding it as a dependency via NPM. Learn more
PythonIntegrate the SDK into your Python based project easily by adding it as a dependency via pip or Setuptools. Learn more
.NETIntegrate the SDK into your .NET based project easily by adding it as a dependency via nuget. Learn more
PHPIntegrate the SDK into your PHP based project easily by adding it as a dependency via composer. Learn more

Visit our Github Example Repository that provides you with examples for all Bitmovin SDK's available.