# Clear DVR store when stream ends

**URL:** <https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823>\
**Category:** Wowza Streaming Engine\
**Created:** [February 26, 2015, 10:36pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823 "2015-02-26T22:36:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![trong\_trong](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@trong\_trong](https://community.wowza.com/u/trong_trong)\
**Post date:** [February 26, 2015, 10:36pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/1 "2015-02-26T22:36:08Z")

</div>

Hi there!

Is it possible to clear the DVR store and reset the time back to 0 immediately when a stream ends, instead of waiting 5 minutes as it is by default? At the moment if I stream for say 30 minutes, stop streaming, and then restart the stream within 5 minutes, the playback time in the player continues from the 30 minute mark from the previous stream, making it 31, 32, and so on. But if I wait 5 minutes and restart the stream, the playback time is reset to 0, and goes to 1, 2, and so on, as usual.

Can I reset the time to 0 as in the second behavior, but without having to wait 5 minutes?

Thanks

Trong

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [February 28, 2015, 12:25am UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/2 "2015-02-28T00:25:29Z")

</div>

Hi,

nDVR doesn’t allow for clearing the DVR store outside of nDVR’s own mechanism. I can suggest this requirement as a backlog item for you to see if this functionality is not working as you expect.

Paul

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [March 2, 2015, 2:50pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/3 "2015-03-02T14:50:27Z")

</div>

Hi Trong,

OK I’ll send this to our Backlog queue. Please note that I can’t give timescales for when or if this functionality will be made available.

Paul

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [March 3, 2015, 4:26pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/4 "2015-03-03T16:26:36Z")

</div>

Hi Trong,

I’ve had a response from one of the engineers involved in nDVR design. He states that you can set this to work as you wanted to now by setting one of the [Wowza nDVR Advanced Properties](https://www.wowza.com/docs/how-to-do-advanced-configuration-for-wowza-ndvr).

In particular,

Look at setting the streamTimeout property.

This is the amount of time, in milliseconds (ms), that Wowza nDVR will wait for packets until it stops recording. The default value is 300,000 ms (5 minutes). This timeout is meant to account for when encoders disconnect and then restart. The value should be a non-zero value or else your recording will stop whenever there is no data. You could look at reducing that value in order to reduce the reset time:

```auto
<Properties>
     <Property>
          <Name>streamTimeout</Name>
          <Value>300000</Value>
          <Type>Integer</Type>
     </Property>
</Properties>

```

Like all DVR advanced properties, they are added to the **DVR/Properties** section in **Application.xml**.

Paul

---

<div class="post-metadata">

**Author:** ![Paul\_Shields](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/paul_shields/32/390_2.png) [@Paul\_Shields](https://community.wowza.com/u/Paul_Shields)\
**Post date:** [March 6, 2015, 4:28pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/5 "2015-03-06T16:28:40Z")

</div>

Good to hear. The simplest approach is often the best :).

Regards,

Paul

---

<div class="post-metadata">

**Author:** ![trong\_trong](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@trong\_trong](https://community.wowza.com/u/trong_trong)\
**Post date:** [February 27, 2015, 10:56pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/6 "2015-02-27T22:56:11Z")

</div>

> Hi,
> 
> nDVR doesn’t allow for clearing the DVR store outside of nDVR’s own mechanism. I can suggest this requirement as a backlog item for you to see if this functionality is not working as you expect.
> 
> Paul

Hi Paul

Yes please, thank you!

Cheers

Trong

---

<div class="post-metadata">

**Author:** ![trong\_trong](https://avatars.discourse-cdn.com/v4/letter/t/dec6dc/32.png) [@trong\_trong](https://community.wowza.com/u/trong_trong)\
**Post date:** [March 5, 2015, 9:43pm UTC](https://community.wowza.com/t/clear-dvr-store-when-stream-ends/44823/7 "2015-03-05T21:43:45Z")

</div>

Hi Paul

That works! I was gonna use the Java API like this:

```auto
public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
    ILiveStreamDvrRecorder dvrRecorder = stream.getDvrRecorder(IDvrConstants.DVR_DEFAULT_RECORDER_ID);      
    if (dvrRecorder.isRecording()) {
        dvrRecorder.stopRecording();
    }
}

```

But setting it in the configs is much simpler. Thanks so much 🙂

Trong
