Creating a SMIL Playlist

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>

For a more complicated example, here is the same nPVR example, but interrupted by an add break and news break.

nPVR playlist with intermission
<?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"/>
      </seq>
      <!-- intermission -->
      <video src="local/ads/buy-emergendizer.mp4" />
      <!-- replay nine o'clock news update, but skip the weather -->
      <par clipEnd="wallclock(6:41.28)" clipMode="sample">
        <audio src="http://recorded/latest-news.cmfa"/>
        <video src="http://recorded/latest-news-low.cmfv"/>
        <video src="http://recorded/latest-news-medium.cmfv"/>
        <video src="http://recorded/latest-news-high.cmfv"/>
      </par>
      <!-- pick up nPVR where we left off -->
      <seq clipBegin="wallclock(2022-08-23T06:21:04)"
             clipEnd="wallclock(2022-08-23T06:30:00)"
        isContinuous="true">
        <video src="http://storage/blobs/205-1OqngA.ismv"/>
        <video src="http://storage/blobs/205-1Oqnlq.ismv"/>
      </seq>
    </seq>
  </body>
</smil>