Dynamically created SMIL for VOD and Live Streams

We recently published an article outlining how to get some meta data from VOD files for use with the AMLST extension and although reasonably useful we have recently been furnished with a significantly better approach and decided to build a full solution to share.

When using adaptive bitrate streams , so multiple files or live streams, in accordance with the Wowza Streaming Engine a SMIL file needs to be created that outlines the file/stream names and the capabilities of each entry – so bitrate, codec etc.

For many deployments the naming scheme used for multiple bitrate files/streams falls under the following format


An example for on demand stream would be


An example for live streams would be


In both cases the sample or myStream part may change, but the _700,_1100,_1500 or _1,_2 would remain the same across other files. To this end we have designed a template which allows you to describe the entries that are expected but at a minimum level.

An example of the template is as follows

	<Rendition name="%s_1" />
	<Rendition name="%s_2" />

This template shows two entries, called Rendition, and their name is described as %s_1 or %s_2. The %s denotes the stream name used in the AMLST request and is substituted when the request is made.

We have made the template system also dynamic so you can describe one for general use called


or one for specific stream name used called, where <stream name> is the AMLST stream name requested

<stream name>_template.xml

These should be placed in the StorageDir location as described in the Application.xml for the application in used, commonly content/ in your Wowza Streaming Engine installation.

The stream name specific one is looked for first and if not found then the generic one is looked for. If neither are found an error is returned.

An example here is

This would look for a template called myStream_template.xml, if not found then look for amlst_template.xml in the StorageDir of the Application live.

When the template has been found and depending on the type of application in use, live or on demand, then the files/streams being requested have their information pulled together and pushed into the AMLST output.

Using the above references the request would look for two streams

myStream_1 and myStream_2

The two streams have the following characteristics from the encoder

myStream_1 – 640×300,1Mbps Video – 96Kbps – MP3 Audio
myStream_2 – 320×200,500Kbps Video – 96Kbp – MP3 Audio

The resulting output when doing the AMLST request for Apple HLS (Cupertino would be)


The template system also allows other attributes to be added per rendition and these are


These can be applied as follows

	<Rendition name="%s_1" language="en" />
	<Rendition name="%s_2" type="audioonly" />

This would produce a Apple HLS output of


You should notice the ‘GROUP-ID’ has been set to ‘default’ which is the case if no groupname is specified.

To use the module with this functionality add the following Module entry as the last Module in the Modules list within your Application.xml


It does of course work with other HTTP Streaming protocols as it is using the AMLST extension. You do need to copy the template files into the StorageDir of the application you are using and edit them as needed.

They can be downloaded here, along with the source and compiled jar file.

Comments are closed.