[object Object] Icon

Encoding
Learn how to create, start, manage and modify Encodings

[object Object] Icon

Player
Learn how to create, start, manage and modify Players

[object Object] Icon

Analytics
Learn how to create, start, manage and modify Analyticss

Docs Home
User shortcuts for search
Focus by pressing f
Hide results by pressing Esc
Navigate via   keys

Thu Nov 14 2019

How to create combined Multi DRM protected content

OverviewLink Icon

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 RequirementsLink Icon

"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 exampleLink Icon

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 ConfigurationLink Icon

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)

1private static CencDrm createDrmConfig(
2 Encoding encoding, Muxing muxing, Output output, String outputPath) throws BitmovinException {
3 CencDrm cencDrm = new CencDrm();
4 cencDrm.addOutputsItem(buildEncodingOutput(output, outputPath));
5 cencDrm.setKey("cab5b529ae28d5cc5e3e7bc3fd4a544d");
6 cencDrm.setKid("08eecef4b026deec395234d94218273d");
7
8 CencWidevine widevineDrm = new CencWidevine();
9 widevineDrm.setPssh("QWRvYmVhc2Rmc2FkZmFzZg==");
10 cencDrm.setWidevine(widevineDrm);
11
12 CencPlayReady playReadyDrm = new CencPlayReady();
13 playReadyDrm.setLaUrl("http://playready.directtaps.net/pr/svc/rightsmanager.asmx");
14 //playReadyDrm.setPssh("QWRvYmVhc2Rmc2FkZmFzZg==");
15 cencDrm.setPlayReady(playReadyDrm);
16
17 CencFairPlay cencFairPlay = new CencFairPlay();
18 cencFairPlay.setIv("e7fada52ac654bbe80367505dceeb318");
19 cencFairPlay.setUri("skd://userspecifc?custom=information");
20 cencDrm.setFairPlay(cencFairPlay);
21
22 return bitmovinApi.encoding.encodings.muxings.fmp4.drm.cenc.create(
23 encoding.getId(), muxing.getId(), cencDrm);
24}

Get Started with a Bitmovin SDKLink Icon

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/Typescript Integrate 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

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

Give us feedback