Post a new question



How do I delete or clear out existing dvr streams?

Ricardo 2016-08-05 01:31:18 UTC in Nimble Streamer

Is there a URL API for doing this?

I deleted content (the UTC directories) off the server but that kind of messes things up. Probably nimble streamer keeps state information.

But I need to be able to keep unique dvr streams, but seeming as that is not possible, at a minimum I need to clear out previous content in order to have a new stream recorded.

Max 2016-08-05 07:50:11 UTC

Hello Ricardo,

You can delete archive content clicking "Remove" button for the corresponding archive on page or you can use Nimble management API ( posting to /manage/dvr/cleanup_archive/<stream_name> (e.g. /manage/dvr/cleanup_archive/live/stream to cleanup DVR archive for /live/stream).

Please note that this interface is currently not described on page, we'll update the page in couple of days.

Ricardo 2016-08-05 16:16:45 UTC

Thanks Max.

Is there a way to do this programatically, via PHP?

Ricardo 2016-08-05 16:23:18 UTC

Actually, not even php, I would be using a perl script server-side to automatically do the cleanup

Max 2016-08-05 18:16:33 UTC

In order to clear DVR archive you need to make a HTTP POST request to Nimble, e.g. you can do that from command line using "curl -X POST http://server:management_port/manage/dvr/cleanup_archive/live/stream" command.

Please check documentation or google how to do that on PHP or Perl.

Ricardo 2016-08-05 21:23:24 UTC

Hi Max,

I tried that from the command line (the stream name is test),

curl -X POST http://localhost:8080/manage/dvr/cleanup_archive/live/test

And I get a not implemented error

<html><head><title>Not Implemented</title></head><body>Not Implemented</body></html>

Max 2016-08-05 21:34:44 UTC


This POST should be send to management interface, please read documentation about it on page.

Ricardo 2016-08-05 21:46:01 UTC

Thanks for the clarification!

On a different subject (I know I do have another post on this, sorry to bring it up here ) do you happen to have any experience with the MP4 conversion of playlist_dvr?

Yury Udovichenko 2016-08-08 01:51:33 UTC

Hi Ricardo,

Have you seen this discussion?

Ricardo 2016-08-08 04:23:37 UTC


Yes I have. The only way to properly do it is to use the play_dvr_range when there are multiple sessions.

If I attempt to do the full playlist_dvr.m3u8 into ffmpeg when there are multiple sessions it encounters continuity errors and doesn't work properly

Max 2016-08-08 07:01:23 UTC

Hello Ricardo,

You can get DVR archive timeline using /manage/dvr_status Nimble API with timeline parameter, e.g. "curl -v http://localhost:8080/manage/dvr_status?timeline=true" and use this timeline to get archive segments separately using EPG requests.

Ricardo 2016-08-08 17:42:28 UTC

Oh, that's great information... thanks Max!

Is that an output that I can parse using an xml parser?

Max 2016-08-08 18:49:04 UTC

Nimble sends response in json format, not xml, you can parse it using json parser.

Joël 2016-08-25 21:16:35 UTC

Hi, I had same challenge to start with an empty DRV folder, with live streaming every time.
I do it with a cronjob, so you can easily schedule, the api function and erase the folder at any moment you want.
because the delete function, curl -X DELETE, for DVR by api wasn't available for a long time, I used the update function for dvr (-X PUT -H)
here a little example:

Update the DVR settings to a different path
* 6 * * 1 /usr/bin/curl -X PUT -H 'Content-Type: application/json' -d '{"application":"application-name","stream":"stream-name","path":"/path-to-original-folder
* 6 * * 2 /usr/bin/curl -X PUT -H 'Content-Type: application/json' -d '{"application":"application-name","stream":"stream-name","path":"/path-to-second-folder
* 6 * * 3 /usr/bin/curl -X PUT -H 'Content-Type: application/json' -d '{"application":"application-name","stream":"stream-name","path":"/path-to-third-folder
* 6 * * 4 /usr/bin/curl -X PUT -H 'Content-Type: application/json' -d '{"application":"application-name","stream":"stream-name","path":"/path-to-original-folder

* 5* * 1 rm -rf //dvr-path-to-original-folder/* (delete dvr folder at monday 5am)
* 5* * 2 rm -rf //dvr-path-to-second-folder/* (delete dvr folder at tuesday 5am)
* 5* * 3 rm -rf //dvr-path-to-third-folder/* (delete dvr folder at wednesday 5am)
* 5* * 4 rm -rf //dvr-path-to-original-folder/* (delete dvr folder at thursday 5am)

Post a reply