Skip to main content

DRM Configuration

For DRM, a new section is added and the sink is modified to include the DRM provider ID.

toml
[[drm_provider]]
type = "cpix" # or "static"
provider = "YOUR_DRM_PROVIDER"
id = "82a214dd-815d-4247-aeed-24c9ef63dad0"
key = "YOUR_DRM_KEY"
# ... DRM provider specific options
playready_license_url = "YOUR_PLAYREADY_LICENSE_URL"
widevine_license_url = "YOUR_WIDEVINE_LICENSE_URL"
fairplay_license_url = "YOUR_FAIRPLAY_LICENSE_URL"
fairplay_certificate = "YOUR_FAIRPLAY_CERTIFICATE"

#... sources
#... transcoders

[[sinks]]
#... regular sink options
drm_provider_id = "82a214dd-815d-4247-aeed-24c9ef63dad0" # id of [[drm_provider]]

The DRM provider section contains options specific to the selected provider.

The examples below use the moq sink. Set YOUR_MOQ_PUBLISH_URL to the MoQ publish/lookup URL supplied for your channel; transport_mode = "lookup" selects the transport from the resolved URL. Set YOUR_CHANNEL_ID to the channel identifier supplied with that endpoint. The vindral_ws sink does not support DRM.

Irdeto Example​

Below is an example of RTMP -> MoQ with DRM provider Irdeto encoded content.

Replace the input and publishing settings, YOUR_DRM_TOKEN, YOUR_CONTENT_ID, YOUR_CPIX_URL and the license URL placeholders with values supplied for your Irdeto account. Configure the FairPlay certificate when required by your playback setup.

Download drm-1.toml.

toml
# Vindral Bridge Packager example
# RTMP to Vindral Live over MoQ, encrypted with Irdeto DRM.

version = "3"

[[drm_provider]]
type = "cpix"
provider = "irdeto"
scheme = "cbcs"
token = "YOUR_DRM_TOKEN"
# For Irdeto, the token is user:password for your TKM account, supplied by Irdeto.
id = "82a214dd-815d-4247-aeed-24c9ef63dad0"
content_id = "YOUR_CONTENT_ID"

# Use the CPIX and license URLs supplied for your DRM account.
cpix_url = "YOUR_CPIX_URL"

playready_license_url = "YOUR_PLAYREADY_LICENSE_URL"
widevine_license_url = "YOUR_WIDEVINE_LICENSE_URL"
fairplay_license_url = "YOUR_FAIRPLAY_LICENSE_URL"
fairplay_certificate = ""

[[sources]]
id = "rtmp-in"
source_type = "flv"

[sources.protocol_options.url]
type = "string"
value = "rtmp://YOUR_INPUT_HOST/live/YOUR_INPUT_STREAM_KEY"

[[sinks]]
id = "moq"
sink_type = "moq"
source_ids = ["encode"]
drm_provider_id = "82a214dd-815d-4247-aeed-24c9ef63dad0"

[sinks.protocol_options.transport_mode]
type = "string"
value = "lookup"

[sinks.protocol_options.url]
type = "string"
value = "YOUR_MOQ_PUBLISH_URL"

[sinks.protocol_options.channel_id]
type = "string"
value = "YOUR_CHANNEL_ID"

[[transcoders]]
id = "encode"
source_ids = ["rtmp-in"]

[[transcoders.tracks]]
type = "video"
id = "video"

[transcoders.tracks.track_selector]
type = "track-kind"
kind = "video"

[[transcoders.tracks.renditions]]
id = "h264"
codec = "h264"
gop_size_ms = 1000
bit_rate = 1_000_000

[transcoders.tracks.renditions.size]
scale_factor = 0.5

[[transcoders.tracks]]
type = "audio"
id = "audio"
passthrough = true

[transcoders.tracks.track_selector]
type = "track-kind"
kind = "audio"
criteria = "all"

[[transcoders.tracks.renditions]]
id = "opus"
codec = "opus"
sample_rate = 48_000
bit_rate = 64_000

EZDRM Example​

Below is an example of RTMP -> MoQ with DRM provider EZDRM encoded content.

Replace the input and publishing settings, YOUR_DRM_TOKEN, YOUR_CONTENT_ID, YOUR_CPIX_URL, the license URLs and YOUR_FAIRPLAY_CERTIFICATE with the values supplied for your EZDRM account and playback setup.

Download drm-2.toml.

toml
# Vindral Bridge Packager example
# RTMP to Vindral Live over MoQ, encrypted with EZDRM.

version = "3"

[[drm_provider]]
type = "cpix"
provider = "ezdrm"
token = "YOUR_DRM_TOKEN"
scheme = "cbcs"
id = "82a214dd-815d-4247-aeed-24c9ef63dad0"
content_id = "YOUR_CONTENT_ID"
cpix_url = "YOUR_CPIX_URL"

# Use the license URLs supplied for your DRM account.
playready_license_url = "YOUR_PLAYREADY_LICENSE_URL"
widevine_license_url = "YOUR_WIDEVINE_LICENSE_URL"
fairplay_license_url = "YOUR_FAIRPLAY_LICENSE_URL"
fairplay_certificate = "YOUR_FAIRPLAY_CERTIFICATE"

[[sources]]
id = "rtmp-in"
source_type = "flv"

[sources.protocol_options.url]
type = "string"
value = "rtmp://YOUR_INPUT_HOST/live/YOUR_INPUT_STREAM_KEY"

[[sinks]]
id = "moq"
sink_type = "moq"
source_ids = ["encode"]
drm_provider_id = "82a214dd-815d-4247-aeed-24c9ef63dad0"

[sinks.protocol_options.transport_mode]
type = "string"
value = "lookup"

[sinks.protocol_options.url]
type = "string"
value = "YOUR_MOQ_PUBLISH_URL"

[sinks.protocol_options.channel_id]
type = "string"
value = "YOUR_CHANNEL_ID"

[[transcoders]]
id = "encode"
source_ids = ["rtmp-in"]

[[transcoders.tracks]]
type = "video"
id = "video"

[transcoders.tracks.track_selector]
type = "track-kind"
kind = "video"

[[transcoders.tracks.renditions]]
id = "h264"
codec = "h264"
gop_size_ms = 1000
bit_rate = 1_000_000

[[transcoders.tracks]]
type = "audio"
id = "audio"
passthrough = true

[transcoders.tracks.track_selector]
type = "track-kind"
kind = "audio"
criteria = "all"

[[transcoders.tracks.renditions]]
id = "opus"
codec = "opus"
sample_rate = 48_000
bit_rate = 64_000