Static Delivery - Unified Packager

Using the remixed MP4 as input, Unified Packager can statically package the content of this MP4 to produce a DASH, fMP4 HLS or HLS TS stream with all the SCTE 35 signaling necessary to support a third-party ad insertion workflow.

../../../_images/vod_tmd_packager.svg

Workflow for statically packaged HLS TS

Creating the Media Playlists

When using Unified Packager to package a HLS TS stream with Timed Metadata from a remixed MP4, it is important to signal both the specific media track as well as the track that contains the Timed Metadata each time you are creating a Media Playlist.

Also make sure that --timed_metadata is enabled, and, if splicing is necessary, --splice_media too.

For audio this will look something like this (assuming that the remixed MP4 that is used as input does not contain more than one audio track):

#!/bin/bash

mp4split --package_hls -o audio.m3u8 \
  --timed_metadata \
  --splice_media \
  --fragment_duration=6000/1000 \
  --output_single_file \
  remixed.mp4 --track_type=audio \
  remixed.mp4 --track_type=meta

For video, the command-line looks very similar:

#!/bin/bash

mp4split --package_hls -o video.m3u8 \
  --timed_metadata \
  --splice_media \
  --fragment_duration=6000/1000 \
  --iframe_index_file=iframe.m3u8 \
  --output_single_file \
  --start_segments_with_iframe \
  remixed.mp4 --track_type=video \
  remixed.mp4 --track_type=meta

Note

To learn more about the different options used in the command-lines above, please check the relevant documentation: --package_hls, --fragment_duration, --iframe_index_file, --output_single_file, --start_segments_with_iframe and --track_type.

Creating the Master Playlist

After you have generated all the Media Playlists, generating the HLS Master Playlist works the same as it normally does and simply requires you to specify all Media and I-frame Playlists as input:

#!/bin/bash

mp4split --package_hls -o master.m3u8 \
  audio.m3u8 \
  video.m3u8 \
  iframe.m3u8

Workflows for statically packaged fMP4 HLS and DASH

Using the remixed MP4 as input, Unified Packager can package it to CMAF file(s) that contain the SCTE 35 Timed Metadata from the remixed MP4. These CMAF files can then be used to generate the fMP4 HLS Media and Master Playlists, DASH client manifest (MPD), or both.

Packaging the Media (CMAF)

When packaging content with Timed Metadata --fragment_duration can be used like you normally would, but note that the Timed Metadata may specify splice points that need to be taken into account. I.e., segments may be merged to match a specified target duration, but at SCTE 35 markers they will be spliced (if splicing is enabled).

Make sure that --timed_metadata is enabled, and, if splicing is necessary, --splice_media too:

#!/bin/bash

mp4split -o video.cmfv --timed_metadata --splice_media \
  --fragment_duration=2000/1000 \
  remixed.mp4 --track_type=video \
  remixed.mp4 --track_type=meta

mp4split -o audio.cmfa --timed_metadata --splice_media \
  --fragment_duration=2000/1000 \
  remixed.mp4 --track_type=audio \
  remixed.mp4 --track_type=meta

Attention

Packaging CMAF vs fMP4

There is a subtle but important syntax difference between the CMAF examples above on one hand and more generally packaging (f)MP4 with a metadata input track. The .cmfv and .cmfa extentions imply --brand=cmfc which (by definition) has one track, forcing the metadata to be inserted as emsg prior to each fragment's moof, rather than sample data in mdat.

Creating the fMP4 HLS playlists

Creating the Media Playlists

Creating the Media Playlists for a Remix AVOD workflow with statically packaged fMP4 HLS is more straightforward than for HLS TS, because the media has already been packaged (and spliced) properly. The only thing to take into account is to make sure that you enable --timed_metadata:

#!/bin/bash

mp4split -o video.m3u8 \
  --fragment_duration=6000/1000 \
  --timed_metadata \
  video.cmfv

mp4split -o audio.m3u8 \
  --fragment_duration=6000/1000 \
  --timed_metadata \
  audio.cmfa

Creating the Master Playlist

After you have generated all the Media Playlists, generating the HLS Master Playlist works the same as it normally does and simply requires you to specify all Media and I-frame Playlists as input:

#!/bin/bash

mp4split -o master.m3u8 \
  audio.m3u8 \
  video.m3u8 \
  iframe.m3u8

Creating the DASH client manifest

If you have followed the workflow described above and packaged CMAF with SCTE 35 Timed Metadata, creating the MPD works the same as it normally does and simply requires you to specify all packaged CMAF tracks as input. The only thing to take into account is to make sure that you enable --timed_metadata:

#!/bin/bash

mp4split --package_mpd -o presentation.mpd \
  --timed_metadata \
  video.cmfv \
  audio.cmfa