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

How to create and play SMIL files with streams created by Wowza
Transcoder
Orig in ally Pu b lish ed on [article("d ate_p u b lish ed ")] | Up d ated on 03/06 /2017 11:55 am PST
The transcoding f eature in Wowza Streaming Engine media server sof tware 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 f ly, which are keyf rame-aligned f or adaptive bitrate delivery. Synchronized Multimedia Integration Language (SMIL) f iles
enable you to group the high bitrate stream and the new renditions together in logical groups f or live adaptive bitrate
delivery.
This article explains how to use a SMIL f ile with transcoded or transrated streams created by Wowza Transcoder.
Contents
About Stream Name Groups and SMIL f iles
Create an application to transcode the stream (origin server)
Create a SMIL f ile
Wowza Streaming Engine Manager method
Text editor method
Conf igure 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 f or live adaptive bitrate delivery. Stream Name Groups and SMIL f iles serve the same purpose, and either
method can be used f or adaptive bitrate playback of live streams in most conf igurations. However, in some conf igurations,
such as edge servers in a live stream repeater (origin/edge) conf iguration, Stream Name Groups can't be used. In a live
stream repeater conf iguration, 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 f ile must be used instead f or 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 f or live streaming.
Create a SMIL file
Next, you must create the SMIL f ile. Use one of the f ollowing methods:
Wowza Streaming Engine Manager method - You can use the SMIL Files f eature in Wowza Streaming Engine Manager.
The SMIL f ile must be conf igured in a live application (not at the VHost level). See Wowza Streaming Engine Manager
method, below.
T ext editor method - You can use a text editor to create a SMIL f ile, making sure the editor doesn't append the .txt
f ile extension to the f ile name. See Text editor method, below.
HT T P Provider method - The third option, only recommended f or advanced users, is to use an HTTP Provider to
automatically generate the SMIL f ile. For more inf ormation, see How to generate a SMIL f ile 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 f ile is using the SMIL Files f eature 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 f or the new SMIL f ile (f or example, myStream), and then click Add. The
.smil f ile 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 inf ormation using the names and values def ined in transrate.xml, and then click Add. For
example, enter the f ollowing f or 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 f or 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 f ields. This is the encoded size of the
video, in pixels.
Audio Bitrate: Enter the encoded bitrate f or the audio that's included with the video.
5. Repeat steps 3 - 4 f or the remaining video streams. Use the f ollowing table f or inf ormation 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 blocks, one defined for a 720p rendition and the other
for a 240p rendition. By default, the flag is set to false so that these two streams won't be generated.
Change the 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. Conf igure a live application to deliver the SMIL f ile and media content to client players. You can use the preconf igured
live application to stream adaptive bitrate content. For inf ormation about how the live application is conf igured and
about how to create a live application f or your purposes, see How to set up live streaming using an RTMP-based
encoder.
7 . To test the SMIL f ile with adaptive bitrate f unctionality, see Playback.
Text editor method
It isn't necessary to create a SMIL f ile using the text editor method if you already created a SMIL f ile in Wowza Streaming
Engine Manager.
To create a SMIL f ile f or Wowza Streaming Engine using the text editor method:
1. Using a text editor, create a SMIL f ile (f or example, myStream.smil) in the [install-dir]/content f older. Make sure that
your editor doesn't append the .txt f ile extension to the f ile name.
2. Enter stream inf ormation using the names and values def ined in transrate.xml. The f ollowing is a simple example:
There's a entry in the container f or each stream rendition. The audioBitrate value is set to the total bitrate (in bitsper-second) f or that stream's audio, the videoBitrate value is set to the total bitrate (in bits-per-second) f or that
stream's video, and the system-bitrate value is set to the total bitrate (in bits-per-second) f or 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:
The transrate.xml template has two more blocks, one defined for a 720p rendition and the other for a
240p rendition. By default, the flag is set to false so that these two streams won't be generated and
won't be available to players. Change the flag to true to enable these additional streams.
Configure edge servers
Af ter creating the SMIL f ile using one of the methods listed above, you must copy it to all edge servers in your live stream
repeater network f or adaptive bitrate delivery.
1. If you haven't done so already, conf igure the edge servers in your live repeater conf iguration. For more inf ormation
about conf iguring live stream repeater applications, see the Wowza edge section in How to conf igure a live stream
repeater.
2. Create the liveedge application.
a. In the Applications contents panel, click Add Application, and then click the Live Edge application type.
b. In the New Application dialog box, name the new application liveedge, and then click Add.
c. The liveedge page is displayed. Conf igure the Playback T ypes and enter a Primary Origin URL.
3. Copy the SMIL f ile created above to the edge server's [install-dir]/content f older.
4. Repeat f or each edge server.
Playback
The f ollowing examples demonstrate how players use the SMIL f ile 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 T est Players in the upper-right corner of the liveedge application page. The T est
Players window that opens includes test players that are preconf igured to stream the live stream named myStream over
various streaming f ormats. To use the Adobe HDS protocol to play myStream, click the Adobe HDS tab, enter the f ollowing
URL inf ormation, 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 T est Players in the upper-right corner of the liveedge application page. The T est
Players window that opens includes test players that are preconf igured to stream the live stream named myStream over
various streaming f ormats. To use the Apple HLS protocol to play myStream, click the Apple HLS tab, and then enter the
f ollowing URL that appears on the tab into the Saf ari 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 T est Players in the upper-right corner of the liveedge application page. The T est
Players window that opens includes test players that are preconf igured to stream the live stream named myStream over
various streaming f ormats. To use the Microsof t Smooth Streaming protocol to play myStream, click the MS Smooth tab,
enter the f ollowing URL inf ormation, and then click Start.
http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/Manifest
MPEG-DASH
In Streaming Engine Manager, click T est Players in the upper-right corner of the liveedge application page. The T est
Players window that opens includes test players that are preconf igured to stream the live stream named myStream over
various streaming f ormats. To use the MPEG DASH protocol to play myStream, click the MPEG DASH tab, enter the
f ollowing URL inf ormation, and then click Start.
http://[wowza-edge-address]:1935/liveedge/smil:myStream.smil/manifest.mpd
Special considerations
Dynamic streaming f or Adobe Flash requires a f air amount of work on the client-side. The f ollowing 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 will provide more accurate onthe-f ly 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 f ollowing inf ormation. For details on how to conf igure custom properties, see Conf igure
properties.
Path
Name
T ype
/Root/Application/Streams
enableDynamicStreamMarkers
Boolean
Value
true
T ext editor - Open [install-dir]/conf/[application]/Application.xml in a text editor and add the f ollowing
property to the / container (be sure to get the correct container - there are several in the Application.xml f ile):
enableDynamicStreamMarkers
true
Boolean
JW Player and Flowplayer use a client-side XML f ile to ref erence each stream rendition, not the server-side SMIL f ile
that's shown in this article. They both also use the BWCheck module.
See Also:
JW Player Dynamic RTMP Streaming
Flowplayer Dynamic Streaming
Microsof t Smooth Streaming only switches between the video portion of the f ile. The audio track in the f irst stream
listed in the container is used. If you want to use the audio track f rom a dif f erent stream than the one specif ied in the
f irst entry in the container, add an entry to the container f or that item. For example:
Note: The item is ignored when streaming using Adobe HDS (San Jose), Apple HLS (Cupertino), or MPEGDASH streaming.
By def ault Microsof t Smooth Streaming calculates video and audio bitrates f or the manif est data on-the-f ly by
inspecting the stream. If you want to conf igure your Wowza media server to use the bitrates in the SMIL f ile, add the
smoothStreamingUseSMILBitrates property:
Wowza Streaming Engine Manager - In Wowza Streaming Engine Manager, add a custom property to the
application with the f ollowing inf ormation. For details on how to conf igure custom properties, see Conf igure
properties.
Path
Name
T ype
/Root/Application/HTTPStreamer
smoothStreamingUseSMILBitrates
Boolean
Value
true
T ext editor - Open [install-dir]/conf/[application]/Application.xml in a text editor and add the f ollowing
property to the / container (be sure to get the correct container - there are several in the Application.xml f ile):
smoothStreamingUseSMILBitrates
true
Boolean
When streaming out using RTSP/RTP, you can f orce the output to MPEG-TS, which is required by many set-top boxes.
For more inf ormation, see How to generate and control MPEG-TS output f or set-top boxes.
A Wowza media server can output AAC audio using the mpeg4-generic and mp4a-latm (3gpp) packetization methods.
The def ault 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 f ollowing inf ormation. For details on how to conf igure custom properties, see Conf igure
properties.
Path
Name
T ype
Value
/Root/Application/HTTPStreamer
audioPacketizerAAC
String
com.wowza.wms.rtp.packetizer.RT PPacketizerMPEG4LAT M
T ext editor - Open [install-dir]/conf/[application]/Application.xml in a text editor and add the f ollowing
property to the / container (be sure to get the correct container - there are several in the Application.xml f ile):
audioPacketizerAAC
com.wowza.wms.rtp.packetizer.RTPPacketizerMPEG4LATM
More resources
How to do adaptive bitrate streaming
How to set up and run Wowza Transcoder f or live streaming
How to conf igure a live stream repeater
How to generate a SMIL f ile with an HTTP Provider
Originally Published: 10-08-2011.
Updated: f or Wowza Streaming Engine on 05-02-2016.
If you're having problems or want to discuss this article, post in our f orum.