Publish a video file as a live stream with Wowza Streaming Engine

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

  1. Open WSE Manager.
  2. Select the Server tab.
  3. In the contents panel, select Server Setup.
  4. Select the Server Listeners tab.
  5. Click Edit.
  6. Click + Add Server Listener.
  7. In the Base Class input field, enter com.wowza.wms.module.ServerListenerStreamDemoPublisher.
  8. Click + Add.
  9. Restart the server to apply the changes.

Add a server listener to Server.xml 

  1. Open your server's [install-dir]/conf/Server.xml file.
  2. Navigate the the <ServerListeners> list.
  3. Add the following <ServerListener> to the list of server listeners.
    <ServerListener>
        <BaseClass>com.wowza.wms.module.ServerListenerStreamDemoPublisher</BaseClass>
    </ServerListener>

  4. 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>


  5. Configure any of the following additional settings:
    • appName: The app's name. (Format: application/appInstance, with appInstance optional.)
    • dstStream: The destination stream name.
    • playlistRepeat: If true, the file or playlist is repeated.
    • publishDuration: The stream's publish duration, in seconds. (Format: HH:MM:SS.mmm.)
    • publishRepeat: Set to true to re-published the stream in a loop after the publishDuration time has elapsed. (Default: false.) Note: The publishDuration must 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: The publishRepeat must be enabled for this value to take effect.
    • random: Set to true to stream the items of an M3U8 playlist in random order.
    • sendOnMetadata: Set to true to instruct the publisher to send onMetadata events. 
    • 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.

  6. Restart the server for all configuration changes to take effect.
  7. 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>