Stream adaptive bitrate content with Wowza Streaming Engine

In adaptive bitrate (ABR) streaming, multiple bitrate renditions of the same source are used. When playing your streams, the client player determines which stream to use based on network and processor capabilities. When using the Wowza Streaming Engine to generate ABR files, you need a Synchronized Multimedia Integration Language (SMIL) file. This file contains information about the streams and links them together for playback. Follow these instructions to configure a SMIL file, using Wowza Streaming Engine™ media server software for a live stream or a video on demand (VOD) stream.

Video: Get up and running with adaptive bitrate live streaming


Before you begin


For ABR streaming using the Wowza Streaming Engine, you must have the following items before creating your SMIL file.

  • Renditions of your stream source transcoded and transrated in multiple bitrates. See Wowza Streaming Engine Transcoder.

  • Carefully prepared renditions. The renditions in adaptive bitrate streams must have aligned keyframes for players to correctly switch between them. This is done, at encoding time, by setting the keyframe interval and frame rate values to be the same for each encoded file or stream.

Configure a SMIL file for live adaptive bitrate streams


You can configure the SMIL file for live adaptive bitrate streams in the Wowza Streaming Engine Manager or in the Application.xml file.

Note: The procedures in this section assume you have three live streams encoded at different bitrates:

  • myStream_200 (200kbps total bitrate)

  • myStream_350 (350kbps total bitrate)

  • myStream_700 (700kbps total bitrate)

Configure a SMIL file using Wowza Streaming Engine Manager

This procedure creates a SMIL file named myStream.smil that supports the three live streams myStream_200, myStream_350, and myStream_700.

  1. In the Applications content panel, click live, click SMIL Files, and then click Add SMIL File.

    image

  2. In the Add SMIL File dialog box, enter a name for the new SMIL file, and click Add. (The title is optional.)

    image

  3. On the myStream.smil page, click Add SMIL Stream.

    image

  4. In the Add SMIL Stream dialog box, select the video stream type, and click Add.

    image

    The new SMIL stream page is displayed.

    image

  1. Configure the SMIL options for the first sample live stream (myStream_200), and then click Add.

    • Source (src) – Enter myStream_200. This is the name of the encoded stream.

    • System Language – Enter eng (English per ISO 369.2). This is the encoded system language.

    • Video Bitrate – Enter 200000. This is the encoded bitrate value for the video, in bits per second. This value is the encoded bitrate value, in kilobits-per-seconds, multiplied by 1000. For this stream: 200kbps * 1000 = 200000bps.

    • Video Width and Video Height – Enter 424 and 240 into the respective fields. This is the encoded size of the video, in pixels.

    • Audio Bitrate – Enter 44100. This is the encoded bitrate of the audio included with the video.

  1. Repeat steps 3 - 5 for the remaining video streams. Use the following table for information about bitrates and size of the media streams.

    Source (src)

    Video Bitrate

    Video Width

    Video Height

    Audio Bitrate

    myStream_200

    200000

    424

    240

    44100

    myStream_350

    350000

    640

    360

    44100

    myStream_700

    700000

    1272

    720

    44100

  2. Configure a live application to deliver the SMIL file and media content to client players. You can use the preconfigured live application to stream adaptive bitrate content. For information on how to configure and create a live application, see Set up live streaming using an RTMP-based encoder in Wowza Streaming Engine.

  1. In the Applications content panel, click live, click SMIL Files, and then click the Connect icon for myStream.smil.

    image

  1. In the Connect a SMIL File dialog box, select the Application Name. You can use the preconfigured live application and default instance (definst). MediaCaster Type is not required for live streaming.

    image

  2. To test the adaptive bitrate stream, see Test live playback.

Configure SMIL file using a text editor

This procedure creates a SMIL file named myStream.smil to support the three live streams myStream_200, myStream_350, and myStream_700.

  1. Using a text editor, create a SMIL file named myStream.smil in the [install-dir]/content folder with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<smil title="SMIL file for live streaming">
    <body>
        <switch>
            <video height="240" src="myStream_200" systemLanguage="eng" width="424">
                <param name="videoBitrate" value="200000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="360" src="myStream_350" systemLanguage="eng" width="640">
                <param name="videoBitrate" value="350000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="720" src="myStream_700" systemLanguage="eng" width="1272">
                <param name="videoBitrate" value="700000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
        </switch>
    </body>
