Remix DRM

Overview

Note

This document describes the current method of setting DRM keys using an additional stage to dynamically generate ISM manifests. This will be deprecated as part of on-going development of new DRM functionality (multiple keys, key rotation, etc.)

Remix VOD enables server side mixing of content to produce a single output stream. Clients and playback devices see the stream coming from a single origin and having a timeline without any discontinuities.

The solution makes use of two Unified Streaming Platform products:

  • Remix, to create a single presentation from multiple input sources

  • Origin, for Just-In-Time packaging/transmuxing to all supported streaming formats

Remix VOD allows for the following use cases:

  • Bumper for Everyone (Ratecard, Dubcard, Promo, Warning Slate)

  • Virtual Subclips (Highlights or Skip-over)

  • Pre-, Mid-, Post-Roll (VOD)

Components

../../../_images/drm_overview.svg

Unified Origin

Playout Origin for content, this takes the remixed MP4 created by Remix and plays out all streaming formats, optionally with DRM applied.

ISM Origin

Uses Apache mod_ext_filter and mod_proxy_http to proxy requests to Remix and run mp4split to generate an ISM on the fly with DRM keys and other options.

Remix Origin

Based on a SMIL playlist Remix compares the listed sources and produces a single remixed MP4.

SMIL Origin

Creates a playlist based on a request URL.

This is the most important integration point as it provides the mapping of a request URL to the source media that will be used to produce the final presentation.

Caching Proxies

The ISM, Remix and SMIL generation processes can be relatively intensive, so caching proxies are used to reduce latency and minimise unnecessary load.

This can be any HTTP caching proxy, e.g. Apache httpd with mod_cache and mod_proxy, NGINX, Varnish.

../../../_images/drm_sequence.svg

Integration

SMIL Origin

The SMIL Origin must return a SMIL 2.0 (Synchronized Multimedia Integration Language) playlist.

SMIL functionality supported by Remix

outputDescription

<meta> element in head to point to target profile. The @content is a URL pointing to ISOBMFF file, where the MovieBox (moov) represents desired target profile.

  • Without setting this, the first clip in the playlist will be used as the target profile.

seq

The <seq> element holds a list of one or more clips to be played consecutively.

isContinuous

New in version 1.12.2.

Boolean attribute seq@isContinuous (default false) indicates that child elements comprise a contiguous sequence. (E.g.: nPVR archive) The segments are merged into one before clipping, conditioning and alignment.

par

The <par> element combines multiple files to be presented simultaneously. This is useful if different tracks are stored in separate source files. (E.g.: CMAF files)

clipBegin / clipEnd

The @clipBegin and @clipEnd attributes can be used to select the time span to be presented rather than whole.

  • currently only supports using the "wallclock(ISO 8601)" format, not all formats included in SMIL 2.0

  • clip timing reflects the media timeline of the source

Clip attributes are valid in <audio> and <video> elements as well as <seq> and <par>, but logically the cuts should always be simultaneously across all tracks.

clipMode

The @clipMode attribute specifies how to handle @clipBegin and @clipEnd values that do not match a fragment boundary in the source media. See also: Specifying conditioning info using 'clipMode'.

ConditioningInfo, EventStream, Event

See: Media Conditioning For Ad Insertion and Specifying Timed Metadata in a SMIL playlist.

When using remixing archive segments captured with --remix we recommend creating a sequence <seq isContinuous="true" clipBegin"..."> around the archive segments and ensuring that enough priming media is available in the first archive segment.

This avoids a problem previously caused by Unified Remix not being able to find a sync-sample near the start of the archive.

SMIL Examples

A SMIL playlist to play a pre-roll bumper and 30 seconds of Tears of Steel looks like this:

<?xml version="1.0" encoding="utf-8"?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head/>
  <body>
    <seq>
      <video src="http://sample-content/logo_5s_dref.mp4"/>
      <video src="http://sample-content/tears-of-steel-dref.mp4"
         clipEnd="wallclock(1970-01-01T00:00:30.000Z)"/>
    </seq>
  </body>
