SMIL file syntax

Wowza Streaming Engine™ (WSE) supports XML-based SMIL files, which describe a set of media entries that can be delivered together as a single adaptive bitrate stream. A SMIL file lists each rendition, along with the audio and video characteristics WSE uses to build the manifest delivered to players.

WSE supports the SMIL standard with additional custom elements, attributes, and parameters not specified by the standard. Renditions appear in the manifest in the same order they're listed in the <switch> container element, and players select the first stream in the manifest first. Arrange streams from highest to lowest bitrate so the player selects the highest bitrate stream that current network conditions and available CPU resources allow.

Note: Not all attributes and parameters described below are supported by every streaming protocol. For example, roles apply only to MPEG-DASH streams.

Contents


Example SMIL file


The following example shows the WSE SMIL file format.

<smil>
    <head></head>
    <body>
        <switch>
            <video src="[source-name]" [attribute-name]="[value]" [attribute-name]="[value]">
                <param name="[param-name]" value="[value]" valuetype="data"/>
                <param name="[param-name]" value="[value]" valuetype="data"/>
            </video>
            <video src="[source-name]" [attribute-name]="[value]" [attribute-name]="[value]">
                <param name="[param-name]" value="[value]" valuetype="data"/>
                <param name="[param-name]" value="[value]" valuetype="data"/>
            </video>
            <video src="[source-name]" [attribute-name]="[value]" [attribute-name]="[value]">
                <param name="[param-name]" value="[value]" valuetype="data"/>
                <param name="[param-name]" value="[value]" valuetype="data"/>
            </video>
            <!-- Use to add caption data -->
            <textstream src="[source-name]" system-language="[value1, value2]">
                <param name="[param-name]" value="[value]" valuetype="data"></param>
            </textstream>
        </switch>
    </body>
</smil>

Switch element


The <switch> element contains the children listed in the table below. Every <video> element must contain at least one bitrate attribute or parameter in order to make the SMIL file compatible with all HTTP streaming protocols.

Element Type Description
<video> Container Attributes that customize the audio and video characteristics of a media entry. Each rendition in the adaptive bitrate stream is defined in its own <video> element. See the Video attributes table for available attributes. Required.
<param><param> Container A name and value pair that customizes the audio and video characteristics of a media entry. See the Video parameters table for available parameters. Optional.
<textstream> Container Caption data for the streams in the <switch> element. A SMIL file supports a single <textstream> element. See TextStream element. Optional.

Video attributes

The <video> element accepts the attributes listed in the table below.

Attribute Type Description
src String The name of the media file or live source stream, such as sample.mp4. Required.
systemLanguage String Three-letter code for the language of the audio or video track in the media.
system-bitrate Integer Combined bitrate of the audio and video tracks in the media. Also available as the systemBitrate parameter. Ignored for MPEG-DASH streams.
audio-bitrate Integer Bitrate of the audio tracks in the media entry. Also available as the audioBitrate parameter.
video-bitrate Integer Bitrate of the video tracks in the media entry. Also available as the videoBitrate parameter.
width Integer Display width of the video track in the media.
height Integer Display height of the video track in the media.
title String Title of the media entry.
begin Integer Position in the stream, in milliseconds, at which playback begins. Use with dur to play a specific section of the source media.
dur Integer Duration, in seconds, of the stream interval to play. Use with begin to play a specific section of the source media.

Param attributes

The <param> element within the  <video> container may contain the named attributes listed in the table below. 

Attribute Type Description
audioOnly Boolean If true, WSE uses the default audio track and ignores all video tracks in the media.
videoOnly Boolean If true, WSE uses the default video track and ignores all audio tracks in the media.
audioCodecId String The codec ID of the default audio track in the media entry. If you're unsure of the correct codec string, leave this unset and WSE determines the ID.
videoCodecId String The codec ID of the default video track in the media entry. If you're unsure of the correct codec string, leave this unset and WSE determines the ID.
role String Intended role of all audio and video tracks in the media file. Accepts one of the following values:
  • main: Mark as the primary language track.
  • dub: Mark as the secondary language track.
audioRole String Intended role of the default audio track in the media entry. Accepts one of the following values:
  • main: Mark as the primary language track.
  • dub: Mark as the secondary language track.
videoRole String Intended role of the default video track in the media entry. Accepts one of the following values:
  • main: Mark as the primary language track.
  • dub: Mark as the secondary language track.
keyFrameOnly Boolean If true, WSE delivers only the keyframes in the stream's source media, which reduces CPU load.
mpegdashTag.adaptationSet Data Adaptation set for MPEG-DASH streams. Each unique value creates a separate adaptation set, and all renditions sharing a value are included in the same adaptation set.

TextStream element

Add caption data to a SMIL file with a single <textstream> container element. For attribute definitions, parameter descriptions, and example usage, see:

More resources