# Ndvr time shifting and recording

**URL:** <https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095>\
**Category:** Wowza Streaming Engine\
**Created:** [August 7, 2012, 7:46am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095 "2012-08-07T07:46:10Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 7, 2012, 7:46am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/1 "2012-08-07T07:46:10Z")

</div>

Hi

I have a couple of question’s and i was hoping that you can help me we that.

1. I have 7 live streams and i want for each of them to recored the last 12 hours, so that i will alweys have

12 hours back. will the deletion of older files be automaticly? for example if i recored the 13 hour the first hour will be deleted or should i use my own custom module/script?

1. i want to implement a time shifting mechanizem. there is the

> Wowza nDVR Playlist Request API

In the document there is an example of

```auto
wowzadvrplayliststart=

```

but as i understood it’s the time from the begining af the recording

I want for example 2 hours back from the last point how do i do that?

---

<div class="post-metadata">

**Author:** ![Gustavo\_Villegas](https://avatars.discourse-cdn.com/v4/letter/g/57b2e6/32.png) [@Gustavo\_Villegas](https://community.wowza.com/u/Gustavo_Villegas)\
**Post date:** [August 7, 2012, 9:31pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/2 "2012-08-07T21:31:17Z")

</div>

to do live time shifting, I had to develope your own module for that as it’s not only starting 2 hours ago but treating the stream as a live one, with constant update of the manifest

---

<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:** [August 9, 2012, 12:09am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/3 "2012-08-09T00:09:32Z")

</div>

You would have to write a custom playlist delegate class. The provided one doesn’t allow a delta from the last recorded time—it uses an absolute start time into the recording. However, the nDVR Playlist API doc has the code for a playlist and also sample code for querying start and end times of a DVR recording.

We recommend you add logging to your custom delegate during development to verify you’re doing what you intend. If you specify an incorrect playlist delegate the default behavior is to return the entire dvr recording.

Richard

---

<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:** [August 9, 2012, 10:37pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/4 "2012-08-09T22:37:17Z")

</div>

Yes, I don’t think Wowza deletes anything, content outside the WindowDuraton is purged from the chunklist

Richard

---

<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:** [August 10, 2012, 3:34pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/5 "2012-08-10T15:34:39Z")

</div>

Wowza nDVR deletes chunks outside the window duration when DVR is actively recording something. When folders within the recording are empty they get deleted too. But Wowza nDVR does not delete entire old recordings

Richard

---

<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:** [August 21, 2012, 1:36pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/6 "2012-08-21T13:36:31Z")

</div>

I’m not sure, and it is not specified in the guide, but try “-1”, which means play to the end of the file or play the live stream indefinitely in other contexts

Richard

---

<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:** [August 21, 2012, 2:29pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/7 "2012-08-21T14:29:45Z")

</div>

I’ll ask around.

Richard

---

<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:** [August 22, 2012, 12:50am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/8 "2012-08-22T00:50:25Z")

</div>

Actually, end is not required. The article talks about it. And there are debug options in the article that can be turned on to help debug the playlist delegate

Richard

---

<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:** [August 22, 2012, 7:04pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/9 "2012-08-22T19:04:23Z")

</div>

Stop Wowza then delete or rename the current access log, then restart Wowza and do full test run. Then zip up conf folder and the current access and error log showing these tests. Please send conf folder as it was during the tests

Include a link to this thread for reference

Richard

---

<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:** [August 28, 2012, 8:15pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/10 "2012-08-28T20:15:43Z")

</div>

I have been looking at it. I don’t see anything obvious There is this curious WARN line followed by in about the delegate including “playlistEnd:ignored”

```auto
WARN	200	-	utc-Sat Aug 25 11:30:00 EEST 2012
INFO	200	-	DvrStartDurationPlaylistRequestDelegate : Available Playlist : {DvrPlaylistRequest: [live] timeScale:UTC_TIME playlistStart:1345883400000, playlistEnd:ignored} 

```

The playlistStart value is less then the UTC times in the debug lines above. I suppose that means it is valid. Have you tried other start values within the range of the utcTime values output in the access log?

```auto
first : dvrTime: 488362311 pt: 181022709 utcTime:20120825082319
-
lastLive : dvrTime: 502741311 pt: 195401709 utcTime:20120825122258
-
lastRec : dvrTime: 502767167 pt: 4564274 utcTime:20120825122348
-
timeSpan : dvrTime: 0 pt: 65942904 utcTime:20120819142220
-
timeSpan : dvrTime: 2849266 pt: 68800320 utcTime:20120819150958
-
timeSpan : dvrTime: 2977650 pt: 68958613 utcTime:20120819151236
-
timeSpan : dvrTime: 3170800 pt: 69161705 utcTime:20120819151559
-
timeSpan : dvrTime: 84570214 pt: 55128409 utcTime:20120820135250
-
timeSpan : dvrTime: 88763496 pt: 59371691 utcTime:20120820150333
-
timeSpan : dvrTime: 94636015 pt: 65257607 utcTime:20120820164139
-
timeSpan : dvrTime: 95833579 pt: 66537531 utcTime:20120820170259
-
timeSpan : dvrTime: 169085354 pt: 44375108 utcTime:20120821132421
-
timeSpan : dvrTime: 169220874 pt: 44634332 utcTime:20120821132841
-
timeSpan : dvrTime: 169348490 pt: 44982363 utcTime:20120821133428
-
timeSpan : dvrTime: 172982795 pt: 48640204 utcTime:20120821143526
-
timeSpan : dvrTime: 173477539 pt: 49183733 utcTime:20120821144430
-
timeSpan : dvrTime: 173548835 pt: 49276916 utcTime:20120821144603
-
timeSpan : dvrTime: 175401387 pt: 51163988 utcTime:20120821151730
-
timeSpan : dvrTime: 176910527 pt: 52707588 utcTime:20120821154314
-
timeSpan : dvrTime: 181691127 pt: 57518188 utcTime:20120821170324
-
timeSpan : dvrTime: 191397088 pt: 67250090 utcTime:20120821194536
-
timeSpan : dvrTime: 192346146 pt: 68229148 utcTime:20120821200155
-
timeSpan : dvrTime: 192990889 pt: 68901923 utcTime:20120821201309
-
timeSpan : dvrTime: 193981989 pt: 69960521 utcTime:20120821203047
-
timeSpan : dvrTime: 212241746 pt: 95403998 utcTime:20120822033454
-
timeSpan : dvrTime: 249710343 pt: 37461318 utcTime:20120822135952
-
timeSpan : dvrTime: 255689747 pt: 43510649 utcTime:20120822154041
-
timeSpan : dvrTime: 255953340 pt: 43785282 utcTime:20120822154516
-
timeSpan : dvrTime: 267513260 pt: 55371116 utcTime:20120822185822
-
timeSpan : dvrTime: 328887365 pt: 21331244 utcTime:20120823120146
-
timeSpan : dvrTime: 336048554 pt: 28597812 utcTime:20120823140253
-
timeSpan : dvrTime: 336252274 pt: 28841445 utcTime:20120823140656
-
timeSpan : dvrTime: 338112641 pt: 30708531 utcTime:20120823143804
-
timeSpan : dvrTime: 375697605 pt: 68358003 utcTime:20120824010533
-
timeSpan : dvrTime: 502751311 pt: 4548418 utcTime:20120825122333

```

Richard

---

<div class="post-metadata">

**Author:** ![Scott\_Kellicker](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@Scott\_Kellicker](https://community.wowza.com/u/Scott_Kellicker)\
**Post date:** [August 29, 2012, 7:08am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/11 "2012-08-29T07:08:13Z")

</div>

Hi,

Can you please provide the following and I’ll take a look.

- Your source code for the module.

- Your App.xml where you configure the delegate (or at least show the relevant sections)

- Instructions for how you request the playlist-- both one that works and one that doesn’t.

- Description of behavior when it works and when it doesn’t, including relevant log lines that show Available and Resolved playlists.

---

<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:** [August 14, 2012, 4:10pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/12 "2012-08-14T16:10:57Z")

</div>

The directory numbering will continue to increase the count by 1 when it reaches 9999. I would suggest recording to separate programs so that you can more easily scale and it will also less risky to not have all the programs recording to 1 file.

Which directories are being deleted unexpectedly? Check the contents of the folders that remain. It is possible that there is an .m4fm file, which are written much less often than .m4fa and .m4fv files, that is in a folder related to a current recording. As previously stated, an empty folder will be deleted. Note if ArchiveStrategy set to delete, then if there was a previous recording by the same name, it will be deleted and overwritten with the newer recording.

I think you are asking if you can record with the nDVR recording API and play back live and vod. This is possible and you’ll need to manage deleting the older recordings yourself outside of Wowza nDVR.

-Lisa

---

<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:** [August 28, 2012, 7:14pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/13 "2012-08-28T19:14:15Z")

</div>

Also, if you are playing back a live stream (vs. a pre-recorded nDVR store), the “playlistEnd:ignored” message is all right. It indicates live playback since it does not know when the end will be.

-Lisa

---

<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:** [October 17, 2012, 5:10pm UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/14 "2012-10-17T17:10:20Z")

</div>

I think what you are seeing is a function of how the player reacts. Which player are you using? If you wish to have the player start from a certain time and not the live point, then you need to tell the player where to start playing back through some client-side mechanism. If you are using the OSMF player, I don’t think there is an easy way to achieve this.

-Lisa

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 9, 2012, 6:48am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/15 "2012-08-09T06:48:24Z")

</div>

Richard anther question

i have set the ndvr with the fallowing:

> 7200

> Name\>dvrMaximumRecordingLength
> 
> 21600
> 
> Integer
> 
> dvrChunkGroupingSeconds
> 
> 3600
> 
> Integer

group of 6 directories with window duration for 2 hours.

my problem is that after 6 hours i’t dosn’t delete the older directories is that normal?

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 12, 2012, 1:31am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/16 "2012-08-12T01:31:23Z")

</div>

ok i understand now.

in post #4 in this thread i have mentiond my current configuration but i think something is wrong.

allthow some directories are geting deleted the numbering is still runing what will hapen after 416 days when the dir name will be 9999?

becouse it’s a live stream with paid customers i can afford stoping the stream or the ndvr mechanizem.

i want to use the recording api for live recording according to epg.

how can i use that with a timeshift mechanizem ? becouse i want my users to have timeshift for all and also the recording according to epg.

can i do them bouth at the same time?

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 21, 2012, 5:24am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/17 "2012-08-21T05:24:31Z")

