Bitmovin Encoder Integration Guide

Overview

When using Bitmovin encoding service, multi DRM packaging is possible through CPIX or SPEKE API integration with PallyCon KMS(Key Management Server).

This document explains how to create DASH/HLS content with multi-DRM using examples written based on the Bitmovin Java SDK.

Requirements

  • Commercial account of Bitmovin Encoding service: permission required for DRM API
  • Use of Bitmovin Encoding Java SDK
  • PallyCon Multi DRM service account: trial or commercial

If you want to integrate Bitmovin encoding service in language other than Java, refer to Java example code below and use Bitmovin SPEKE API in the relevant language.

Sample Download

You can download the Bitmovin encoding integration example (Java version) by clicking the following button.

Download Sample

DRM Packaging Process

Using Bitmovin SPEKE API

If you use the SPEKE API supported by the Bitmovin encoder, DRM packaging is possible with a simple setup because the API integration with PallyCon KMS server is handled inside the Bitmovin encoder. However, the current Bitmovin encoder only supports the SPEKE API v1 specification, so multi-key packaging (supported by SPEKE v2) cannot be applied.

sequenceDiagram
    participant A as Content Service Site
    participant B as Bitmovin Encoding
    participant C as PallyCon KMS
    A -->> A: Configure packaging job (source content and output storage)
	A ->> B: Create DRM packaging job using SpekeDrm object (with KMS URL and Content ID)
	B ->> C: Request Key and Kid to PallyCon KMS via SPEKE API
	C -->> C: Generate and store Key/Kid for the CID
	C ->> B: Respond Key and Kid
    B -->> B: Package DASH or HLS content with DRM encryption
    B ->> A: Store the result in the output storage

Using PallyCon CPIX API

In case of CPIX API, the API communication with PallyCon KMS server is processed outside the Bitmovin encoder, and the results (KEY, KID, etc.) are input to the Bitmovin encoder to proceed with DRM packaging. If you use the PallyCon CPIX module of the Java version sample linked in this document, you don’t need to implement CPIX API request. If you use other programming languages, you need to implement the functions yourself by referring to Java samples and PallyCon CPIX API specifications.

sequenceDiagram
    participant A as Content Service Site
    participant B as Bitmovin Encoding
    participant C as PallyCon KMS
    A -->> A: Configure packaging job (source content and output storage)
	A ->> C: Request Key and Kid (Key ID) via PallyCon CPIX module (with content ID)
	C -->> C: Generate and store Key/Kid for the CID
	C ->> A: Respond Key and Kid 
    A ->> B: Create DRM packaging job using CencDrm object (with Key and Kid)
    B -->> B: Package DASH or HLS content with DRM encryption
    B ->> A: Store the result in the output storage

Configurations by Integration Types

Type 1 - Using Bitmovin SPEKE API

This type of integration uses Bitmovin encoder’s SPEKE API instead of PallyCon CPIX module. This type is recommended unless multi-key support is required.

Fist add the below items to the environment configuration of Bitmovin.

//required
PALLYCON_KMS_URL=https://kms.pallycon.com/cpix/getKey?enc-token=
//required
PALLYCON_ENC_TOKEN= {{KMS token shown in PallyCon Console site}}
//required
CONTENT_ID= {{ unique ID of your content for the packaging }}
// FairPlay Required
DRM_FAIRPLAY_IV = {{ IV defined by PallyCon. Please contact us for it. }}

Configure the integration using the below functions in the sample source. (CencDrmContentProtectionByPallyCon.java) For languages other than Java, please refer to the Bitmovin Encoder SDK and Bitmovin-side guides and samples implemented in that language.

  • For DASH Widevine DRM: createDrmConfigSpekeDash function
  • For HLS FairPlay DRM: createDrmConfigSpekeHls function

Type 2 - Using PallyCon CPIX Module

This type of integration uses a Java library implemented with PallyCon CPIX specification.

First add the below items to the environment configuration of Bitmovin.

//required
PALLYCON_ENC_TOKEN= {{KMS token shown on PallyCon Console site}}
//required
PALLYCON_LICENSE_URL=https://license-global.pallycon.com/ri/licenseManager.do
//required
CONTENT_ID= {{ unique ID of your content for the packaging }}

Configure the integration using the below functions in the sample source.

  • For DASH Widevine DRM: createDrmConfigCencDash function
  • For HLS FairPlay DRM: createDrmConfigFairPlay function

How to Run The Sample

Linux

Execute run_example.sh with the name of the java source file(src/main/java) as first parameter, followed by a list of configuration parameters if needed.

run-example.sh CencDrmContentProtectionByPallyCon BITMOVIN_API_KEY=your-api-key HTTP_INPUT_HOST=my-storage.biz

Windows

Execute run_example.bat with the name of the java source file as first parameter, followed by a list of configuration parameters if needed.

run-example.bat CencDrmContentProtectionByPallyCon BITMOVIN_API_KEY=your-api-key HTTP_INPUT_HOST=my-storage.biz
Previous
Next