</smil>

In the <switch> container element, there is a <video> element for each file rendition. This syntax includes all aspects of the stream with videoBitrate and audioBitrate specified as parameters.

To ensure the SMIL file is compatible with all HTTP streaming protocols, define a system-bitrate attribute or systemBitrate parameter in all <video> elements. The system-bitrate sets the sum of all audio and video bitrates in the media file.

<video src="myStream_200" system-bitrate="244100"/>

You can also use the video-bitrate and audio-bitrate attributes, instead of the equivalent videoBitrate and audioBitrate parameters, to meet compatibility requirements:

<video src="myStream_200" video-bitrate="200000" audio-bitrate="44100" />

Note: For details on the tags, attributes, and parameters that you can use in a SMIL file definition, see Understanding SMIL file syntax.

Test live playback

Use the SMIL file to play the highest bandwidth stream the client processor and connection support. The client player determines which stream to play, depending on network and processor capabilities. If you use the installed live application, the source of the stream is the SMIL file in the default content store: [install-dir]/content. The URL syntax varies depending on the type of player.

Note: In the following URLs, [wowza-ip-address] is the domain name of the server running the Wowza Streaming Engine software.

Apple iOS device (Cupertino/Apple HLS)

http://[wowza-ip-address]:1935/live/smil:myStream.smil/playlist.m3u8

MPEG-DASH

http://[wowza-ip-address]:1935/live/smil:myStream.smil/manifest.mpd

Adobe Flash Player (San Jose/Adobe HDS)

http://[wowza-ip-address]:1935/live/smil:myStream.smil/manifest.f4m

Test live playback in Wowza Streaming Engine Manager

Click Test Players in the upper-right corner of the live application page. The Test Players window includes test players preconfigured to stream myStream over various streaming formats.

Each tab in the Test Players dialogue box hosts a test player that can play the live stream or provides information for playing the stream. For example, to use the Adobe HDS protocol to play the myStream.smil streams, click the Adobe HDS tab, enter the information below, and click Start.

  • Server – Enter [wowza-ip-address]:1935.

  • Application – Enter live.

  • Stream – Enter smil:myStream.smil.

image

The URL result from the Adobe HDS player tab is the following:

http://[wowza-ip-address]:1935/live/smil:myStream.smil/manifest.f4m

The test players are also online on the Video Test Players webpage.

Note: You can use example players installed in [install-dir]/examples/ to test your streaming applications. For more information, see:

Configure a SMIL file for VOD adaptive bitrate streams

You can configure the SMIL file for VOD adaptive bitrate streams in a number of ways.

Note: The procedures in this section assume you have the four VOD files encoded at different bitrates:

Configure a SMIL file using Wowza Streaming Engine Manager

This procedure creates a SMIL file named bigbuckbunny.smil that supports the four VOD files bigbuckbunny_450, bigbuckbunny_750, bigbuckbunny_1100, and bigbuckbunny_1500.

  1. In the Applications content panel, click vod, click SMIL Files, and then click Add SMIL File.

    image

  2. In the Add SMIL File dialog box, enter a name for the new SMIL file, and then click Add. (The title is optional.)

    image

  3. On the bigbuckbunny.smil page, click Add SMIL Stream.

    image

  4. In the Add SMIL Stream dialog box, select the video stream type, and then click Add.

    image

The new SMIL stream page is displayed.

