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, 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

    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. 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 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, 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

    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. 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 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 liveedge, and then click Add.
       
    3. The liveedge 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


The following examples demonstrate how players use the SMIL file to play the multiple bitrate renditions.

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. The URL syntax varies depending on the type of player. If you use the installed live or vod applications, 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, [wowza-ip-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, [wowza-ip-address] is the domain name of an edge server running Wowza Streaming Engine.

Live adaptive bitrate streaming playback

You can test playback using the Video Test Players webpage. To play myStream, click the tab for the protocol, enter the URL for the protocol, and then click Start.

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

Smooth Streaming

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

HDS

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

VOD adaptive bitrate streaming playback

You can test playback using the Video Test Players webpage. To play the bigbuckbunny example VOD files, click the tab for the protocol, enter the URL for the protocol, and then click Start.

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

Smooth Streaming

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

HDS

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

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]/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>
  • Dynamic streaming for Adobe Flash requires a fair amount of work on the client side. The following Adobe articles provide details about how to achieve dynamic streaming in Flash:
  • Dynamic streaming in Flash (Part 1)
  • Dynamic streaming in Flash (Part 2)
  • Dynamic streaming in Flash (Part 3)
  • When streaming using Adobe HDS, it's best to turn on dynamic stream markers, which provide more accurate on-the-fly bitrate calculations (in most cases). To turn on dynamic stream markers, add the enableDynamicStreamMarkers 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/Streams enableDynamicStreamMarkers Boolean true
    • Text editor - Open [install-dir]/conf/[application]/Application.xml in a text editor and add the following property to the <Streams>/<Properties> container (be sure to get the correct <Properties> container - there are several in the Application.xml file):
      <Property>
          <Name>enableDynamicStreamMarkers</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </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. They both also use the BWCheck module. For more information, see JW Player Dynamic RTMP Streaming and Flowplayer Dynamic Streaming.
  • Microsoft Smooth Streaming only switches between the video portion of the file. The audio track in the first stream listed in the <switch> container is used. If you want to use the audio track from a different stream than the one specified in the first <video> entry in the <switch> container, add an <audio> entry to the <switch> container for that item. For example:

    <smil>
    <head></head>
    <body>
        <switch>
            <video src="mp4:myStream_source" system-bitrate="2270208" width="1280" height="720">
                <param name="audioBitrate" value="196608" valuetype="data"/>
                <param name="videoBitrate" value="2073600" valuetype="data"/>
            </video>
            <video src="mp4:myStream_360p" system-bitrate="1046608" width="640" height="360">
                <param name="audioBitrate" value="196608" valuetype="data"/>
                <param name="videoBitrate" value="850000" valuetype="data"/>
            </video>
            <video src="mp4:myStream_160p" system-bitrate="396608" width="284" height="160">
                <param name="audioBitrate" value="196608" valuetype="data"/>
                <param name="videoBitrate" value="200000" valuetype="data"/>
            </video>
            <audio src="mp4:myStream_160p">
                <param name="audioBitrate" value="196608" valuetype="data"/>
                <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
            </audio>
        </switch>
    </body>
    </smil>
    Note: The <audio> item is ignored when streaming using Adobe HDS (San Jose) or MPEG-DASH streaming.
  • By default, Microsoft Smooth Streaming calculates video and audio bitrates for the manifest data on-the-fly by inspecting the stream. If you want to configure your Wowza Streaming Engine server to use the bitrates in the SMIL file, add the smoothStreamingUseSMILBitrates 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 smoothStreamingUseSMILBitrates Boolean true
    • Text editor - Open [install-dir]/conf/[application]/Application.xml in a text editor and add the following property to the <HTTPStreamer>/<Properties> container (be sure to get the correct <Properties> container - there are several in the Application.xml file):
      <Property>
          <Name>smoothStreamingUseSMILBitrates</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
      </Property>

More resources