</div>

I have a small problem.

I have copies the DvrStartDurationPlaylistRequestDelegate from the “How to use Wowza nDVR Playlist Request API” Article and manged to shift time according to the wowzadvrplayliststart parmeter in the url.

so far so good.

my problem is that if i dont set the wowzadvrplaylistduration it dosn’t work at all. that is an issue becouse i want to build a time shift module

i want to play from a spesific point but without specifing an ending. can that be done?

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 21, 2012, 6:08am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/18 "2012-08-21T06:08:14Z")

</div>

Hi RIchard

thanks for the quick replay.

well richard i tried that don’t seem to work.

like i said i want a begin time but not an end time so if you maybe have anu ather suggistens it will be nice

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 22, 2012, 8:17am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/19 "2012-08-22T08:17:31Z")

</div>

Hi Richard

no matter what I do if I don’t specify the duration it will not work for me.

> Available Playlist : {DvrPlaylistRequest: [live] timeScale:UTC\_TIME playlistStart:1345648800000, playlistEnd:ignored}

I have checked many times the date and it should work even if i copy paste the DvrStartDurationPlaylistRequestDelegate module from api it acts the same.

this is my xml configuration:

> dvrrecorder
> 
> dvrfilestorage
> 
> 14400
> 
> c:/dvr
> 
> append
> 
> dvrMaximumRecordingLength
> 
> 21600
> 
> Integer
> 
> dvrChunkGroupingSeconds
> 
> 3600
> 
> Integer
> 
> streamTimeout
> 
> 1000000
> 
> Integer
> 
> dvrPlaylistRequestDelegate
> 
> com.estima.wms.module.DvrStartDurationPlaylistRequestDelegate
> 
> dvrPlaylistDurationQueryParameter
> 
> wowzadvrplaylistduration
> 
> dvrPlaylistStartQueryParameter
> 
> wowzadvrplayliststart
> 
> dvrPlaylistDebugRequests
> 
> true
> 
> Boolean

help is needed

Thx

---

<div class="post-metadata">

**Author:** ![asher\_davidof](https://avatars.discourse-cdn.com/v4/letter/a/d07c76/32.png) [@asher\_davidof](https://community.wowza.com/u/asher_davidof)\
**Post date:** [August 28, 2012, 4:37am UTC](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095/20 "2012-08-28T04:37:47Z")

</div>

Hi

I have resand the logs and conf folder on the 25th

is there any update on the matter?

[Next page](https://community.wowza.com/t/ndvr-time-shifting-and-recording/37095.md?page=2)
