Stream adaptive bitrate content with Wowza Streaming Engine

Wowza Streaming Engine™ media server software can deliver adaptive bitrate (ABR) live or video on demand (VOD) streams over HTTP. In adaptive bitrate (ABR) streaming, multiple bitrate renditions of the same source are used by client players. The client player determines which bitrate rendition of the stream to use based on network and processor capabilities. The Wowza Streaming Engine Transcoder enables live adaptive bitrate delivery. It can ingest a single bitrate live stream and create multiple lower-bitrate renditions, which are keyframe-aligned, on the fly.

Associating the different bitrate renditions with each other in a logical group for delivery to a player requires either a Stream Name Group or a SMIL file. You must use a SMIL file for VOD adaptive bitrate streaming. For live adaptive bitrate streaming, Transcoder creates Stream Name Groups with some configurations, but other configurations require that you create a SMIL file.

This article explains when to use a SMIL file and how to create and use a SMIL file to group bitrate renditions for adaptive bitrate streaming.

Note: Before creating your SMIL file, you need to already have multiple bitrate renditions with aligned keyframes for players to correctly switch between them. Keyframe alignment is done at encoding time by setting the keyframe interval and frame rate values to be the same for each encoded file or stream rendition.

About SMIL files and Stream Name Groups


The Transcoder templating system groups streams together in logical Stream Name Groups for delivery of live adaptive bitrate streams. Stream Name Groups and SMIL files serve the same purpose, and either method can be used for adaptive bitrate playback of live streams in most configurations. However, in some configurations, such as edge servers in a live stream repeater (origin/edge) configuration, Stream Name Groups can't be used. In a live stream repeater configuration, a Stream Name Group is automatically created by Transcoder on the origin server, but the Stream Name Group can't be propagated to the edge servers so a SMIL file must be used instead for adaptive bitrate delivery. For more information, see Configure a live stream repeater in Wowza Streaming Engine.

Notes:
  • VOD adaptive bitrate streaming requires a SMIL file.
  • For adaptive bitrate playback from a single instance of Wowza Streaming Engine or the origin server in a live stream repeater configuration, we recommend using Stream Name Groups because they are automatically created by Transcoder. For more information, see View adaptive bitrate Stream Name Groups.
     
  • For more information about Stream Name Groups and using Transcoder, see Set up and run Transcoder in Wowza Streaming Engine.

Create and configure a SMIL file


The easiest way to create a SMIL file is in Wowza Streaming Engine Manager, but alternatively you can create a SMIL file manually in a text editor or you can generate one by using an HTTP provider and the Wowza Streaming Engine Java API. Select one of the following workflows to continue on to learn how to create a SMIL file for live or VOD adaptive bitrate streaming in Wowza Streaming Engine Manager or manually in a text editor:

For instructions on using an HTTP provider, which is recommended only for advanced users, see Generate a SMIL file with an HTTP provider using the Wowza Streaming Engine Java API.

Live adaptive bitrate streaming

Use one of the following workflows to create a SMIL file for live adaptive bitrate streaming:

Note: The procedures in this section assume you have three live streams encoded at different bitrates:
  • myStream_200 (200k bps total bitrate)

  • myStream_350 (350 kbps total bitrate)

  • myStream_700 (700 kbps total bitrate)

Create a SMIL file for live streams 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, select your live application, 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

    Wowza Streaming Engine adds the SMIL file and appends the .smil file extension to the file name.

  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: 200 kbps * 1000 = 200000 bps.

    • 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. In the Applications content panel, select your live application, click SMIL Files, and then click the Connect icon for myStream.smil.

  1. image

  1. In the Connect a SMIL File dialog box, select the Application Name and Application Instance. MediaCaster Type is not required for live streaming.

    image

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

Create a SMIL file for live streams 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.

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

VOD adaptive bitrate streaming

Use one of the following workflows to create a SMIL file for VOD adaptive bitrate streaming:

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

Create a SMIL file for VOD streams 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, select your application, 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

    Wowza Streaming Engine adds the SMIL file and appends the .smil file extension to the file name.

  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: 450 kbps * 1000 = 450000 bps.

    • 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. To test the SMIL file with adaptive bitrate functionality, see Test playback.

Create a SMIL file for VOD streams 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:

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

Configure edge servers for adaptive bitrate streaming


If you're streaming using a repeater configuration, after creating the SMIL file, you must copy it to all edge servers in your live stream repeater network.
 
  1. If you haven't done so already, configure the edge servers in your live repeater configuration. For more information about configuring live stream repeater applications, see the Wowza edge section in Configure a live stream repeater in Wowza Streaming Engine.
     
  2. Create the liveedge application.
    1. In the Applications contents panel, click Add Application, and then click the Live Edge application type.
       
    2. In the New Application dialog box, name the new application and then click Add.
       
    3. The application page is displayed. Configure the Playback Types and enter a Primary Origin URL.
  3. Copy the SMIL file created above to the edge server's [install-dir]/content folder.
     
  4. Repeat for each edge server.

Test 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. By default, the source of the stream is the SMIL file in the default content store: [install-dir]/content.

Notes:
  • Adaptive bitrate playback is only supported for HTTP-based streams.
     
  • In the following URLs, [address] is the domain name of the server running Wowza Streaming Engine. When testing playback from an edge server in a live stream repeater configuration, [address] is the domain name of an edge server running Wowza Streaming Engine.

In playback URLs for SMIL files, the stream name includes the .smil file extension.

For live adaptive bitrate streaming playback, to use the HLS protocol to play myStream for example, use the following playback URL:

http://[address]:1935/myApplication/smil:myStream.smil/playlist.m3u8

For VOD adaptive bitrate streaming playback, to use the HLS protocol to play the bigbuckbunny VOD files for example, use the following playback URL:

http://[address]:1935/myApplication/smil:bigbuckbunny.smil/playlist.m3u8

To play your stream, enter the playback URL into your player or a mobile browser, depending on the playback type. To learn more about stream playback, see the Players and Playback articles.

You can also test playback using the Video Test Players webpage. Select the tab for the protocol you want to test and enter the playback URL above the player. Entering the server (IP address or domain name), stream name, application name, and application type (VOD or live) will also generate the playback URLs for each protocol. Click Start to play your stream, and then click Stop when you're ready to end your test.

Other considerations


  • When streaming out using RTSP/RTP, you can force the output to MPEG-TS, which is required by many set-top boxes. For more information, see Generate and control MPEG-TS output for set-top boxes in Wowza Streaming Engine.
  • Wowza Streaming Engine can output AAC audio using the mpeg4-generic and mp4a-latm (3gpp) packetization methods. The default packetization method is mpeg4-generic. To switch to mp4a-latm (3gpp), add the audioPacketizerAAC property:
     
    • Wowza Streaming Engine Manager - In Wowza Streaming Engine Manager, add a custom property to the application with the following information. For details on how to configure custom properties, see Configure properties.
       
      Path
      Name
      Type
      Value
      /Root/Application/HTTPStreamer audioPacketizerAAC String com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM
    • Text editor - Open [install-dir]/conf/[application-name]/Application.xml in a text editor and add the following property to the <RTP>/<Properties> container (be sure to get the correct <Properties> container - there are several in the Application.xml file):
      <Property>
          <Name>audioPacketizerAAC</Name>
          <Value>com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM</Value>
      </Property>
  • JW Player and Flowplayer use a client-side XML file to reference each stream rendition, not the server-side SMIL file that's shown in this article.

More resources