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.
- 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:
- Create a SMIL file for live streams using Wowza Streaming Engine Manager
- Create a SMIL file for live streams using a text editor
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.
-
In the Applications content panel, select your live application, click SMIL Files, and then click Add SMIL File.
-
In the Add SMIL File dialog box, enter a name for the new SMIL file, and click Add. (The title is optional.)
Wowza Streaming Engine adds the SMIL file and appends the .smil file extension to the file name.
-
On the myStream.smil page, click Add SMIL Stream.
-
In the Add SMIL Stream dialog box, select the video stream type, and click Add.
The new SMIL stream page is displayed.
-
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.
-
-
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
-
In the Applications content panel, select your live application, click SMIL Files, and then click the Connect icon for myStream.smil.
-
In the Connect a SMIL File dialog box, select the Application Name and Application Instance. MediaCaster Type is not required for live streaming.
-
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.
-
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:
- Create a SMIL file for VOD streams using Wowza Streaming Engine Manager
- Create a SMIL file for VOD streams using a text editor
Note: The procedures in this section assume you have the four VOD files encoded at different bitrates:
- bigbuckbunny_450.mp4 (450 kbps total bitrate)
- bigbuckbunny_750.mp4 (750 kbps total bitrate)
- bigbuckbunny_1100.mp4 (1100 kbps total bitrate)
- bigbuckbunny_1500.mp4 (1500 kbps total bitrate)
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.
-
In the Applications content panel, select your application, click SMIL Files, and then click Add SMIL File.
-
In the Add SMIL File dialog box, enter a name for the new SMIL file, and then click Add. (The title is optional.)
Wowza Streaming Engine adds the SMIL file and appends the .smil file extension to the file name.
-
On the bigbuckbunny.smil page, click Add SMIL Stream.
-
In the Add SMIL Stream dialog box, select the video stream type, and then click Add.
The new SMIL stream page is displayed.
-
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.
-
-
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
-
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.
-
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:
Here is a set of lower-bitrate sample files suitable for mobile streaming. These sample files are properly encoded with aligned keyframes for adaptive bitrate streaming. You can use the above procedures to create an adaptive bitrate stream using these files but you must substitute the correct values in the SMIL file configuration.
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.
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.
- 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.
- Create the liveedge application.
- In the Applications contents panel, click Add Application, and then click the Live Edge application type.
- In the New Application dialog box, name the new application and then click Add.
- The application page is displayed. Configure the Playback Types and enter a Primary Origin URL.
- In the Applications contents panel, click Add Application, and then click the Live Edge application type.
- Copy the SMIL file created above to the edge server's [install-dir]/content folder.
- 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.
- 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 page. From the Test Playback modal in Wowza Streaming Engine Manager:
- Enter the server IP address or domain name.
- Select a VOD or live application from the Application dropdown.
- Specify a Stream (for live applications) or a Media File Name (for VOD applications).
- Select a Playback Type option to identify the protocol.
- Based on your input, the playback URL is automatically generated in the Streaming URL section.
- To deliver your stream securely, enable the Secure URL checkbox.
- Copy the generated playback URL and paste it above the player on the Video Test Players page.
- Click Start to play your stream or Stop when you're ready to end your test.