How to configure Media Cache for Wowza nDVR

This article describes how to use the Wowza™ Media Cache read-through caching mechanism to cache DVR chunks on edge servers in a multi-server configuration.

Note: For use with Wowza Streaming Engine™ (version 4.x) and Wowza Media Server™ (version 3.6.4) software.

Prerequisites

  1. Set up a Wowza media server live stream repeater configuration to stream DVR from origin to edge(s): How to set up live stream repeater for use with Wowza nDVR (origin/edge)
  2. For Wowza Media Server™ software: Get the MediaCache Addon package by completing the AddOn Request form. After your request is approved, we'll send you an email with package download instructions.
    Note: Skip this step if you're running Wowza Streaming Engine™ software. The Media Cache feature is built-in to Wowza Streaming Engine media server.
  3. For Wowza Media Server™ software: Follow the "MediaCache User's Guide" that's included in the MediaCache AddOn package to install it on each edge server. The User's Guide provides basic setup instructions using an application named mediacache. Apply these instructions to the Application.xml configuration file on each edge server, which may have a different application name. If you followed the application naming in How to set up live stream repeater for use with Wowza nDVR, your edge server will be named dvredge.
    Note: Skip this step if you're running Wowza Streaming Engine™ software. The Media Cache feature is built-in to Wowza Streaming Engine media server and is enabled automatically when the media server starts.

Enable nDVR media caching

On each edge server, do the following:

Wowza Streaming Engine

  1. In Wowza Streaming Engine Manager, click the Applications tab and select your dvredge application in the contents panel.
  2. In the contents panel, click nDVR.
  3. If nDVR isn't enabled, in the details page, click Enable nDVR, and then restart the application when prompted to enable the feature.
  4. Your dvredge application is configured to use nDVR if a green checkmark is displayed next to the Use Media Cache option in the details page. If a red checkmark is displayed next to this option, click Edit, select the Use Media Cache checkbox, and then click Save. Restart the application when prompted to apply this change.

Wowza Media Server

Open the Application.xml file for your dvredge application in a text editor and add the following property under <Application>/<DVR>/<Properties>:

<Properties>
     <Property>
          <Name>dvrMediaCacheEnabled</Name>
          <Value>true</Value>
          <Type>Boolean</Type>
     </Property>
</Properties>

Manage nDVR media caching

For nDVR workflows, you MUST use the default Media Cache source named dvrorigin. In Wowza Streaming Engine, dvrorigin is automatically installed and available for use. In Wowza Media Server, open the [install-dir]/conf/MediaCache.xml file in a text editor and uncomment the sample <MediaCacheSource>...<MediaCacheSource> named dvrorigin to make it available for use:

<MediaCacheSource>
	<Name>dvrorigin</Name>
	<BasePath>http://</BasePath>
	<Prefix>dvrorigin/</Prefix>
	<BaseClass>com.wowza.wms.mediacache.impl.MediaCacheItemHTTPImpl</BaseClass>
	<ReaderClass></ReaderClass>
	<DefaultBlockSize>262144</DefaultBlockSize>
	<MaxTimeToLive>1200000</MaxTimeToLive>
	<MinTimeToLive>600000</MinTimeToLive>
	<ReadAhead>true</ReadAhead>
	<ReadAheadThreshold>50</ReadAheadThreshold>
	<IsPassThru>false</IsPassThru>
	<Properties>
		<Property>
			<Name>httpReadTimeout</Name>
			<Value>3000</Value>
			<Type>Integer</Type>
		</Property>
	</Properties>
</MediaCacheSource>

For most deployments, the default settings for DVR chunk caching should be adequate. For more information about the property values, see the Media Cache User's Guide for Wowza Streaming Engine or the User's Guide document in the MediaCache Addon package for Wowza Media Server.


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