Bitmovin
Bitmovin's video encoding solution is widely recognized for its scalability, speed, and support for a range of DRM systems, including Axinom DRM. By integrating Bitmovin with Axinom DRM, content providers can efficiently encode and protect premium content, ensuring secure delivery and playback across diverse devices and platforms.
This guide offers a walkthrough for configuring Bitmovin encoder with Axinom DRM to provide robust content protection. With support for major DRM technologies like Widevine, PlayReady, and FairPlay, this setup facilitates seamless delivery of encrypted content, enhancing both user experience and security. Whether you're looking to safeguard video assets or reach viewers on a variety of endpoints, this integration offers a streamlined approach to DRM-protected video encoding.
Prerequisites​
To use Axinom DRM:​
- Register on the Axinom Portal
- Start a free trial
- Go to My Mosaic / DRM and acquire credentials
- You will need the following information:
- Key Service Tenant ID (a UUID)
- Key Service Management Key (a UUID)
- SPEKE v1 endpoint URL (https://key-server-management.axprod.net/api/Speke)
- Once you are ready to go to production, upgrade your Axinom account to a paid plan.
For later playback you will also need:
- Communication Key ID
- Communication Key
To use Bitmovin Encoding:​
- You will need an account with encoding capabilities. Register on the Bitmovin Dashboard to create an account.
Configuration in Bitmovin​
This guide outlines the minimum setup required to start an encoding job, specifically to demonstrate how to configure Axinom DRM settings. For more advanced options, please refer to the Bitmovin documentation.
This documentation explains the configuration of Bitmovin Encoder with the Javascript SDK
- Import the Bitmovin API SDK into your environment and specify your API key.
const BitmovinApi = require('@bitmovin/api-sdk').default;
const bitmovinApi = new BitmovinApi({
apiKey: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
});
- Create an encoding.
const encoding = await bitmovinApi.encoding.encodings.create({
name: 'Encoding Example',
description: 'Encoding example to intgrate Axinom DRM',
cloudRegion: 'AUTO'
});
- Define Codec Configuration (e.g., H.264)
const h264Config = await bitmovinApi.encoding.configurations.video.h264.create({
name: 'H.264 Config',
width: 1920,
height: 1080,
bitrate: 4000000,
rate: 30.0,
profile: 'BASELINE'
});
- Define your input location. For this example we are going to use Azure.
const azureInput = await bitmovinApi.encoding.inputs.azure.create({
name: 'Azure Blob Storage Input',
container: 'input_container',
accountName: 'storage_account',
accountKey: 'your_account_key'
});
- Specify Input File Path in Azure.
const inputFilePath = '/path_to_your_source/sample.mp4';
- Create Input Stream
const inputStream = await bitmovinApi.encoding.encodings.streams.create(encoding.id, {
codecConfigId: h264Config.id,
inputStreams: [{ inputId: azureInput.id, inputPath: inputFilePath }],
selectionMode: 'AUTO'
});
- Define Azure Output
const azureOutput = await bitmovinApi.encoding.outputs.azure.create({
name: 'Azure Blob Storage Output',
container: 'container2',
accountName: 'storagenimasha',
accountKey: '5ZyFzUpFExAxWoTazwacSDYsbi5zK5SPOsgvBuaUVoAFqPQGrII4IRy6HkzOSYiUujyDApuO40RBenAKaeVLqQ=='
});
- Define Output Path for Encoded Files
const outputPath = '/path_to_your_output';
- Setup the muxing. For this example, we are only using fmp4 muxing.
const segmentLength = 4;
const segmentNaming = 'seg_%number%.m4s';
const initSegmentName = 'init.mp4';
const fmp4Muxing = await bitmovinApi.encoding.encodings.muxings.fmp4.create(encoding.id,
new Fmp4Muxing({
segmentLength: segmentLength,
segmentNaming: segmentNaming,
initSegmentName: initSegmentName,
streams: [new MuxingStream({ streamId: inputStream.id })]
})
);
- SPEKE request creation.
In this step, you’ll configure the settings needed to retrieve a Key ID from the Axinom Key Service. Refer to the axinom-drm-configuration.pdf
file for the required values for the fields below.
- key_server_url: The key server URL to enter is https://key-server-management.axprod.net/api/Speke.
As of November 2024, Bitmovin Encoder does not currently support SPEKE v2. Hence use the SPEKE v1 endpoint.
- username: Your tenant ID.
- password: Your Key service Management key.
const spekeBody = await bitmovinApi.encoding.encodings.muxings.fmp4.drm.speke.create(
encoding.id,
fmp4Muxing.id,
new SpekeDrm({
provider: new SpekeDrmProvider({
url: "key_server_url",
username:"username",
password:"password"
}),
systemIds: ["array_of_system_Ids"],
outputs: [
new EncodingOutput({
outputId: azureOutput.id,
outputPath: outputPath + 'cenc',
acl: [
new AclEntry({
permission: AclPermission.PUBLIC_READ
})
]
})
],
contentId: "your_content_id"
})
);
- Create a Dash Manifest. For this example we only consider creating a DASH manifest. You can refer to Bitmovin documentation for further details.
const manifestOutput = new EncodingOutput({
outputId: azureOutput.id,
outputPath: outputPath,
acl: [
new AclEntry({
permission: AclPermission.PUBLIC_READ,
scope: '*'
})
]
});
let dashManifest = new DashManifestDefault({
manifestName: 'stream.mpd',
encodingId: encoding.id,
version: DashManifestDefaultVersion.V2,
outputs: [manifestOutput]
});
dashManifest = await bitmovinApi.encoding.manifests.dash.default.create(dashManifest);
- Start the Encoding Process
const startEncodingRequest = new StartEncodingRequest({
manifestGenerator: ManifestGenerator.V2,
vodDashManifests: [
new ManifestResource({ manifestId: dashManifest.id })
]
});
await bitmovinApi.encoding.encodings.start(encoding.id, startEncodingRequest);
Testing Playback​
Once you have produced a DRM-protected video or stream, you can test the playback using Axinom’s DRM Video Playback tool. Hints for filling out the form:
-
Video Source URL: the URL of the generated manifest file, e.g.,
https://your-server/manifest.mpd
-
Content Keys: the Key ID (CPIX KID) you have generated and used in the encoding process. You don’t need to specify the key value (you don’t even have it).
Since Bitmovin encoder consider Key ID as an internal detail, they do not expose it to the users. There are few ways that you can get the Key ID:
- Extract the Key ID from the manifest.
- Use SPEKE Key ID Override
- Set up a proxy between the packager and the key service. Refer to Proxy implementation document for more details.
-
Communication Key and Communication Key ID: The values you received from Axinom DRM configuration (see the prerequisites above)
-
License Service: keep defaults (or enter the value you received from Axinom DRM configuration)
-
Player: pick any