Publish a video-on-demand (VOD) file as a live stream using the Wowza Streaming Engine (WSE) ServerListenerStreamDemoPublisherserver listener. Once the listener is enabled, the VOD file will loop on repeat until terminated. This static setup is a basic flow, for a more dynamic solution, you may want to:
Publish a VOD file as a live stream
You can set up a Wowza Streaming Engine (WSE) server instance to publish a VOD file as a live stream using WSE Manager or by editing the server's Server.xml configuration file.
Add a server listener using WSE Manager
- Open WSE Manager.
- Select the Server tab.
- In the contents panel, select Server Setup.
- Select the Server Listeners tab.
- Click Edit.
- Click + Add Server Listener.
- In the Base Class input field, enter
com.wowza.wms.module.ServerListenerStreamDemoPublisher. - Click + Add.
- Restart the server to apply the changes.
Add a server listener to Server.xml
- Open your server's
[install-dir]/conf/Server.xmlfile. - Navigate the the
<ServerListeners>list. - Add the following
<ServerListener>to the list of server listeners.<ServerListener> <BaseClass>com.wowza.wms.module.ServerListenerStreamDemoPublisher</BaseClass> </ServerListener> - Add the following property to the
<Properties>container at the bottom of the file.<Property> <Name>streamDemoPublisherConfig</Name> <Value>appName=myApplication,srcStream=mp4:sample.mp4,dstStream=myStream,sendOnMetadata=true</Value> </Property>
- Configure any of the following additional settings:
appName: The app's name. (Format:application/appInstance, withappInstanceoptional.)dstStream: The destination stream name.playlistRepeat: Iftrue, the file or playlist is repeated.publishDuration: The stream's publish duration, in seconds. (Format:HH:MM:SS.mmm.)publishRepeat: Set totrueto re-published the stream in a loop after thepublishDurationtime has elapsed. (Default:false.) Note: ThepublishDurationmust be greater than zero for this value to take effect.publishPauseTime: The time the stream pauses before being republished, in seconds. The default is 1 second. (Format:HH:MM:SS.mmm.) Note: ThepublishRepeatmust be enabled for this value to take effect.random: Set totrueto stream the items of an M3U8 playlist in random order.sendOnMetadata: Set totrueto instruct the publisher to sendonMetadataevents.speed: A floating point value for the playback speed. Can be negative. (Default:1.0.)srcStream: The name of video file to stream as live content (MP4, MP3, and M3U8 files are supported).timeBetweenItems: The time between playlist items, in milliseconds. (Default:80.)vhostName: The vhost's name. If omitted, the stream will be created for all vhosts.
- Restart the server for all configuration changes to take effect.
- Use a test player to verify the stream is playing properly. For more information, see Test playback.
Configuration examples
- Publish multiple live streams by adding them to the property value as a list of entries delimited by the pipe (|) character. For example:
<Property> <Name>streamDemoPublisherConfig</Name> <Value>appName=myApplication,srcStream=mp4:sample.mp4,dstStream=myStream,sendOnMetadata=true|appName=myApplication,srcStream=mp4:sample.mp4,dstStream=myStream2,sendOnMetadata=true</Value> </Property>
- Publish a playlist of files by creating a text file in the [install-dir]/content folder with the .m3u8 file extension. This file should contain simple streams names on each line like this (for this example we will use the file name filelist.m3u8):
mp4:sample.mp4 mp4:file2.mp4 mp4:file3.mp4
- To play this playlist, use a streamDemoPublisherConfig value like this:
<Property> <Name>streamDemoPublisherConfig</Name> <Value>appName=myApplication,srcStream=m3u8:filelist.m3u8,dstStream=myStream,random=false,timeBetweenItems=250</Value> </Property>
- Configure a stream to play for 10 seconds, pause for 2 seconds, and then repeat, use a streamDemoPublisherConfig value like this:
<Property> <Name>streamDemoPublisherConfig</Name> <Value>appName=myApplication,srcStream=mp4:sample.mp4,dstStream=myStream,random=true,publishDuration=10,publishRepeat=true,publishPauseTime=2</Value> </Property>




