• How to create and play SMIL files with streams created by Wowza Transcoder

    The transcoding feature in Wowza Streaming Engine media server software is designed to make live adaptive bitrate delivery over HTTP easy. The Transcoder can ingest a single high bitrate live stream and create multiple lower-bitrate renditions on the fly, which are keyframe-aligned for adaptive bitrate delivery. Synchronized Multimedia Integration Language (SMIL) files enable you to group the high bitrate stream and the new renditions together in logical groups for live adaptive bitrate delivery.

    This article explains how to use a SMIL file with transcoded or transrated streams created by Wowza Transcoder.

    Contents


    About Stream Name Groups and SMIL files
    Create an application to transcode the stream (origin server)
    Create a SMIL file
    Configure edge servers
    Playback
    Special considerations
    More resources

    About Stream Name Groups and SMIL files


    The Wowza Transcoder templating system provides a method to group streams together in logical groups called Stream Name Groups for live adaptive bitrate delivery. 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 Wowza 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, as described in this article.

    Notes:
    • For use with Wowza Streaming Engine™ and Wowza Media Server™ 3 software.

    • 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 Wowza Transcoder. For more information, see Adaptive bitrate streaming with Stream Name Groups.

    • For adaptive bitrate playback from an edge server in a live stream repeater configuration or from a Wowza Media Server instance, you must use a SMIL file, as described in this article. For more information, see How to configure a live stream repeater.

    Create an application to transcode the stream (origin server)


    First, you must create a live application to receive and transcode the live stream. If you're using a live stream repeater, do this on the origin server. See How to set up and run Wowza Transcoder for live streaming.

    Create a SMIL file


    Next, you must create the SMIL file. Use one of the following methods:

    • Wowza Streaming Engine Manager method - You can use the SMIL Files feature in Wowza Streaming Engine Manager. The SMIL file must be configured in a live application (not at the VHost level). See Wowza Streaming Engine Manager method, below.

    • Text editor method - You can use a text editor to create a SMIL file, making sure the editor doesn't append the .txt file extension to the file name. See Text editor method, below.

    • HTTP Provider method - The third option, only recommended for advanced users, is to use an HTTP Provider to automatically generate the SMIL file. For more information, see How to generate a SMIL file with an HTTP Provider.

    Wowza Streaming Engine Manager method

    If you're running a Wowza Streaming Engine instance, the easiest way to create a SMIL file is using the SMIL Files feature in Wowza Streaming Engine Manager.

    Notes:
    • You can also start the procedure to create a SMIL file in the Server contents panel.

    • If your stream name is myStream and you're using the sample template transrate.xml, the two new streams that are created by Wowza Transcoder are named myStream_360p and myStream_160p.
    1. In the Applications contents panel, click live, click SMIL Files, and then click Add SMIL File.



    2. In the Add SMIL File dialog box, enter a name for the new SMIL file (for example, myStream), and then click Add. The .smil file extension is automatically added to the name you enter.



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



    4. In the Add SMIL Stream dialog box, select the video stream type, and then click Add. The new SMIL stream page is displayed. Enter stream information using the names and values defined in transrate.xml, and then click Add. For example, enter the following for myStream_360p:

      • Source (src): Enter myStream_360p. This must be the name of the encoded stream.

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

      • Video Bitrate: Enter 850000. This is the total encoded bitrate value for the video, in bits-per-second. To get this value, you must multiply the encoded bitrate value in kilobits-per-second by 1000. For this stream: 850kbps * 1000 = 850000bps.

      • Video Width and Video Height: Enter 640 and 360 into the respective fields. This is the encoded size of the video, in pixels.

      • Audio Bitrate: Enter the encoded bitrate for the audio that's included with the video.



    5. Repeat steps 3 - 4 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
      myStream_160p 200000 284 160

      Note: The transrate.xml template has two more <Encode> blocks, one defined for a 720p rendition and the other for a 240p rendition. By default, the <Enable> flag is set to false so that these two streams won't be generated. Change the <Enable> flag to true to enable these additional streams. Use the following details to add these streams to a SMIL file:

      Source (src) Video Bitrate Video Width Video Height
      myStream_240p 350000 320 240
      myStream_720p 700000 1272 720
    6. 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 about how the live application is configured and about how to create a live application for your purposes, see How to set up live streaming using an RTMP-based encoder.

    7. To test the SMIL file with adaptive bitrate functionality, see Playback.

    Text editor method

    It isn't necessary to create a SMIL file using the text editor method if you already created a SMIL file in Wowza Streaming Engine Manager.

    To create a SMIL file for Wowza Streaming Engine using the text editor method:

    1. Using a text editor, create a SMIL file (for example, myStream.smil) in the [install-dir]/content folder. Make sure that your editor doesn't append the .txt file extension to the file name.

    2. Enter stream information using the names and values defined in transrate.xml. The following is a simple 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"/>
                             <param name="videoCodecId" value="avc1.4d401f" valuetype="data"/>
                             <param name="audioCodecId" value="mp4a.40.2" 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"/>
                             <param name="videoCodecId" value="avc1.4d401f" valuetype="data"/>
                             <param name="audioCodecId" value="mp4a.40.2" 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"/>
                             <param name="videoCodecId" value="avc1.428015" valuetype="data"/>
                             <param name="audioCodecId" value="mp4a.40.2" valuetype="data"/>
                     </video>
             </switch>
      </body>
      </smil>
      There's a <video> entry in the <switch> container for each stream rendition. The audioBitrate value is set to the total bitrate (in bits-per-second) for that stream's audio, the videoBitrate value is set to the total bitrate (in bits-per-second) for that stream's video, and the system-bitrate value is set to the total bitrate (in bits-per-second) for that stream. The audioCodecId and videoCodecId entries are optional.

    Notes:
    • Wowza Media Server™ 3 software users must use either the text editor method described in this article or the HTTP Provider method to create a SMIL file with the following syntax, where the system-bitrate value is set to the total bitrate (in bits-per-second) for that stream:
      <smil>
      	<head>
      	</head>
      	<body>
      		<switch>
      			<video src="myStream_source" system-bitrate="1496608"/>
      			<video src="myStream_360p" system-bitrate="850000"/>
      			<video src="myStream_160p" system-bitrate="200000"/>
      		</switch>
      	</body>
      </smil>
    • The transrate.xml template has two more <Encode> blocks, one defined for a 720p rendition and the other for a 240p rendition. By default, the <Enable> flag is set to false so that these two streams won't be generated and won't be available to players. Change the <Enable> flag to true to enable these additional streams.

    Configure edge servers


    After creating the SMIL file using one of the methods listed above, you must copy it to all edge servers in your live stream repeater network for adaptive bitrate delivery.

    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 How to configure a live stream repeater.

    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.

    Playback


    The following examples demonstrate how players use the SMIL file to playback the multiple bitrate renditions. You can test playback using the test players built in to Wowza Streaming Engine, as described below, or you can use the Wowza Test Players.

    Notes:
    • Adaptive bitrate playback is only supported for HTTP-based streams.

    • The Wowza Streaming Engine Manager examples are for edge servers only. For playback from an origin server, use NGRP and the examples in Adaptive bitrate streaming with Stream Name Groups.

    Adobe Flash Player (Adobe HDS/San Jose)

    In Streaming Engine Manager, click Test Players in the upper-right corner of the liveedge application page. The Test Players window that opens includes test players that are preconfigured to stream the live stream named myStream over various streaming formats. To use the Adobe HDS protocol to play myStream, click the Adobe HDS tab, enter the following URL information, and then click Start.
    http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/manifest.f4m

    Apple iOS device (Apple HLS/Cupertino)

    In Streaming Engine Manager, click Test Players in the upper-right corner of the liveedge application page. The Test Players window that opens includes test players that are preconfigured to stream the live stream named myStream over various streaming formats. To use the Apple HLS protocol to play myStream, click the Apple HLS tab, and then enter the following URL that appears on the tab into the Safari web browser on the device.
    http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/playlist.m3u8

    Microsoft Silverlight (Smooth Streaming)

    In Streaming Engine Manager, click Test Players in the upper-right corner of the liveedge application page. The Test Players window that opens includes test players that are preconfigured to stream the live stream named myStream over various streaming formats. To use the Microsoft Smooth Streaming protocol to play myStream, click the MS Smooth tab, enter the following URL information, and then click Start.
    http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/Manifest

    MPEG-DASH

    In Streaming Engine Manager, click Test Players in the upper-right corner of the liveedge application page. The Test Players window that opens includes test players that are preconfigured to stream the live stream named myStream over various streaming formats. To use the MPEG DASH protocol to play myStream, click the MPEG DASH tab, enter the following URL information, and then click Start.
    http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/manifest.mpd

    Special considerations


    • Dynamic streaming for Adobe Flash requires a fair amount of work on the client-side. The following articles provide details about how to achieve dynamic streaming in Flash:


    • When streaming using Adobe HDS, it's best to turn on dynamic stream markers, which will 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.

      See Also:


    • 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="myStream_160p" system-bitrate="196608"/>
             </switch>
      </body>
      </smil>
      Note: The <audio> item is ignored when streaming using Adobe HDS (San Jose), Apple HLS (Cupertino), 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 media 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>

    • 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 How to generate and control MPEG-TS output for set-top boxes.

    • A Wowza media server 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>

    More resources




    Originally Published: 10-08-2011.
    Updated: for Wowza Streaming Engine on 05-02-2016.

    If you're having problems or want to discuss this article, post in our forum.