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.
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 in which 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
Create a Wowza Streaming Engine application on the origin server. In this example, the application is named dvrorigin.
- Create a folder named dvrorigin in [install-dir]/applications/.
- Create another folder named dvrorigin in [install-dir]/conf/.
- Copy the Application.xml file in [install-dir]/conf/ to [install-dir]/conf/dvrorigin.
- Open [install-dir]/conf/dvrorigin/Application.xml in a text editor.
- Set the <Streams>/<StreamType> property value to live, rtp-live, or a variant. For example:
- Set the <Streams>/<LiveStreamPacketizers> property value to:
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:
- Set the <DVR>/<Recorders> property value to:
- Set the <DVR>/<Store> property value to:
- 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.
- Set the <HTTPStreamers> property value to:
This enables the origin to stream DVR audio and video chunks to the edge servers.
Configure the edge server(s)
Create a Wowza Streaming Engine application on each edge server. In this example, the application is named dvredge.
- Create a folder named dvredge in [install-dir]/applications/.
- Create another folder named dvredge in [install-dir]/conf/dvredge.
- Copy the Application.xml file in [install-dir]/conf/ file to [install-dir]/conf/dvredge.
- Open [install-dir]/conf/dvredge/Application.xml in a text editor.
- Change the <Streams>/<StreamType> property value to:
- Set the <Streams>/<LiveStreamPacketizers> property value to:
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:
It can be a helpful troubleshooting technique to test if a live stream can be played from the edge server.
- Leave the <DVR>/<Recorders> property value empty because recording is performed on the origin:
- Leave the <DVR>/<Store> value empty because data is stored on the origin:
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.
- Set the <Application>/<Repeater>/<OriginURL> property to point to the origin using the WOWZ prefix. For example:
<Repeater> <OriginURL>wowz://[origin-ip-address]/dvrorigin</OriginURL> </Repeater>
For [origin-ip-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.
- Set the <HTTPStreamers> value to include the protocols to which you want to stream DVR. Choose one or more from cupertinostreaming, smoothstreaming, sanjosestreaming, and mpegdashstreaming. The setting that enables streaming to all supported protocols would look like this:
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
H.264-encoded streams can be delivered over any HTTP protocol that Wowza Streaming Engine supports.
To play using Adobe Flash Player (Adobe HDS)
Note: This example uses the Strobe player, which is based on OSMF, to play the stream.
To test playback, you can use the example Flash player included in the Wowza Streaming Engine installation ([install-dir]/examples/LiveDVRStreaming/FlashHTTPPlayer/player.html).
Enter the following URL in a player that supports HDS:
To play using an Apple iOS device (HLS)
Enter the following URL into Safari on the device:
To play using Microsoft Silverlight (Smooth Streaming)
To test playback, you can use the example Silverlight player included in the Wowza Streaming Engine installation ( [install-dir]/examples/LiveDVRStreaming/SilverlightPlayer/player.html).
Enter the following URL in a player that supports Smooth Streaming:
To play using MPEG-DASH
To test playback, you can use the example MPEG-DASH player included in the Wowza Streaming Engine installation ([install-dir]/examples/LiveDVRStreaming/MPEGDASHPlayer/player.html).
Enter the following URL in a player that supports MPEG-DASH:
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 that 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, and 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 memory to spare, and if disk I/O is an issue. If you decide to change the value, add the chunkMemoryCacheSize property to [install-dir]/conf/dvredge/Application.xml under <DVR>/<Properties> like so:
<Property> <Name>chunkMemoryCacheSize</Name> <Value>20</Value> <Type>Integer</Type> </Property>