</smil>

A use case with pre- and mid-roll advertisements using Sintel as the main content, targeting Sintel for the output profile:

<?xml version='1.0' encoding='UTF-8'?>
<smil
  xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head>
    <meta name="outputDescription" content="http://storage/main/sintel/sintel_dref.mp4"/>
  </head>
  <body>
    <seq>
      <video src="http://storage/ads/origin/origin08_x264.mp4"/>
      <video src="http://storage/main/sintel/sintel_dref.mp4"
         clipEnd="wallclock(1970-01-01T00:00:30.000Z)"/>
      <video src="http://storage/ads/capture/capture10_x264.mp4"/>
      <video src="http://storage/main/sintel/sintel_dref.mp4"
       clipBegin="wallclock(1970-01-01T00:00:30.000Z)"
         clipEnd="wallclock(1970-01-01T00:01:00.000Z)"/>
    </seq>
  </body>
</smil>

An example based on different bitrates in separate MP4s, using <par> to combine these MP4s into a single clip, followed by a single media source that contains the same tracks:

<?xml version="1.0" encoding="utf-8"?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head>
  </head>
  <body>
    <seq>
      <par>
        <video src="http://storage/path/to/files/file_1280.mp4" />
        <video src="http://storage/path/to/files/file_1024.mp4" />
        <video src="http://storage/path/to/files/file_768.mp4" />
        <video src="http://storage/path/to/files/file_480.mp4" />
      </par>
      <video src="http://local-storage.unified-streaming.com/demo/tears-of-steel/tears-of-steel-teaser-no-jpg.ism" />
    </seq>
  </body>
</smil>

An nPVR example where multiple 5 minute segments are merged and clipped for re-broadcast.

<?xml version="1.0" ?>
<smil xmlns="http://www.w3.org/2001/SMIL20/Language">
  <head/>
  <body>
    <seq>
      <!-- replay yesterday's match from nPVR archive -->
      <seq clipBegin="wallclock(2022-08-23T06:11:59.60)"
             clipEnd="wallclock(2022-08-23T06:21:04)"
        isContinuous="true">
        <video src="http://storage/blobs/205-1Oqn6U.ismv"/>
        <video src="http://storage/blobs/205-1OqnbK.ismv"/>
        <video src="http://storage/blobs/205-1OqngA.ismv"/>
        <video src="http://storage/blobs/205-1Oqnlq.ismv"/>
      </seq>
    </seq>
  </body>
</smil>

Storage

Storage for Remix VOD can consist of any form of attached storage (a mount point on the filesystem) or HTTP accessible storage such as S3.

The only requirement is that content must be accessible at the same path from both Remix Origin and Unified Origin, e.g. if using network attached storage mounted to /storage, the mount must be the same on all Remix Origins and Unified Origins.

Deployment

Remix VOD is flexible when it comes to deployment options, as both Unified Origin and Remix are stateless and work over HTTP. This means it can easily be deployed on both physical or virtual hosts, or using container technology such as Docker.

Our GitHub Remix Demo has each component running in a separate Docker container, and uses Docker Compose to deploy and configure them to produce a working environment.

Supported OS and software versions

Remix requires Apache 2.4.x.

Recommended OS and web server versions are:

Ubuntu 18.04

Apache/2.4

Ubuntu 20.04

Apache/2.4

Alpine Linux v3.14

Apache/2.4

Environments

Remix VOD can be deployed using various approaches:

  • Bare metal

  • Virtual machines as for instance Amazon EC2

  • Container environments managed by for instance Kubernetes

Requirements

  • Content encoding profiles should match

    • Remix uses a set of heuristics to make "best fit" matches of tracks between separate source media

    • Video aspect ratio changes can cause playback quality issues depending on the player as it may stretch the content to fit the expected aspect ratio

    • Some audio differences will cause playback to break and so cannot be matched, for example,

      • sample rate mismatch

      • channel count difference