# The DVR internal data remains after deleted

**URL:** <https://community.wowza.com/t/the-dvr-internal-data-remains-after-deleted/41467>\
**Category:** Wowza Streaming Engine\
**Created:** [February 26, 2014, 11:16am UTC](https://community.wowza.com/t/the-dvr-internal-data-remains-after-deleted/41467 "2014-02-26T11:16:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jordi\_Cenzano](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jordi\_Cenzano](https://community.wowza.com/u/Jordi_Cenzano)\
**Post date:** [February 26, 2014, 11:16am UTC](https://community.wowza.com/t/the-dvr-internal-data-remains-after-deleted/41467/1 "2014-02-26T11:16:37Z")

</div>

Hi, I wanted to implement a START, STOP, DELETE DVR control using API. To that that I configured the DVR/ArchiveStrategy to “append” (in application.xml), and I have used the code of [nDVR-AddOn-recording-API](https://www.wowza.com/docs/how-to-use-wowza-ndvr-recording-api), and I have added the delete function:

```auto
    public boolean stopAndDeleteRecording(String streamName) 
    {
        boolean bRc = false;
        ILiveStreamDvrRecorder dvrRecorder = null;
        synchronized (dvrRecorders) 
        {
            dvrRecorder = dvrRecorders.remove(streamName);
        }
        if (dvrRecorder != null) 
        {   
            // stop recording
            dvrRecorder.stopRecording();
           
            try 
            {
                Thread.sleep(500);
            } 
            catch (InterruptedException e) 
            {
                e.printStackTrace();
            }
            
            IDvrStreamManager dvrManager = dvrRecorder.getDvrManager();
            if (dvrManager != null) 
            {
                 IDvrStreamStore store = dvrManager.getRecordingStreamStore();
                 IDvrFileSystem fs = store.getFileSystem();
                 fs.deleteFileSystem(); 
                 bRc = true;
            }
        }
        
        return bRc;
    }

```

The start & stop functions works well, but the delete function deletes the DVR stream data in the disc as expected, but the internal DVR stream data remains in wowza server, for example:

- If I query the deleted stream using [Wowza-nDVR-Duration-Query-API](https://www.wowza.com/docs/wowza-ndvr-duration-query-api) it gives me same data as the stopped stream

- If I re-start the DVR, the times that the system gives me (using [Wowza-nDVR-Duration-Query-API](https://www.wowza.com/docs/wowza-ndvr-duration-query-api)) are incorrect, It seems that the stream is append but is not real because all previous contents in the disc have been deleted.

If I restart the server after the delete function all works good.

Anyone could tell me how delete the internal DVR stream data using the API please.

Thanks.

---

<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 14, 2014, 6:50pm UTC](https://community.wowza.com/t/the-dvr-internal-data-remains-after-deleted/41467/2 "2014-03-14T18:50:38Z")

</div>

I think the best way to do this is by setting a WindowDuration in your DVR configuration and letting Wowza handle managing these files. Deleting them yourself or programatically will have unexpected results

Richard
