Understanding SMIL file syntax

Wowza Streaming Engine supports simple XML-based SMIL file formatting with additional custom elements not specified by the SMIL standard.

Notes:

  • The Wowza Streaming Engine creates a manifest with renditions listed in the same order as they are in the SMIL file <switch> container element. The first stream in the manifest is selected first by players. To ensure the player selects and plays the highest bitrate stream, given current network conditions and available CPU resources, arrange the streams from highest to lowest bitrate.

  • To ensure the SMIL file is compatible with all HTTP streaming protocols, you must define at least one bitrate attribute or parameter in each <video> definition.

  • Not all parameters are supported by all streaming protocols. For example, roles are only used for MPEG-DASH streams.

SMIL XML file format

The following is an example of the Wowza Streaming Engine 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"/>
                <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"/>
                <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"/>
                <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>

SMIL file elements

The following table describes the SMIL file elements:

SMIL file element Description
<switch>/<video> Each media entry is contained in a <video> element in a <switch> container element.
src The name of the media file or live source stream. For example, sample.mp4.
[attribute_name] Optional attributes that are used to customize audio and video characteristics of a <video> definition. For more information, see the tables below.
<param> Optional parameters containing a name and value that are used to customize audio and video characteristics of a media source. For more information, see the tables below.

Caption data can be added to a SMIL file using a single textstream container element. For attribute definitions, parameter descriptions, and example usage for the textstream container element, see:

SMIL file attributes

The following table describes the SMIL file <video> attributes:

Attribute Type Description
systemLanguage String The three-letter code for the language of the audio or video track in the media.
system-bitrate Integer The sum of the audio and video tracks in the media. This can also be used as a parameter (systemBitrate). This parameter is ignored when used with MPEG-DASH streams.
audio-bitrate Integer The bitrate of the audio tracks in the media entry. This can also be used as a parameter (audioBitrate).
video-bitrate Integer The bitrate of the video tracks in the media entry. This can also be used as a parameter (videoBitrate).
width Integer The display width of the video track within the media.
height Integer The display height of the video track within the media.
title String The title of the media entry.
begin Integer The position (in milliseconds) in the stream at which to begin playback. Use with dur to play a specific section of the source media.
dur Integer The duration (in seconds) of the stream interval that you want to play. Use with begin to play a specific section of the source media.

SMIL file parameters

The following table describes SMIL file <video> parameters:

Parameter Type Description
audioOnly Boolean If true, use the default audio track and ignore all video tracks in the media.
videoOnly Boolean If true, use the default video track and ignore all audio tracks in the media.
audioCodecID String The codec id of the default audio track in this media entry. Note: If you are unsure of the correct codec string don’t specify an audioCodecId value. Wowza Streaming Engine can determine the correct ID value.
videoCodecID String The codec ID of the default video track in this media entry. Note: If you are unsure of the correct codec string don’t specify an videoCodecId value. Wowza Streaming Engine can determine the correct ID value.
role String The intended role of all audio and video tracks in the media file. Set to main to mark the primary language track. Set to dub to mark the secondary language track
audioRole String The intended role of the default audio track in the media entry. Set to main to mark the primary language track. Set to dub to mark the secondary language track.
videoRole String The intended role of the default video track in the media entry. Set to main to mark the primary language track. Set to dub to mark the secondary language track.
keyFrameOnly Boolean If true, Wowza Streaming Engine displays only keyframes in the stream’s source media, reducing the CPU load.
mpegdashTag.adaptationSet Data The adaptation set for MPEG-DASH streams. Any unique value will create a separate adaption set, and all renditions that have the same value will be included in the same adaption set.