Set up a Wowza Streaming Engine live stream repeater for nDVR

You can use nDVR with a Wowza Streaming Engine™ media server software deployment that's configured for live stream repeating. To do so, you must run Wowza Streaming Engine on both the origin and edge servers and then configure each server to use nDVR.

Important: All origin and edge servers in the live stream repeating configuration must run the same version of Wowza Streaming Engine software. Versions can't be mixed.

About nDVR with live stream repeating


Live stream repeating is a method of delivering a single live stream across multiple servers to many viewers. It uses an origin/edge configuration where the source stream is published to an origin server and then delivered for playback on multiple edge servers.

When combined with nDVR, chunks are recorded on the origin server. nDVR repeats the playlist information from origin to edge. It then serves audio and video chunks over HTTP from the edge. 

Configure the origin server 


Configure a Wowza Streaming Engine live application on the origin server. In this example, the application is named dvrorigin.

  1. Open the Application.xml file for the origin application in a text editor ([install-dir]/conf/dvrorigin/).
  2. Set the <Streams>/<StreamType> property value to live, rtp-live, or a variant. For example:
<StreamType>live</StreamType>
  1. Set the <Streams>/<LiveStreamPacketizers> property value to:
<LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>

This setting means that DVR streams originate from a recorded store on this Wowza origin server. To allow live streaming for this application in addition to DVR streaming, you can add additional packetizers. For example:

<LiveStreamPacketizers>dvrstreamingpacketizer,cupertinostreamingpacketizer,mpegdashstreamingpacketizer</LiveStreamPacketizers>
  1. Set the <DVR>/<Recorders> property value to:
<Recorders>dvrrecorder</Recorders>
  1. Set the <DVR>/<Store> property value to:
<Store>dvrfilestorage</Store>
  1. Set the <DVR>/<WindowDuration>, <DVR>/<ArchiveStrategy>, and <DVR>/<StorageDir> property values as desired. For more information, see Configure advanced properties for nDVR in Wowza Streaming Engine.
  2. Set the <HTTPStreamers> property value to:
<HTTPStreamers>dvrchunkstreaming</HTTPStreamers>

This enables the origin to stream DVR audio and video chunks to the edge servers. 

Configure the edge server(s)


Configure a Wowza Streaming Engine live application on each edge server. In this example, the application is named dvredge.

  1. Open the Application.xml file for the edge application in a text editor ([install-dir]/conf/dvredge/).
  2. Change the <Streams>/<StreamType> property value to:
<StreamType>liverepeater-edge</StreamType>
  1. Set the <Streams>/<LiveStreamPacketizers> property value to:
<LiveStreamPacketizers>dvrstreamingrepeater</LiveStreamPacketizers>

This means that DVR streams originate from another Wowza Streaming Engine server and are received (repeaetd) by this edge server. To enable live streaming for this application in addition to DVR streaming, you can add additional packetizers. For example:

<LiveStreamPacketizers>dvrstreamingrepeater,cupertinostreamingrepeater,mpegdashstreamingrepeater</LiveStreamPacketizers>

It can be a helpful troubleshooting technique to test if a live stream can be played from the edge server.

  1. Leave the <DVR>/<Recorders> property value empty because recording is performed on the origin:
<Recorders></Recorders>
  1. Leave the <DVR>/<Store> value empty because data is stored on the origin:
<Store></Store>

The <DVR>/<ArchiveStrategy> and <DVR>/<StorageDir> values are ignored on edge servers, so these values don't matter.

The <DVR>/<WindowDuration> value should remain 0 or be unspecified, as any purging should happen on the origin.

  1. Set the <Application>/<Repeater>/<OriginURL> property to point to the origin using the WOWZ prefix. For example:
<Repeater>
	<OriginURL>wowz://[wowza-origin-address]/dvrorigin</OriginURL>
</Repeater>

For [wowza-origin-address], use the IP address of the origin server.

This property determines how the edge gets playlist information and retrieves the audio and video chunks.

  1. Set the <HTTPStreamers> value to include the protocols to which you want to stream DVR. For example:
<HTTPStreamers>cupertinostreaming,mpegdashstreaming</HTTPStreamers>

Publish the stream


Start Wowza Streaming Engine and send the live stream myStream to the dvrorigin application on the origin server. For more information, see Connect a live source to Wowza Streaming Engine

Play the nDVR recording


To play using an Apple iOS device (HLS)

Enter the following URL into Safari on the device:

http://[address]:1935/dvredge/myStream/playlist.m3u8?DVR

To play using MPEG-DASH

To test playback, you can use the MPEG-DASH player on the Video Test Players webpage.

Enter the following URL in a player that supports MPEG-DASH:

http://[address]:1935/dvredge/myStream/manifest.mpd?DVR

Tuning


Media Cache

Because edge servers request chunks from the origin server, we recommend using Media Cache in a DVR configuration on the edge servers. This allows local caching of DVR chunks on the edge servers and reduces the number of requests from the edge back to the origin to retrieve chunks. For more information, see Configure Wowza Streaming Engine Media Cache for nDVR.

DVR chunks in memory

By default, nDVR holds the most recent 10 chunks in memory for each stream. One way to reduce disk access on both the origin server and edge servers is to increase this value. The tradeoff, however, is that holding more chunks for each stream rendition in memory increases memory usage.

For example, suppose you have 20 high-bitrate streams you're streaming with DVR. On average, each video chunk is 900 KB, and each audio chunk is 100 KB (so each chunk takes 1 MB). If you increase this value from 10 to 50 chunks, you'll save 40 additional chunks per stream, using almost 1 GB of additional server memory (20 * 40 * (900 KB + 100 KB) = 800 MB).

Before changing the value, analyze how much memory will be required, whether you have the memory to spare, and if disk I/O is an issue. If you decide to change the value, add the chunkMemoryCacheSize and chunkMemoryReadCacheEnable properties to [install-dir]/conf/dvredge/Application.xml under <DVR>/<Properties> like so:

<Property>
    <Name>chunkMemoryCacheSize</Name>
    <Value>20</Value>
    <Type>Integer</Type>
</Property>
<Property>
    <Name>chunkReadMemoryCacheEnable</Name>
    <Value>TRUE</Value>
    <Type>Boolean</Type>
</Property>

More resources