# Deleting DVR content

**URL:** <https://community.wowza.com/t/deleting-dvr-content/678>\
**Category:** Wowza Streaming Engine\
**Created:** [May 30, 2012, 3:44pm UTC](https://community.wowza.com/t/deleting-dvr-content/678 "2012-05-30T15:44:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)\
**Post date:** [May 30, 2012, 3:44pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/1 "2012-05-30T15:44:21Z")

</div>

Hi there … is there any function that can be used in order to delete content from nDVR?

For instance, I’m recording live events, which we keep in nDVR for a while (not fixed time). Once in a while, to do clear on content, I’d like to trigger a deletion for instance, all content of day X/Y/Z or something like that

We do that manually thorugh server admin now, and some complex scripts, but it’d be better to control it through some http providers

thanks

---

<div class="post-metadata">

**Author:** ![Lisa\_Wong](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@Lisa\_Wong](https://community.wowza.com/u/Lisa_Wong)\
**Post date:** [May 30, 2012, 12:48pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/2 "2012-05-30T12:48:41Z")

</div>

Wowza nDVR does not provide this type of file management functionality. You’ll need to write your own scripts for this kind of cleanup. The only deletion that can be configured is if you set DVR/ArchiveStrategy property in Application.xml to: delete, then if the stream is disconnected and then re-started, the previous recording will be deleted and replaced with the new recording.

-Lisa

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [March 7, 2014, 4:08am UTC](https://community.wowza.com/t/deleting-dvr-content/678/3 "2014-03-07T04:08:18Z")

</div>

The Wowza nDVR feature does not record .flv or .mp4 files that are transportable and re-usable outside of the nDVR system.

The Live Stream Record feature will do what you describe: record .flv (or .mp4) files in segments by time, and other methods. Here is the [basic guide for Livestream Record](https://www.wowza.com/docs/how-to-record-live-streams-httplivestreamrecord%28HTTPLiveStreamRecord%29)

Richard

---

<div class="post-metadata">

**Author:** ![Jin-mo\_Kang](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@Jin-mo\_Kang](https://community.wowza.com/u/Jin-mo_Kang)\
**Post date:** [January 16, 2017, 6:13pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/4 "2017-01-16T18:13:41Z")

</div>

```auto
IDvrFileSystem fs = dvrStore.getFileSystem();
if(fs.doesFileSystemExist()) {
	fs.deleteFileSystem();
}

```

---

<div class="post-metadata">

**Author:** ![Sathishkumar\_KPS](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@Sathishkumar\_KPS](https://community.wowza.com/u/Sathishkumar_KPS)\
**Post date:** [March 3, 2014, 11:21am UTC](https://community.wowza.com/t/deleting-dvr-content/678/5 "2014-03-03T11:21:42Z")

</div>

Hi,

Is it possible to split the ndvr recording video file (\*.flv) based on timings, so that I can delete the files and save some disk space. Let say, I would like to split the recording file for every hour. Is it possible ? If yes, could you please tell me how to do that ?

I have checked the ndvr advanced configuration [https://www.wowza.com/docs/how-to-do-advanced-configuration-for-wowza-ndvr](https://www.wowza.com/docs/how-to-do-advanced-configuration-for-wowza-ndvr) and I couldn’t figure out the right one! I’m using Wowza - 3.6 version on ubuntu linux.

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![Andrew\_Van\_Tassell](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@Andrew\_Van\_Tassell](https://community.wowza.com/u/Andrew_Van_Tassell)\
**Post date:** [January 5, 2017, 4:30pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/6 "2017-01-05T16:30:34Z")

</div>

Just checking in on this old thread to see if it’s yet possible to automatically delete old DVR files.

I’m recording my live streams and using the moduleS3Upload to move them to S3 after the stream ends. I’d like to delete the DVR for a stream 24 hours after it ends, is there a setting anywhere that would do that?

---

<div class="post-metadata">

**Author:** ![Marcin\_Wozniak1](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@Marcin\_Wozniak1](https://community.wowza.com/u/Marcin_Wozniak1)\
**Post date:** [December 13, 2018, 12:12pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/7 "2018-12-13T12:12:15Z")

</div>

Can you add this functionality to REST API? I need that urgently.

---

<div class="post-metadata">

**Author:** ![patrice\_gargiolo](https://avatars.discourse-cdn.com/v4/letter/p/e68b1a/32.png) [@patrice\_gargiolo](https://community.wowza.com/u/patrice_gargiolo)\
**Post date:** [November 14, 2019, 3:16pm UTC](https://community.wowza.com/t/deleting-dvr-content/678/8 "2019-11-14T15:16:05Z")

</div>

Thanks to Jin-mo Kang, I could solve it by adding this code to a listener “onUnPublish” of IMediaStreamActionNotify2

```auto
public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) {
    logger.info("onUnpublish [" + streamName + "] - CLEANING DVR STORE");
    // Cleaning DVR store
    ILiveStreamDvrRecorder dvrRecorder = stream.getDvrRecorder(IDvrConstants.DVR_DEFAULT_RECORDER_ID);
    IDvrStreamStore dvrStore = dvrRecorder.getDvrManager().getDefaultStreamingStore();
    IDvrFileSystem fs = dvrStore.getFileSystem();
    if (fs.doesFileSystemExist()) {
        fs.deleteFileSystem();
    }
}

```

This is deleting the dvr store when the stream is finished.
