• How to set up and run Wowza nDVR for live streaming

    Wowza nDVR AddOn enables you to record a live stream with Wowza Streaming Engine™ while simultaneously enabling users to play or pause the live stream, rewind to a previously recorded point, or resume viewing at the current live point.

    Contents


    Tutorial
    Wowza nDVR functionality
    Adding an nDVR AddOn license for Perpetual Edition licensees

    Basic configuration

    Advanced configuration

    Publishing the stream

    Playback

    Troubleshooting
    Related articles

    Tutorial


    Wowza nDVR functionality

    • Recording of live streams:

      • H.264 video

      • AAC or MP3 audio

      • Audio/Video, audio-only, and video-only streams

    • 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


    • 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


    Adding an nDVR AddOn license for Perpetual Edition licensees

    License keys for all Wowza products, including the Wowza media server software and AddOns, are stored in [install-dir]/conf/Server.license. Subscription users can run an unlimited number of media server instances and AddOns under a single license key. Perpetual Edition users must use a separate license key for each server instance and for each AddOn. If you're a Perpetual Edition user, add your license key for Wowza nDVR AddOn by following the instructions in Add license keys.

    Notes:
    • Charges accrue for AddOns only when they're activated and used. For pricing information, see Wowza Streaming Engine Pricing.

    • If you're using either a Trial, Developer, or Subscription (Monthly) Edition license, Wowza nDVR will function without adding additional licenses.

    Basic configuration

    Basic configuration in Wowza Streaming Engine Manager

    This section provides the basic steps for setting up an application for live streaming and configuring a DVR application using Wowza Streaming Engine Manager.

    1. Create a new live application named dvr.

    2. Under Live Applications expand the new application named dvr, and select nDVR AddOn.

    3. Click Enable nDVR AddOn.


    4. Restart the application.



    5. The Status field will now show Status: Enabled. Click Edit to continue setup.


    6. Accept the default options. For more information about these options and other advanced options see Advanced configuration in Wowza Streaming Engine Manager.


    7. Click Save.

    8. Restart the application.



    Basic configuration in XML

    This section provides the basic steps for setting up an application for live streaming and configuring Application.xml. If you did the previous section and configured with Wowza Streaming Engine Manager, skip this section and go to Advanced configuration in Wowza Streaming Engine Manager.

    1. Create application folder [install-dir]/applications/dvr.

    2. Create configuration folder [install-dir]/conf/dvr and copy [install-dir]/conf/Application.xml to this new folder.

    3. Edit the newly copied Application.xml file and make the following changes (some of these settings may already be present):

      1. Set the Streams/StreamType property to:
        Code:
        <StreamType>live</StreamType>
      2. Set the Streams/LiveStreamPacketizers property to:
        Code:
        <LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>
        This setting enables DVR content to originate from a recorded store on this Wowza Streaming Engine and be streamed to any HTTPStreamer.

        In addition to DVR streaming, you can enable live streaming for this application by adding additional packetizers. For example:
        Code:
        <LiveStreamPacketizers>cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer, mpegdashstreamingrepeater, dvrstreamingpacketizer</LiveStreamPacketizers>
      3. Set the DVR/Recorders property to:
        Code:
        <Recorders>dvrrecorder</Recorders>
      4. Set the DVR/Store property to:
        Code:
        <Store>dvrfilestorage</Store>
      5. Set the HTTPStreamers property to the streaming protocols that you want to stream to. For example:
        Code:
        <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>


    Advanced configuration

    Advanced configuration in Wowza Streaming Engine Manager

    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 DVR parameters in Wowza Streaming Engine Manager as shown in above. The following environment variables and options are supported to affect the behavior of Wowza nDVR.

    • DVR Store directory: 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
    • Streaming Options: Specifies how an incoming live stream can be played back by indicating whether the ?DVR query parameter must be appended to playback URLs.
      • To specify that a live stream can be played using the DVR playback controls in a player, select DVR streaming only. This option means that the ?DVR query parameter must be appended to playback URLs.
      • To specify that a live stream can be played with or without DVR playback controls, select Live and DVR streaming. This option means that the live stream is available for playback with or without the ?DVR query parameter appended to playback URLs. If ?DVR isn't appended to the playback URL, the live stream can still be played but DVR playback isn't supported.

    • Recording Options: Select Start recording on startup to automatically begin recording a live stream that is published to the application for DVR when the application starts.

    • Archive Method: By setting these options you can specify that the DVR recording appends new content to a single file in storage. The Append option is the default and is the best option to use to handle disruptions in the live stream such as the encoder restarting. The Delete option starts a new recording and deletes the previous file. The Version option starts a new recording in a new folder for each new stream.

    • DVR Window Duration: These settings specify the amount of recorded material in the DVR store that's available for DVR playback.
      • To make the entire recording available for playback, select All material available. This option enables viewers who join the live stream in-progress to rewind and watch the stream from the beginning. This option also preserves the live stream recording after the stream ends.
      • To make only part of the live stream available for playback, select Use window duration and then specify the duration in Hours:Minutes:Seconds. The minimum supported duration value is 60 seconds. This option enables viewers who join the live stream in-progress to rewind the stream for the duration that you specify and watch from that point forward. The duration window is a "floating window" that always ends at the current live point. Recorded data that falls outside this window is purged from the DVR store.
        You can record up to 30 hours of material for DVR playback; however, you may encounter performance and playback issues if you make longer durations of material available for playback. For best practices guidance, see Recording Length.


    Advanced configuration in XML

    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. If you are using Wowza Streaming Engine Manager, you can skip this section and go to Publishing the stream in Wowza Streaming Engine Manager.

    You can configure the following DVR parameters in the Application.xml file to affect the behavior of Wowza nDVR:

    • DVR/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 DVR/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

    Publishing the stream in Wowza Streaming Engine Manager

    1. Under Server in the contents pane click Publishers. Click Add Publisher.

    2. When the Publishers > [new] dialog opens, enter username and password to enable authentication from the encoder that will publish a live stream to the dvr application created previously. Click Add.
    3. The new publisher's credentials are now available to be used or edited.
    4. Publish the live stream, for example, from an encoder, to the dvr application on the server.

    5. If you selected Start recording on startup as described in the Basic configuration in Wowza Streaming Engine Manager section above, the dvr application will automatically record the stream when the encoder begins sending it, and users can seek to earlier segments of the live stream. If not, to get DVR functionality, complete the following steps.

    6. Go back to the Applications tab, then, under the dvr application, click Incoming Streams.

    7. Click the red button under Actions to begin recording dvr/myStream.
    8. When the Recording options dialog appears, name the storage file, set the location for storage, set output file format, and select Record data or Start on key frame.



    9. Click Record.



    Publishing the stream in XML

    If you are using Wowza Streaming Engine Manager, you can skip this section and go to Playback testing with Wowza Streaming Engine Manager.

    1. 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
    2. Start Wowza Streaming Engine.

    3. Publish the live stream, for example, from an encoder, to the dvr application on the server.

    4. Use Stream Manager to start the stream:

      1. Enter the following URL in a web browser:
        URL: http://[wowza-ip-address]:8086/streammanager

      2. In the Security dialog box, enter your admin username and password from above.

      3. In the Stream Manager webpage, click the [start-receiving-stream] link just below the dvr application folder.

      4. In the Start Receiving Stream dialog box, select the following MediaCaster Type option: rtp-record

      5. In the Stream Name field, enter the stream name used by the encoder or other live stream source.

      6. Click OK.

    When the stream starts, it will also be recorded to the DVR store.

    Playback

    Playback testing in Wowza Streaming Engine Manager


    To access the test players in Wowza Streaming Engine Manager, click the Test Players button in the Applications or Home UI.




    Adobe Flash Player (San Jose/Adobe HDS)


    Click the Adobe HDS tab on the player UI, and enter either the live or DVR stream URL below, and then click the Start 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



    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
    Note: You can find this URL on the Mobile tab of the Test Players UI and email it to your player from Wowza Streaming Engine Manager.
    Notes:
    • The Apple iPhone 3GS (and older) and iPod touch devices require that video be encoded using H.264 format (Baseline profile level 3 or lower) and AAC or MP3 stereo audio.

    • This stream can also be played using the Safari web browser or QuickTime 10.x on a computer running Mac OS X Snow Leopard version 10.6 or later.
    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)


    Click the MS Smooth tab on the player UI, and enter either the live or DVR stream URL below, and then click the Start button.


    Stream (live): http://[wowza-ip-address]:1935/dvr/myStream/Manifest.

    -or-

    Stream (dvr): http://[wowza-ip-address]:1935/dvr/myStream/Manifest?DVR



    The Microsoft Silverlight player requires that both audio and video be present for playback. For live streaming only, the key frame frequency (which can be set directly in some encoders or is gop/fps) must be between 1 and 4 seconds (2 seconds is recommended). Anything greater than 4 seconds may cause playback to freeze.

    Playback testing with example players

    If you are using Wowza Streaming Engine Manager, you can skip this section.

    Note: In the following examples, [wowza-ip-address] is the IP address or domain name of the server running Wowza Streaming Engine.

    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.0 and later, 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

    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:
    • The Apple iPhone 3GS (and older) and iPod touch devices require that video be encoded using H.264 format (Baseline profile level 3 or lower) and AAC or MP3 stereo audio.

    • This stream can also be played using the Safari web browser or QuickTime 10.x on a computer running Mac OS X Snow Leopard version 10.6 or later.
    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.0 and later, 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:
    • In Wowza Media Server 3.1.2 and earlier, double-click [install-dir]/examples/LiveDvrStreaming/clientSilverlight/LiveDvrSmoothStreaming.html, enter the information above, and then click the Play button.

    • The Microsoft Silverlight player requires that both audio and video be present for playback. For live streaming only, the key frame frequency (which can be set directly in some encoders or is gop/fps) must be between 1 and 4 seconds (2 seconds is recommended). Anything greater than 4 seconds may cause playback to freeze.
    For more information about players, see the following articles:



    Troubleshooting


    Logging

    Wowza nDVR leverages the existing Wowza Streaming Engine log files in [install-dir]/logs. For more information about logging capabilities, see the Wowza Streaming Engine User's Guide.

    Running Wowza Streaming Engine 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 wowzastreamingengine_access.log indicate if Wowza Streaming Engine 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 wowzastreamingengine_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.



    Note: The RTMP and RTSP streaming formats do not support DVR.
    Test #2: Playback a single recorded stream

    After you verify that Wowza Streaming Engine 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).

    1. Re-enable recording in Application.xml by setting the DVR/Recorders property to:
      Code:
      <Recorders>dvrrecorder</Recorders>
    2. 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:

    1. Verify that a directory was created to store your recorded files after publishing the live stream to Wowza Streaming Engine. By default, a directory named dvr is created at [install-dir]/dvr.

    2. Verify that the DVR/Recorders property in Application.xml is set to:
      Code:
      <Recorders>dvrrecorder</Recorders>
      This setting enables Wowza nDVR.

    3. Verify that the Streams/LiveStreamPacketizers property in Application.xml is set to:
      Code:
      <LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>
      Without this value, the dvr directory can't be created.

      Note: If the encoder that provides input to Wowza Streaming Engine is stopping or disconnecting, it might prevent Wowza nDVR from recording.
    4. 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.
    5. 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.

    6. 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.
      Code:
      INFO application app-start _definst_ live/_definst_
      INFO session connect-pending 192.168.1.50 -
      INFO session connect 192.168.1.50 -
      INFO stream create - -
      INFO stream publish myStream -
      INFO server comment - LiveStreamDvrRecorderBase.initProperties[live/_definst_/myStream] : properties: 
      INFO server comment - DvrStreamManagerBase.initProperties[live/_definst_/myStream] : {Properties: isDvrPacketizer: true}
      INFO server comment - DvrStreamManagerBase.initStorage[live/_definst_/myStream] : storeName:dvrfilestorage isRecorder:true hasStorage:true
      INFO server comment - MediaStreamMap.getLiveStreamPacketizer[live/_definst_/myStream]: Create live stream packetizer: dvrstreamingpacketizer:myStream
      INFO server comment - DvrStreamStoreBase.initProperties[live/_definst_/myStream/myStream.0] : properties:[dvrWindowDuration:0, dvrChunkGroupingSeconds:600, dvrAllowableAVPacketDelta:2000, dvrResetTimePacketDelta:200, dvrPacketDeltaToNotify:200]
      INFO server comment - LiveStreamDvrRecorder.init[live/_definst_/myStream]: audioOnlyChunkTargetDuration: 2000 ms
      INFO server comment - LiveStreamDvrRecorder.init[live/_definst_/myStream]: dvrWaitForCodecTime: 8000 ms
      INFO server comment - LiveStreamDvrRecorder.init[live/_definst_/myStream]: recordAudio: true
      INFO server comment - LiveStreamDvrRecorder.init[live/_definst_/myStream]: recordVideo: true
      INFO server comment - LiveStreamDvrRecorder.init[live/_definst_/myStream]: recordData: true
      INFO server comment - MediaStreamMap.getDvrRecorder[live/_definst_/myStream]: Create DVR Recorder: dvrrecorder
      INFO server comment - LiveStreamDvrRecorder.resetStream[live/_definst_/myStream]
      INFO server comment - DvrStreamStoreBase.resetTimeMap[live/_definst_/myStream/myStream.0] : resetTime=0
      INFO server comment - DvrPacketHandler.handlePacket[]: Video codec:H264 isCompatible:true
      INFO server comment - DvrPacketHandler.handlePacket[]: Audio codec:AAC isCompatible:true
      INFO server comment - LiveStreamDvrRecorder.reportCodecInformation[live/_definst_/myStream][avc1.66.31]: H.264 Video info: {MediaCodecInfoVideo: codec:H264, profile:Baseline, level:3.1, frameSize:640x480, displaySize:640x480, frameRate:30.000000}
      INFO server comment - LiveStreamDvrRecorder.reportCodecInformation[live/_definst_/myStream][mp4a.40.2]: AAC Audio info: {MediaCodecInfoAudio: codec:AAC, channels:2, frequency:48000, samplesPerFrame:1024, objectType:LC}
      INFO server comment - DvrStreamStoreBase.storeChunks[live/_definst_/myStream/myStream.0] :  Resetting dvr time from dvr:0/pt:0 to dvr:0/pt:0/utc:1389136379031
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:0 a/v/k: packets: 240/150/11 durations: 5119/5149/5149 dvrTimes:0/0/0 pTimes:0/0/0
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:1 a/v/k: packets: 240/150/10 durations: 5121/5072/5072 dvrTimes:5119/5149/5516 pTimes:5119/5149/5516
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:2 a/v/k: packets: 237/150/10 durations: 5055/5105/5105 dvrTimes:10239/10221/10521 pTimes:10239/10221/10521
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:3 a/v/k: packets: 240/150/10 durations: 5119/5105/5105 dvrTimes:15295/15326/15526 pTimes:15295/15326/15526
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:4 a/v/k: packets: 240/150/11 durations: 5120/5138/5138 dvrTimes:20415/20431/20531 pTimes:20415/20431/20531
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:5 a/v/k: packets: 240/150/10 durations: 5120/5105/5105 dvrTimes:25535/25569/26003 pTimes:25535/25569/26003
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:6 a/v/k: packets: 240/150/10 durations: 5121/5139/5139 dvrTimes:30655/30674/31008 pTimes:30655/30674/31008
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:7 a/v/k: packets: 240/150/10 durations: 5121/5071/5071 dvrTimes:35775/35813/36013 pTimes:35775/35813/36013
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:8 a/v/k: packets: 237/150/10 durations: 5055/5105/5105 dvrTimes:40895/40884/41018 pTimes:40895/40884/41018
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:9 a/v/k: packets: 240/150/11 durations: 5120/5105/5105 dvrTimes:45951/45989/46023 pTimes:45951/45989/46023
      INFO server comment - LiveStreamDvrRecorder.endChunk[live/_definst_/myStream]: Add chunk: ind:10 a/v/k: packets: 240/150/10 durations: 5120/5105/5105 dvrTimes:51071/51094/51528 pTimes:51071/51094/51528
      Problems with #1, #2, and #3 above will be reported in the wowzastreamingengine_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.

    7. 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.

    8. 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
    9. Verify that the Streams/StreamType property in Application.xml is set to:
      Code:
      <StreamType>live</StreamType>
      In Application.xml, the default StreamType is default. This is the setting for video on demand (VOD) and configures Wowza Streaming Engine 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.

    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.

    1. Verify that the Application.xml file is configured correctly on the origin server. For more information, see Configuring the origin server.

    2. 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:
        Code:
        <HTTPStreamers>dvrchunkstreaming</HTTPStreamers>
        This enables the origin to stream DVR audio and video chunks to the edge servers.

        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.

    3. Test live playback from the origin server. Configuration of additional LiveStreamPacketizers required.

    4. Test live playback from the edge server. Configuration of additional HTTPStreamers required.

    5. Test DVR playback from the origin server.

    6. Test DVR playback from the edge server.


    Archive strategy verification

    You can set the archive strategy in the Advanced Configuration options.



    If you set the Archive Method property to version as shown in the previous illustration, 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 Archive Method 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
    Alignment problem will cause chunks to not be recorded, which will degrade the recording. The best way to fix this is upstream from Wowza nDVR AddOn (typically the encoding process). While we strongly recommend that you fix any audio/video alignment issues before to recording, you can set Wowza nDVR AddOn properties in Application.xml to try and compensate for this problem. These properties won't fix alignment problems, but may help you to work around them. See dvrPacketSortTime and dvrAllowableAVPacketDelta in How to do advanced configuration for Wowza nDVR AddOn.

    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

    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

    Updated: For Wowza Streaming Engine 4.0 on 02-11-2014
    Comments 26 Comments
    1. aynajus -
      Can I used DVR to flash rtmp?
    1. ScottKell -
      Quote Originally Posted by aynajus View Post
      Can I used DVR to flash rtmp?
      No, nDVR streams to HTTP only.
    1. aigars -
      So it means it can not be used with flowplayer ?
    1. rrlanham -
      I don't think Flowplayer supports Flash HTTP (Sanjose) streaming.

      Richard
    1. aigars -
      Thanks for answers?
      How can be controlled disk space for recording? It's possible to set some limits avoid to flood hard drive?
    1. rrlanham -
      There is no built-in, configurable way to set a limit on disk space used for recording. You could use an application module or server listener to monitor disk usage, but I don't have an example of that.

      Richard
    1. xzerth -
      Hello, thanks for an answers. How can I set the time period of recording data? I mean I want to record only last 2 weeks of content and then record on top of it. How can I set this?
    1. ScottKell -
      Quote Originally Posted by xzerth View Post
      Hello, thanks for an answers. How can I set the time period of recording data? I mean I want to record only last 2 weeks of content and then record on top of it. How can I set this?
      If you want to set a 2 week window of time-- 2 weeks of DVR-ed content would be available and as time progresses anything before the 2 week period drops off-- use the WindowDuration property. Its shown in the article.

      If you instead want to control when recording starts and stops, you can use the recording API or the HTTP Provider example which uses this API shown here: Wowza nDVR Recording API
    1. maddogx -
      Quote Originally Posted by ScottKell View Post
      If you want to set a 2 week window of time-- 2 weeks of DVR-ed content would be available and as time progresses anything before the 2 week period drops off-- use the WindowDuration property. Its shown in the article.

      If you instead want to control when recording starts and stops, you can use the recording API or the HTTP Provider example which uses this API shown here: Wowza nDVR Recording API
      What if the wowza server is restarted when you need a versioned recording using the api but append when the wowza restarted/reloaded ?
    1. ScottKell -
      Quote Originally Posted by maddogx View Post
      What if the wowza server is restarted when you need a versioned recording using the api but append when the wowza restarted/reloaded ?
      I think you are referring to the recording API: Wowza nDVR Recording API
      I'm guessing you want to create different recordings but those recordings would have append mode.

      Set append mode, and when you use the HTTPProvider or API to create the recording, give the recording a unique name.

      So even though you have myStream as your stream name, the recordings might be called:
      hour01
      hour02
      etc...

      And since you have append mode, if the stream disconnects and restarts, it will continue recording.

      Not that the streamTimeout value controls how long the recording will remain "open" if the input stream disconnects. SO set that to suit your needs.
    1. ManGood -
      i'm trying to start DVR recording but it doesn't work.
      there is folder in /WowzaMediaServer/dvr
      there is file in /WowzaMediaServer/conf/dvr/Application.xml

      here is file Application.xml in /conf/dvr/
      <Root>
      <Application>
      <!-- Uncomment to set application level timeout values
      <ApplicationTimeout>60000</ApplicationTimeout>
      <PingTimeout>12000</PingTimeout>
      <ValidationFrequency>8000</ValidationFrequency>
      <MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
      <MaximumSetBufferTime>60000</MaximumSetBufferTime>
      <MaximumStorageDirDepth>25</MaximumStorageDirDepth>
      -->
      <Connections>
      <AutoAccept>true</AutoAccept>
      <AllowDomains></AllowDomains>
      </Connections>
      <!--
      StorageDir path variables

      ${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
      -->

      <Streams>
      <StreamType>live</StreamType>
      <StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
      <KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
      <!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater -->
      <LiveStreamPacketizers>dvrstreamingpacketizer</LiveStreamPacketizers>
      <!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
      <Properties>
      </Properties>
      </Streams>
      <Transcoder>
      <!-- To turn on transcoder set to: transcoder -->
      <LiveStreamTranscoder></LiveStreamTranscoder>
      <!-- [templatename].xml or ${SourceStreamName}.xml -->
      <Templates>${SourceStreamName}.xml,transrate.xml</Templates>
      <ProfileDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles</ProfileDir>
      <TemplateDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/templates</TemplateDir>
      <Properties>
      </Properties>
      </Transcoder>

      <DVR>
      <!-- As a single server or as an origin, use dvrstreamingpacketizer in LiveStreamPacketizers above -->
      <!-- Or, in an origin-edge configuration, edges use dvrstreamingrepeater in LiveStreamPacketizers above -->
      <!-- As an origin, also add dvrchunkstreaming to HTTPStreamers below -->

      <!-- To turn on DVR recording set Recorders to dvrrecorder. This works with dvrstreamingpacketizer -->
      <Recorders>dvrrecorder</Recorders>

      <!-- As a single server or as an origin, set the Store to dvrfilestorage-->
      <!-- edges should have this empty -->
      <Store>dvrfilestorage</Store>

      <!-- Window Duration is length of live DVR window in seconds. 0 means the window is never trimmed. -->
      <WindowDuration>0</WindowDuration>

      <!-- Storage Directory is top level location where dvr is stored. e.g. c:/temp/dvr -->
      <StorageDir>${com.wowza.wms.context.VHostConfigHome}/dvr</StorageDir>

      <!-- valid ArchiveStrategy values are append, version, delete -->
      <ArchiveStrategy>append</ArchiveStrategy>

      <!-- If this is a dvrstreamingrepeater, define ChunkOriginURL to point back to origin -->
      <!-- And define Application/Repeater/OriginURL to point back to the origin -->
      <Repeater>
      <ChunkOriginURL></ChunkOriginURL>
      </Repeater>

      <!-- Properties for DVR -->
      <Properties>
      </Properties>
      </DVR>

      <!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming, dvrchunkstreaming -->
      <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>

      <SharedObjects>
      <StorageDir></StorageDir>
      </SharedObjects>

      <Client>
      <IdleFrequency>-1</IdleFrequency>
      <Access>
      <StreamReadAccess>*</StreamReadAccess>
      <StreamWriteAccess>*</StreamWriteAccess>
      <StreamAudioSampleAccess></StreamAudioSampleAccess>
      <StreamVideoSampleAccess></StreamVideoSampleAccess>
      <SharedObjectReadAccess>*</SharedObjectReadAccess>
      <SharedObjectWriteAccess>*</SharedObjectWriteAccess>
      </Access>
      </Client>
      <RTP>
      <!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
      <Authentication>
      <PublishMethod>digest</PublishMethod>
      <PlayMethod>none</PlayMethod>
      </Authentication>
      <!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
      <AVSyncMethod>senderreport</AVSyncMethod>
      <MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
      <IdleFrequency>75</IdleFrequency>
      <RTSPSessionTimeout>90000</RTSPSessionTimeout>
      <RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
      <RTSPBindIpAddress></RTSPBindIpAddress>
      <RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
      <RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
      <IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
      <!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
      <Properties>
      </Properties>
      </RTP>

      <MediaCaster>
      <!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
      <Properties>
      </Properties>
      </MediaCaster>

      <MediaReader>
      <!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
      <Properties>
      </Properties>
      </MediaReader>

      <MediaWriter>
      <!-- Properties defined here will override any properties defined in conf/MediaWriter.xml for any MediaWriter loaded by this applications -->
      <Properties>
      </Properties>
      </MediaWriter>

      <LiveStreamPacketizer>
      <!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->
      <Properties>
      </Properties>
      </LiveStreamPacketizer>

      <HTTPStreamer>
      <!-- Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications -->
      <Properties>
      </Properties>
      </HTTPStreamer>

      <Repeater>
      <OriginURL></OriginURL>
      <QueryString><![CDATA[]]></QueryString>
      </Repeater>

      <Modules>
      <Module>
      <Name>base</Name>
      <Description>Base</Description>
      <Class>com.wowza.wms.module.ModuleCore</Class>
      </Module>
      <Module>
      <Name>properties</Name>
      <Description>Properties</Description>
      <Class>com.wowza.wms.module.ModuleProperties</Class>
      </Module>
      <Module>
      <Name>logging</Name>
      <Description>Client Logging</Description>
      <Class>com.wowza.wms.module.ModuleClientLogging</Class>
      </Module>
      <Module>
      <Name>flvplayback</Name>
      <Description>FLVPlayback</Description>
      <Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
      </Module>
      </Modules>

      <!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
      <Properties>
      </Properties>
      </Application>
      </Root>
      But no files are recorded, what's wrong?
      Thank you!
    1. anointed -
      I did manage to get this working properly but did end up with a few questions:

      I noticed that when loading a player for a live video that had been playing for some time, that it took the player about 30 seconds to buffer and start playing.

      1. When using dvr mode, is the player buffering the entire video up to the live portion?

      *This is a concern as most of my videos are 2 hrs long. I am concerned about someone coming in say an hour late and having to wait for the entire first hour of video to buffer into the player.

      2. If this is the case, is there a way to set the amount of video I want to buffer prior to the live portion?
      *buffer only 5 mins before the live portion. If the user wants to rewind even further, then have the player buffer when the user rewinds*

      3. I see above that you have to use multiple 'embed' types for the players depending upon whether the video is delivered via flash, ios, etc.
      Is there currently a 'single' player that supports all these modes at one time with proper fallback for different devices that ALSO works with dvr mode?
    1. rrlanham -
      No, this is still streaming, users do not have to wait for a download

      There isn't a single player that does all that.

      Richard
    1. hockey_dave -
      Is it possible to use nDVR with smil files (i.e. have multiple bit rate streams within a smil wrapper). User's player selects streams by bandwidth and still have available pause/rewind, etc on the individual stream?

      PS. No rtmp and flowplayer. Oh man that hurts!
    1. rrlanham -
      It will work best and most easily with the Wowza Transcoder, but should work as long as the source streams are key frame aligned.

      1. Configure an application named "dvr" for nDVR and Wowza Transcoder:
        http://www.wowza.com/forums/content....live-streaming
        http://www.wowza.com/forums/content....live-streaming

      2. Create a file in the content folder named myStreams.smil

        /content/myStreams.smil
        Code:
        <smil>
            <head>
            </head>
            <body>
                <switch>
                    <video src="myStream_160p" system-bitrate="160000"/>
                    <video src="myStream_360p" system-bitrate="360000"/>
                </switch>
            </body>
        </smil>
      3. Publish a stream named "myStream"

      4. Playback URLs:

        Flash HTTP (sanjose streaming)
        Code:
        http://[wowza-address]:1935/dvr/smil:myStreams.smil/manifest.f4m?DVR
        iOS (cupertino streaming)
        Code:
        http://[wowza-address]:1935/dvr/smil:myStreams.smil/playlist.m3u8?DVR
        Silverlight (smooth streaming)
        Code:
        http://[wowza-address]:1935/dvr/smil:myStreams.smil/Manifest?DVR


      Richard
    1. newclique -
      Can you expand on exactly what you mean by "Publish a stream named "myStream" "?
    1. rrlanham -
      For example, using an RTMP live encoder like Wirecast, connect to a Wowza application and publish a stream named "myStream".

      Richard
    1. newclique -
      Quote Originally Posted by rrlanham View Post
      For example, using an RTMP live encoder like Wirecast, connect to a Wowza application and publish a stream named "myStream".

      Richard
      Thank you for the reply. I got the DVR app set up and I see files being created in the DVR/DVR/_definst/stream folder. I am using the Flash Media Live Encoder v3.2 to push the stream to the DVR application and my profile is H.264 baseline 1.3 (both audio and video are being encoded) with a keyframe being sent every 3 seconds. I am pointing my Silverlight mediaelement to http://localhost:1935/dvr/streamname/Manifest?DVR (and I even tried just hitting the /dvr/streamname to try to play the live stream) but I always get the 4001 AG_E_NETWORK_ERROR in Silverlight. I am hosting my Silverlight player in an HTML page and the app does come up but I get the error and no video. I put a clientaccesspolicy.xml file in the root of the Wowza server and can retrieve it with http://localhost:1935/clientaccesspolicy.xml url. I know this is probably a client-side error but I thought I would take a chance and post here in case you or anyone else can suggest anything else I might try. I don't have any errors in the Wowza error log regarding Smoothstreaming and I do have smoothstreamingpacketizer added to my Application.xml file under LiveStreamPacketizers and I have smoothstreaming listed under HTTPStreamers. Any hints or thoughts would be greatly appreciated as I cannot be the only one hitting this snag.

      One other suggestion I am open to is what other player I might use to verify the DVR is working. MPlayer perhaps?

      Thanks again for all of your help (to everyone!).
    1. rrlanham -
      Change the LiveStreamPacketizers to "dvrstreamingpacketizer". The basic nDVR guide is here:
      http://www.wowza.com/forums/content....live-streaming

      Also, for Silverlight, try changing the key frame frequency to 2 seconds. Silverlight works with key frame frequency from 1 to 4 seconds, but 2 seconds works best.

      Richard
    1. newclique -
      Quote Originally Posted by rrlanham View Post
      Change the LiveStreamPacketizers to "dvrstreamingpacketizer". The basic nDVR guide is here:
      http://www.wowza.com/forums/content....live-streaming

      Also, for Silverlight, try changing the key frame frequency to 2 seconds. Silverlight works with key frame frequency from 1 to 4 seconds, but 2 seconds works best.

      Richard
      I actually had both dvrstreamingpacketizer and smoothstreamingpacketizer in the LiveStreamPacketizers. I have set it back to just the dvr packetizer as I think I understand the difference, now. However, I must say, the use of the word Live, seems inappropriate in terms of describing what the application (server) actually does. Incoming would be a much more appropriate word. The HTTPStreamers actually send outbound packets even for "Live" streams so, in my opinion, if Wowza is going to ask their customers to configure something without a proper admin interface that masks all of the behind-the-scenes names, language is key. There are incoming packets and outgoing packets (or inbound and outbound, or received and transmitted...anything but Live and HTTPStreamers because those are not very accurate and obfuscate a large part of Wowza's "documentation", the Application.xml file).

      I can tell by the lack of response in the Wowza console and log file that the problem most likely lies within Silverlight's goofy security model itself. It just isn't letting me connect outside of it's child-sized sandbox. I will continue to look for an answer to that. Thanks again for your help.