Skip to content

Lesson 3 of 9 · 23m

VOD Packaging, CMAF, and Encryption Without Regret

Package mezzanine assets into stable HLS and DASH outputs, use CMAF where it pays, and separate encryption metadata from key management.

Packaging is the moment your encode becomes a public API. Players, CDNs, ad insertion systems, download features, and DRM license services all consume the artifacts you produce. Treat packaging as an immutable release pipeline, not as a folder of files somebody remembers generating one afternoon.

Separate mezzanine from delivery

The mezzanine is the high-quality intermediate you keep for future reprocessing. Delivery renditions are compressed for playback. Do not confuse the two:

camera/upload original
  -> normalized mezzanine ProRes/DNxHR/high-bitrate H.264
       -> H.264 delivery renditions
       -> HEVC or AV1 delivery renditions
            -> CMAF/fMP4 package
            -> optional legacy HLS TS package

If you delete the mezzanine to save storage, you have also chosen never to re-encode economically when codec support or quality targets change. Sometimes that is correct. Make it a lifecycle decision, not an accident.

CMAF reduces duplication when clients support it

Classic HLS often used MPEG-TS segments while DASH used fragmented MP4. CMAF lets both manifests reference compatible fragmented MP4 media, reducing duplicate storage and cache objects:

ffmpeg -i input.mp4   -map 0:v -map 0:a   -c copy   -f hls -hls_time 4   -hls_segment_type fmp4   -hls_fmp4_init_filename init.mp4   -hls_segment_filename 'media_%05d.m4s'   variant.m3u8

Compatibility is the catch. Old HLS players expect MPEG-TS. Newer Apple, browser, and TV platforms commonly handle fMP4, but device telemetry should decide when legacy TS can retire. "Supported by the specification" and "supported by the oldest smart TV in your user base" are different statements.

Packaging metadata is operational metadata

Manifests should encode precise durations, bandwidths, codecs, resolution, frame rate, audio channels, and encryption state. A master playlist declaring the wrong peak bandwidth causes players to overestimate what a rendition costs. They may start too high, collapse into rebuffering, then pin viewers at low quality longer than necessary.

Encryption is packaging plus key management

AES-128 HLS encryption, FairPlay, Widevine, and PlayReady solve different parts of content protection. The media encryption itself is not the hard operational part; key custody is:

packager:    encrypts segments; labels key URI; rotates key IDs
key service: stores keys; authenticates license requests; authorizes user/device/session

Never hard-code keys in packaging jobs or commit them to job templates. If the key URI points at an endpoint that cannot enforce entitlement, encryption is just obfuscation with extra latency. Test license failure behavior too: a clean error beats endless spinner purgatory.

Immutable outputs simplify incident response

Package into a versioned object prefix rather than mutating in place:

assets/01JZX/video123/hls/v4/master.m3u8
assets/01JZX/video123/dash/v4/manifest.mpd

When packaging parameters change, produce v5. This lets you roll back playback routing, compare reports, and purge caches deliberately instead of wondering which generation of files is currently mixed together under one URL.

Field notes

  • Master manifests are mutable control-plane objects; media segments should normally be immutable data-plane objects.
  • Do not let packaging jobs overwrite segments after clients may already hold URLs.
  • DRM failures often appear as black video or generic player errors. Log license status separately from media request status.
  • Keep a small legacy test device pool. Compatibility regressions arrive quietly and leave loudly.

Was this lesson helpful?

Sign in to rate