image

  1. Configure the SMIL options for the first sample video, bigbuckbunny_450.mp4, and then click Add.

    • Source (src) – Enter bigbuckbunny_450.mp4. This is the name of the source file in storage.

    • System Language – Enter eng (English per ISO 369.2). This is the encoded system language.

    • Video Bitrate – Enter 450000. This is the encoded bitrate value for the video, in bits per second. This value is the encoded bitrate value, in kilobits-per-second, multiplied by 1000. For this video file: 450kbps * 1000 = 450000bps.

    • Video Width and Video Height – Enter 424 and 240 into the respective fields. This is the encoded size of the video, in pixels.

    • Audio Bitrate – Enter 44100. This is the encoded bitrate for the audio that’s included with the video.

  1. Repeat steps 3 - 5 for the remaining video files. Use the following table for information about bitrates and size of the encoded files.

    Source (src)

    Video Bitrate

    Video Width

    Video Height

    Audio Bitrate

    bigbuckbunny_450.mp4

    450000

    424

    240

    44100

    bigbuckbunny_750.mp4

    750000

    640

    360

    44100

    bigbuckbunny_1100.mp4

    1100000

    1272

    720

    44100

    bigbuckbunny_1500.mp4

    1500000

    1590

    900

    44100

  2. Configure a VOD application to deliver the SMIL file and media content to client players. You can use the preconfigured vod application to stream adaptive bitrate content. For information on how to configure and create a vod application, see Set up video-on-demand streaming in Wowza Streaming Engine.

  3. To test the SMIL file with adaptive bitrate functionality, see Test VOD playback.

Configure a SMIL file using a text editor

This procedure creates a SMIL file named bigbuckbunny.smil to support the four video files bigbuckbunny_450, bigbuckbunny_750, bigbuckbunny_1100, and bigbuckbunny_1500.

  1. Using a text editor, create a SMIL file named bigbuckbunny.smil in the [install-dir]/content folder with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<smil title="">
    <body>
        <switch>
            <video height="240" src="bigbuckbunny_450.mp4" systemLanguage="eng" width="424">
                <param name="videoBitrate" value="450000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="360" src="bigbuckbunny_750.mp4" systemLanguage="eng" width="640">
                <param name="videoBitrate" value="750000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="720" src="bigbuckbunny_1100.mp4" systemLanguage="eng" width="1272">
                <param name="videoBitrate" value="1100000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
            <video height="900" src="bigbuckbunny_1500.mp4" systemLanguage="eng" width="1590">
                <param name="videoBitrate" value="1500000" valuetype="data"></param>
                <param name="audioBitrate" value="44100" valuetype="data"></param>
            </video>
        </switch>
    </body>
</smil>

In the <switch> container element, there is a <video> element for each file rendition. This syntax includes all aspects of the stream with videoBitrate and audioBitrate specified as parameters.

Simpler forms of the SMIL file will work. To ensure the SMIL file is compatible with all HTTP streaming protocols, define a system-bitrate attribute or systemBitrate parameter in all <video> elements. The system-bitrate sets the sum of all audio and video bitrates in the media file.

<video src="bigbuckbunny_450.mp4" system-bitrate="494100"/>

You can also use the video-bitrate and audio-bitrate attributes instead of the equivalent videoBitrate and audioBitrate parameters to meet these compatibility requirements:

<video src="bigbuckbunny_450.mp4" video-bitrate="450000" audio-bitrate="44100" />

Notes:

Test VOD playback

Use the SMIL file to play the highest-bandwidth stream the client processor and connection support. The client player determines which stream to play, depending on network and processor capabilities. If you use the installed vod application, the source of playback files is the SMIL file in the default content store: [install-dir]/content. The URL syntax varies depending on the player.

Note: In the following URLs, [wowza-ip-address] is the domain name of the server running the Wowza Streaming Engine software.

Apple iOS device (Cupertino/Apple HLS)

http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/playlist.m3u8

MPEG-DASH

http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/manifest.mpd

Adobe Flash Player (San Jose/Adobe HDS)

http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/manifest.f4m

Test VOD playback in Wowza Streaming Engine Manager

Click Test Players in the upper-right corner of the vod application page. The Test Players window that opens includes test players that are preconfigured to stream the sample.mp4 video file over various streaming formats.

Each tab in the Test Players dialogue box hosts a test player that you can use to play the video file or provides instructions for playing the video file. For example, to use the Adobe HDS protocol to play the bigbuckbunny.smil video file, click the Adobe HDS tab, enter the information below, and then click Start.

  • Server – Enter [wowza-ip-address]:1935.

  • Application – Enter vod.

  • Media File Name – Enter smil:bigbuckbunny.smil.

image

The URL result from the Adobe HDS player tab is the following:

http://[wowza-ip-address]:1935/vod/smil:bigbuckbunny.smil/manifest.f4m

The test players are also online on our Video Test Players webpage.

Note: You can also use example players installed in [install-dir]/examples/ to test your streaming applications. For more information, see the following articles:
 

More resources