How to plan your Wowza nDVR workflow

Wowza nDVR enables you to record a live stream with a Wowza media server while simultaneously allowing users to play or pause the live stream, rewind it a previously recorded point, or resume viewing at the current live point.
Note: Wowza Media Server™ 3 is required.


Deployment Considerations More resources

Deployment considerations

Wowza Media Server recording options

There are multiple ways besides Wowza nDVR to record live streams with Wowza Media Server. The two built-in methods are the live-record StreamType and the Live Stream Record feature. These methods can be paired with Wowza nDVR to have the combination of recording features described below.

In summary, if you combine Wowza nDVR with either of the built-in methods, you'll be able to offer both:
  • Seek capability during the recording of the live stream (Wowza nDVR)
  • Record into one file for VOD playback later (built-in recording options).
Wowza nDVR
Use Wowza nDVR when you want users to be able to play or pause a live stream, rewind to a previously recorded point and then resume viewing at the current live point. These viewer actions are allowed while the stream is being recorded live. The recording (.m4fa and .m4fv files) is available for playback through Wowza Media Server (but not through a standalone player) after the live event is completed. It isn't currently possible to recompose the nDVR recording (.m4fa and .mp4v files) into an .mp4 or .flv file.

"live-record" or "rtp-live-record" Stream Type
This is the simplest method, but gives you the least amount of control. Configuration is through editing the Application.xml file and is built-in functionality to Wowza Media Server. No additional AddOn or module is required. Select this option when you want to:
  • Record your live stream into a single file (flv, mp4) for on-demand playback. The file will not be available for playback until after the recording is completed. Use Wowza nDVR if you want to playback the live stream while it's being recorded.
  • Record the entire duration of the published stream.
  • Playback the recorded file by any player that supports the file format without requiring a connection to Wowza Media Server to stream the file.
  • Playback over other protocols besides HTTP (for example, RTMP, RTSP) supported by Wowza Media Server. 
  • StreamType "live-record" is the same as "live" plus content will be recorded.
  • StreamType "rtp-live-record" is the same as "rtp-live" plus content will be recorded.
  • The StreamType is a property set in Streams/StreamType in the Application.xml configuration file.
Live Stream Record API
Starting in Wowza Media Server 3.5, LiveStreamRecord, formerly a free AddOn, is incorporated into the server as an API that gives you more control over recording live streams to video-on-demand files. This feature enables you to control the live stream recording process using a web-based user interface, HTTP URL queries, or programmatically. Powerful new APIs are included to support splitting of in-process live streams into multiple on-demand MP4 (QuickTime container) files or FLV (Flash Video container) files, with the split points based on video duration, clock time, or file size. For more information, see How to record live streams (HTTPLiveStreamRecord).

Wowza nDVR advanced configuration for tuning for your workflow

When planning your Wowza nDVR deployment, consider fine-tuning the properties that are described in this section to tune your workflow. For more information about these properties, see How to do advanced configuration for Wowza nDVR.

The amount of time Wowza nDVR will wait for packets until it stops recording. This timeout is meant to account for when encoders disconnect and then restart.

Controls minimum nDVR chunk size. You can increase this value for larger chunk sizes to reduce the number of files in the DVR store written to the hard disk. There is a trade-off and because HTTP streaming has an inherent latency of 3 chunks, a larger chunk size would result in longer latency before playback would start.

Specifies the target duration when recording audio-only. Applies to recording an audio-only stream and is the target chunk duration. This setting is ignored if the stream contains video and audio, in which case the keyframe determines the chunk size.

Adds a packet sorter before the audio and video packets get to Wowza nDVR. This is similar to the live streaming packet sorter. This adds additional latency equal to the value. It's recommended to fix audio and video alignment upstream from Wowza Media Server, but this setting can be used if that isn't possible.

Wowza nDVR expects the incoming audio and video to be aligned. Through this parameter, Wowza nDVR will try to compensate for out-of-alignment issues, but it can't completely resolve them. It's important to resolve out-of-alignment issues before deployment in a production environment. Increasing the allowable tolerance will increase the number of chunks that aren't recorded, which may cause the overall quality to be unacceptable.

What is needed to scale an nDVR deployment?

Performance Tuning
It's important that your server is properly tuned for use in a production environment. See the Performance Tuning Guide.

Best Practices
Review the Best Practices section in the Wowza nDVR Quick Start Guide. These recommendations are fundamental to planning your nDVR deployment.

Managing Recordings
What is the best way to set up a recording? Many scenarios have a requirement to record a long duration. While it's easy to set up one long recording, a much better approach is to record in manageable chunks. Small logical recordings are preferable to large recordings for many reasons:
  • Many players do not handle lengthy recordings very well.
  • Recordings are managed by Wowza Media Server as a single entity. If you have a very large recording, its manifest information is loaded into the server as a single chunk. This has several ramifications:
    1. More memory is required to manage the recording's manifest information.
    2. Wowza nDVR has logic by which recordings are unloaded to release resources when they are no longer used. Using a single large recording and accessing portions of it defeats this scheme.
    3. Adaptive bitrate uses the entire recording when aligning recorded streams. Again, this requires more memory and processing to align very long recordings.
  • After you have recorded a live stream into logical chunks (for example, a 24/7 period broken down into 1 hour recordings), you can use the nDVR Playlist Request API to generate a playlist that specifies a start time and (optionally) an end time.
Live Repeater (Origin/Edge)
This method is for scaling your live streaming workflow by configuring origin and edge servers. For configuration instructions, see How to set up live stream repeater for use with Wowza nDVR (origin/edge).

Media Cache
Media Cache enables a read-through caching mechanism for video-on-demand streaming. This functionality, along with the live stream repeater, can be added to your Wowza nDVR workflow. For more information, see How to scale video on demand streaming with Media Cache. For configuration instructions, see How to configure MediaCache for Wowza nDVR.

What needs to be handled outside of Wowza?

File Access
Wowza nDVR limits the recording to 30 hours maximum. This is put into place because a very long recording results in a large number of directories/files that can cause an issue with the file system having to manage this number of files. The playlist will be repeatedly requested every couple of seconds (based on keyframe size) and, therefore, an extremely large playlist size will be problematic for the player and should be avoided. See How to use Wowza nDVR Playlist Request API for more information about how to request a portion of your recording for playback.

Sufficient hardware is needed to support the level of file access for your workflow. Do test runs to estimate how many files will be generated and how well your hardware can handle the file access required for your workflow. Multiple smaller recordings are more easily managed.

File Management
The Wowza nDVR WindowDuration property controls the length of the recording, but does not manage previous recorded stores. For example, if you set the WindowDuration value to 3 hours, the recording will be 3 hours long. As time continues past 3 hours but is still less than the 30 hours maximum, the recording will be the last 3 hours and the earliest chunks are deleted as time progresses. If the ArchiveStrategy value is set to delete, then if there was a previous recording by the same name, it will be deleted and overwritten with the newer recording. If you have other DVR stores on your file system that were previously recorded, those DVR stores won't be affected by the WindowDuration property. Monitoring and managing of recordings isn't part of nDVR functionality. Custom scripts would need to be written to your specification for clearing out unwanted recordings.
Note: Purged chunks to maintain the WindowDuration amount of time does not count towards the 30 hour maximum.

More resources

If you're having problems or want to discuss this article, post in our forum.