| Note: For use with for Wowza Media Server 3.0.0 and later. |
Contents
Tutorial
- Wowza nDVR functionality
- Server.license configuration (Wowza Media Server Perpetual Edition)
- Basic configuration
- Advanced configuration
- Publishing the stream
- Playback
Troubleshooting
- Logging
- Troubleshooting tests
- Archive strategy verification
- Managing encoder disconnects and restarts
- Audio/Video alignment
- Recording is missing audio or video
- Adaptive bitrate stream alignment
Related Articles
- How to do advanced configuration for Wowza nDVR AddOn
- How to set up live stream repeater for use with Wowza nDVR AddOn (origin/edge)
- How to troubleshoot error messages
Tutorial
Wowza nDVR functionality
- Recording of live streams:
- H.264 video
- AAC or MP3 audio
- Audio/Video, audio-only, and video-only streams
- H.264 video
- HTTP playback of recorded streams:
- Adobe® HTTP Dynamic Streaming (Adobe HDS/San Jose)
- Apple® HTTP Live Streaming (Apple HLS/Cupertino)
- Microsoft® Smooth Streaming (Smooth)
- Multiple-bitrate streams that are time-aligned
- Adobe® HTTP Dynamic Streaming (Adobe HDS/San Jose)
- Origin/Edge support. For instructions, see How to set up live stream repeater for use with Wowza nDVR AddOn (origin/edge).
- In-memory cache of the most recently recorded audio and video
- Java™ API
Server.license configuration (Wowza Media Server Perpetual Edition)
License keys for Wowza Media Server and premium AddOns (including Wowza nDVR AddOn) are stored in the [install-dir]/conf/Server.license file.
- %WMSCONFIG_HOME%\conf\Server.license- Windows
- /Library/WowzaMediaServer/conf/Server.license- Mac OS X
- /usr/local/WowzaMediaServer/conf/Server.license- Linux/Unix
Trial, Daily, and Monthly Edition subscribers will have a single license key while Perpetual Edition users may have more than one key to enable premium AddOns.
To enable premium AddOns, open the Server.license file in a text editor and enter each new license key on a new line. When the standalone server is restarted, the new license(s) will be in effect. Licenses are additive, so when adding additional licenses, be sure to retain the original license information in the file and add each new license key on its own new line. The order in which the keys are listed isn't important. The first and last five digits of the license key are displayed in the console window.
The following is an example Server.license file for a Perpetual Edition user with a Wowza Media Server 3.5 license key, two Wowza Transcoder AddOn license keys, and one Wowza nDVR AddOn license key:
SVRP3-LaGpC-ZrTD9-F4Y3S-a9bR2-h5t3C
TRN23-Ry6qe-4mT8J-yKj2W-4N5sH-2Td3a
TRN13-y9Gj2-kneqT-2zjHp-GadzB-N6fwa
DVRA3-k3r3R-nzxCB-ypjs5-Sk3y9-ahFdF
Basic configuration
This section provides the basic steps for setting up an application for live streaming and configuring Application.xml.
- Create application folder [install-dir]/applications/dvr.
- Create configuration folder [install-dir]/conf/dvr and copy [install-dir]/conf/Application.xml to this new folder.
- Edit the newly copied Application.xml file and make the following changes (some of these settings may already be present):
- Set the Streams/StreamType property to:
Code:<StreamType>live</StreamType>
- Set the Streams/LiveStreamPacketizers property to:
This setting enables DVR content to originate from a recorded store on this Wowza Media Server and be streamed to any HTTPStreamer.Code:<LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>
In addition to DVR streaming, you can enable live streaming for this application by adding additional packetizers. For example:
Code:<LiveStreamPacketizers>cupertinostreamingpacketizer,smoothstreamingpacketizer,sanjosestreamingpacketizer,dvrstreamingpacketizer</LiveStreamPacketizers>
- Set the DVR/Recorders property to:
Code:<Recorders>dvrrecorder</Recorders>
- Set the DVR/Store property to:
Code:<Store>dvrfilestorage</Store>
- Set the HTTPStreamers property to the streaming protocols that you want to stream to. For example:
Code:<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>
- Set the Streams/StreamType property to:
Advanced configuration
This section introduces a few of the important properties for customizing your configuration to control the archive strategy and availability of your recorded streams. Additional configuration properties are available and are described in the article, How to do advanced configuration for Wowza nDVR AddOn.
You can configure the following additional DVR parameters in the Application.xml file to affect the behavior of Wowza nDVR:
- Streams/StorageDir: Specifies the top-level folder where DVR streams are stored. This can contain an environment variable (for example, ${com.wowza.wms.context.VHostConfigHome}) or an explicit path (for example, C:/myDvr).
Note: The following environment variables are supported:
${com.wowza.wms.AppHome} Application home directory ${com.wowza.wms.ConfigHome} Configuration home directory ${com.wowza.wms.context.VHost} Virtual host name ${com.wowza.wms.context.VHostConfigHome} Virtual host config directory ${com.wowza.wms.context.Application} Application name ${com.wowza.wms.context.ApplicationInstance} Application instance name
DVR streams are stored in the StorageDir inside a folder structure containing the application name, the application instance name, the stream name, and a version number. For example, if Streams/StorageDir is set to C:/myDvr, two streams named "streamA" and "streamB" for the dvr application would be stored at:
- C:/myDvr/dvr/_definst_/streamA.0
- C:/myDvr/dvr/_definst_/streamB.0
- DVR/ArchiveStrategy: Specifies what the DVR store does with an old stream when a new stream of the same application instance and stream name starts. Options include:
- append: Append the new stream to the end of the previous DVR store. This is the default value.
- delete: Delete the old DVR store and start a new one.
- version: Create a new DVR store with the next available version number. The old DVR store isn't deleted.
- DVR/WindowDuration: The duration (in seconds) of material available from the DVR store for DVR playback. The DVR has a concept of a floating window of recorded material. Material that falls outside this window, as time moves forward, is unavailable and purged from the file system. A WindowDuration value of 0 denotes that there's no window duration and all DVR data is available.
Publishing the stream
- Using a text editor, edit the [install-dir]/conf/admin.password file and add a username and password that will be used to start and stop publishing of the stream (below is an example of the file with the username myuser and password mypassword):
Code:# Admin password file (format [username][space][password]) # username password myuser mypassword
- Start Wowza Media Server.
- Publish the live stream (for example, from an encoder) to the dvr application on the server.
- Use Stream Manager to start the stream:
- Enter the following URL in a web browser:
URL: http://[wowza-ip-address]:8086/streammanager - In the Security dialog box, enter your admin username and password from above.
- In the Stream Manager webpage, click the [start-receiving-stream] link just below the dvr application folder.
- In the Start Receiving Stream dialog box, select the following MediaCaster Type option: rtp-record
- In the Stream Name field, enter the stream name used by the encoder or other live stream source.
- Click OK.
- Enter the following URL in a web browser:
When the stream starts, it will also be recorded to the DVR store.
Playback
| Note: In the following examples, [wowza-ip-address] is the IP address or domain name of the server running Wowza Media Server. |
Adobe Flash Player (San Jose/Adobe HDS)
This example uses the Strobe player, which is based on OSMF, to play the stream.
In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveDVRStreaming/FlashHTTPPlayer/player.html, enter either the live or DVR stream URL below, and then click the Connect button.
Stream (live): http://[wowza-ip-address]:1935/dvr/myStream/manifest.f4m
-or-
Stream (dvr): http://[wowza-ip-address]:1935/dvr/myStream/manifest.f4m?DVR
-or-
Stream (dvr): http://[wowza-ip-address]:1935/dvr/myStream/manifest.f4m?DVR
To play the stream from a remote computer, copy the FlashHTTPPlayer folder to a web server, and then connect to: http://<webserver>/FlashHTTPPlayer/player.html.
| Note: In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveDvrStreaming/clientStrobe/DvrOSMFPlayer.html, enter one of the above URLs, and then click the Play button. |
Apple iOS device (Cupertino/Apple HLS)
Enter the following URL into the Safari® web browser on the device:
URL: http://[wowza-ip-address]:1935/dvr/myStream/playlist.m3u8?DVR
Notes:
|
Apple iOS device (embedded in HTML)
The preferred way to play video in a webpage is through the use of the <video> tag. However, a playback issue in iOS devices causes playback to stop when you move a live Apple HLS stream from a previous point to the current live point. We've reported this issue to Apple. As a workaround, use the <embed> tag.
Code:
<!-- Comment-out
<video src="[wowza-ip-address]:1935/dvr/myStream/playlist.m3u8?DVR" controls>
-->
<embed width="320" height="240"
src="[wowza-ip-address]:1935/dvr/myStream/playlist.m3u8?DVR"
type="application/vnd.apple.mpegurl" postdomevents="true" id="movie1" />
Microsoft Silverlight (Smooth Streaming)
In Wowza Media Server 3.5, double-click [install-dir]/examples/LiveDVRStreaming/SilverlightPlayer/player.html, enter the information below, and then click the Connect button.
Stream: http://[wowza-ip-address]:1935/dvr/myStream/Manifest?DVR
To play the stream from a remote computer, copy the SilverlightPlayer folder to a web server, and then connect to: http://<webserver>/SilverlightPlayer/player.html.
Notes:
|
Troubleshooting
Logging
Wowza nDVR leverages the existing Wowza Media Server log files in [install-dir]/logs. For more information about logging capabilities, see the Wowza Media Server User's Guide.
Running Wowza Media Server in standalone mode enables you to view these messages in real-time from the console window. For a list of messages, scenarios that may cause them, and suggestions for resolution, see How to troubleshoot error messages.
Logging messages in wowzamediaserver_access.log indicate if Wowza Media Server and Wowza nDVR are configured properly. If so, the logs will show DVR being initialized and configuration information being read from Application.xml. All messages, including warnings and errors, are logged in the wowzamediaserver_access.log file.
Troubleshooting tests
Test #1: Playback basic live streaming without Wowza nDVR
Use one of the following tutorials to verify that your basic live streaming setup is working properly without Wowza nDVR recording enabled. The DVR/Recorders property should be disabled in the Application.xml file.
- How to set up live streaming using an RTMP-based encoder
- How to set up live streaming using an RTSP/RTP-based encoder
- How to publish and play a live stream (MPEG-TS based encoder)
- How to set up live streaming using a native RTP encoder with SDP file
Test #2: Playback a single recorded stream
After you verify that Wowza Media Server is configured correctly for live streaming and you can play the stream successfully, enable recording again and test the playback of a recorded stream using the provided sample video and player. Make sure that you can record and playback with the basic single server scenario before you try to set up an origin/edge configuration or playback recorded groups (StreamNameGroups created by Wowza Transcoder or SMIL files).
- Re-enable recording in Application.xml by setting the DVR/Recorders property to:
Code:<Recorders>dvrrecorder</Recorders>
- Use one of the above live tutorials to test playback of a single recorded stream.
If you can't playback the newly recorded stream, use the following troubleshooting checklist:
- Verify that a directory was created to store your recorded files after publishing the live stream to Wowza Media Server. By default, a directory named dvr is created at [install-dir]/dvr.
- Verify that the DVR/Recorders property in Application.xml is set to:
This setting enables Wowza nDVR.Code:<Recorders>dvrrecorder</Recorders>
- Verify that the Streams/LiveStreamPacketizers property in Application.xml is set to:
Without this value, the dvr directory can't be created.Code:<LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>
Note: If the encoder that provides input to Wowza Media Server is stopping or disconnecting, it might prevent Wowza nDVR from recording. - Verify that the DVR/Store property in Application.xml is set correctly. If not configured properly, a log message will indicate that DVR can't record and why. For more information about error messages and common causes, see How to troubleshoot error messages.
Note: This property shouldn't be set on edge servers if you're setting up the more complex live stream repeater (origin/edge) configuration for use with Wowza nDVR. Be sure to carefully follow the instructions in How to set up live stream repeater for use with Wowza nDVR AddOn (origin/edge) to avoid errors. - Verify that your archive strategy is set up correctly. Check the DVR/ArchiveStrategy property setting in Application.xml if the expected directory doesn't contain your recorded files. By default, this directory is [install-dir]/dvr. If not configured properly, a log message will indicate that DVR can't record and why.
- Look for messages in the wowzamedia_access.log file that indicate Wowza nDVR is initialized and has the required configuration information. The following are sample successful log messages where the application name is live and stream name is myStream.
Problems with #1, #2, and #3 above will be reported in the wowzamediaserver_access.log file. Failure could be due to malformed xml or an invalid or missing property in Application.xml. If you don't see the success messages, see How to troubleshoot error messages for more information about how to troubleshoot Wowza nDVR startup error messages.Code:comment server INFO 200 LiveStreamDvrRecorderBase.initProperties[live/_definst_/myStream] : properties: comment server INFO 200 DvrStreamManagerBase.initProperties properties: {Properties: } comment server INFO 200 DvrStreamManagerBase.initProperties chunkCacheClass=com.wowza.wms.dvr.impl.DvrDefaultChunkMemoryCache comment server INFO 200 DvrStreamManagerBase.initStorage[live/_definst_/myStream] : storeName:dvrfilestorage isRecorder:true hasStorage:true comment server INFO 200 MediaStreamMap.getLiveStreamPacketizer: Create live stream packetizer: dvrstreamingpacketizer:myStream comment server INFO 200 MediaStreamMap.getDvrRecorder: Create DVR Recorder: dvrrecorder:myStream comment server INFO 200 -DvrStreamManagerBase.internalStartStream[live/_definst_/myStream_delete] :
- Verify that Wowza nDVR is recording. If Wowza nDVR is recording, folders are created in your storage directory and they will have .m4fa and .m4fv files.
Note: In Wowza Media Server 3.0.4, Wowza nDVR chunk file extensions changed from .isma and .ismv to .m4fa and .m4fv. - Verify that your live stream uses supported audio and video codecs.
Code:Comment server INFO 200 DvrPacketHandler.handlePacket[live/_definst_/myStream]: Video codec:H264 isCompatible:true comment server INFO 200 DvrStreamStoreBase.initProperties[live/_definst_/myStream/myStream.0] : ChunkOriginURL=null comment server INFO 200 DvrStreamStoreBase.initProperties[live/_definst_/myStream /myStream.0] : properties:[dvrChunkGroupingSeconds=600, dvrAllowableAVPacketDelta=2000, dvrResetTimePacketDelta=200, dvrPacketDeltaToNotify=200] comment server INFO 200 DvrPacketHandler.handlePacket[live/_definst_/myStream]: Audio codec:AAC isCompatible:true
- Verify that the Streams/StreamType property in Application.xml is set to:
In Application.xml, the default StreamType is default. This is the setting for video on demand (VOD) and configures Wowza Media Server to look for video files in the [install-dir]\content directory instead of a live stream. If this property is set to default instead of live, no DVR-related errors will be recorded in the log and no DVR-related directories will be created.Code:<StreamType>live</StreamType>
Test #3: Playback of recorded files with live stream repeater (origin/edge) configuration
Follow the instructions in How to set up live stream repeater for use with Wowza nDVR AddOn (origin/edge) carefully.
- Verify that the Application.xml file is configured correctly on the origin server. For more information, see Configuring the origin server.
- Verify that the Application.xml file is configured correctly on each edge server. For more information, see Configuring the edge server.
- On the origin server, the HTTPStreamers property must be set to:
This enables the origin to stream DVR audio and video chunks to the edge servers.Code:<HTTPStreamers>dvrchunkstreaming</HTTPStreamers>
On the edge server, this property must be set to the protocols that you want to stream DVR to. For example:
Code:<HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>
- The DVR/Store property must be left empty on the edge server because only the origin server stores the data.
Code:<Store></Store>
- Setting the Streams/LiveStreamPacketizers property to dvrstreamingrepeater on both origin and edge will cause errors. It's only required for edge servers.
- On the origin server, the HTTPStreamers property must be set to:
- Test live playback from the origin server. Configuration of additional LiveStreamPacketizers required.
- Test live playback from the edge server. Configuration of additional HTTPStreamers required.
- Test DVR playback from the origin server.
- Test DVR playback from the edge server.
Archive strategy verification
If you set the DVR/ArchiveStrategy property to version in Application.xml, a new directory (for example, myStream.1) is created when the directory myStream.0 already exists when:
- The stream is disconnected and then restarted.
- The stream times out and then reconnects.
If you want all recordings to be in the same directory, set the DVR/ArchiveStrategy property to append (the default setting).
If you want the current recording of the same stream name to replace a previous recording, set the DVR/ArchiveStrategy property to delete.
Managing encoder disconnects and restarts
Wowza nDVR depends on a continuous live stream. Encoders can unexpectedly disconnect and are often configured to automatically reconnect. You can specify the amount of time that Wowza nDVR will wait for packets before it stops recording (the default value is 5 minutes). This timeout is meant to account for when encoders disconnect and then restart. See streamTimeout in How to do advanced configuration for Wowza nDVR AddOn.
Audio/Video alignment
Wowza nDVR expects that the audio and video in an incoming stream is aligned. Input streams with short key frame intervals and aligned audio and video work best.
The following error in the log indicates an audio/video alignment problem.
Code:
ERROR server comment DvrStreamStoreBase.storeChunks[DVR/_definst_/myCamera.stream/myStream.0] : Skipping chunk. A/V packet times differ by 3025 ms, more than allowed 2000 ms. aTime=3749903889 vTime=3749906914
Recording is missing audio or video
If audio and/or video is missing from a recording, the audio and/or video might not have been present when the stream codecs were being identified. For example, if only video was detected, then only video would be recorded and not the audio. You can increase the amount of time that Wowza nDVR will wait to receive audio and video codec information after streaming has started. See dvrWaitForCodecTime in How to do advanced configuration for Wowza nDVR AddOn.
Adaptive bitrate stream alignment
Starting with Wowza Media Server 3.1.2, patch 15, information about nDVR chunks is recorded to log files by default without turning on additional debugging properties. This information enables you to verify that individual streams in an adaptive bitrate streaming group have properly aligned packets.
The following shows sample log lines for an application named liveDVR and stream named livestream1. The values are start times for audio, video, and data chunks for both nDVR timescale and packet timescale.
Code:
LiveStreamDvrRecorder.endChunk[liveDVR/_definst_/livestream1]: Add chunk: ind:0 a/v/k: packets: 84/30/0 durations: 1950/1983/-1 dvrTimes:3/0/-1 pTimes:680182/680179/0 LiveStreamDvrRecorder.endChunk[liveDVR/_definst_/livestream1]: Add chunk: ind:1 a/v/k: packets: 87/30/0 durations: 2020/2000/-1 dvrTimes:1953/1983/-1 pTimes:682132/682162/-1
Updated: For Wowza Media Server 3.5.0 on 11-08-2012
- Click here, if you are having problems or would like to discuss this article.
- Leave a comment below, if there is some aspect of this article you would like to see changed or improved.


Article List
Categories
Wowza Media