# Adaptive bitrate with nDVR recording API

**URL:** <https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542>\
**Category:** Wowza Streaming Engine\
**Created:** [November 24, 2011, 1:58am UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542 "2011-11-24T01:58:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Divya\_Bhargov1](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@Divya\_Bhargov1](https://community.wowza.com/u/Divya_Bhargov1)\
**Post date:** [November 24, 2011, 1:58am UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/1 "2011-11-24T01:58:35Z")

</div>

Hi,

I am using nDVR recording api ([https://www.wowza.com/docs/how-to-use-wowza-ndvr-recording-api](https://www.wowza.com/docs/how-to-use-wowza-ndvr-recording-api)) to record an incoming stream with various names based on the show names.

I now want to implement bit rate switching so that the video switches from high to low bit rate whenever there is a low bandwidth seamlessly. I understand I can use the Wowza trasnscoder addon to achieve the transrating so that the incoming stream is split into low, medium and high bitrate streams which are key-frame aligned. After this, I should be creating an SMIL file to specify the various bit rates.

Now, how will this work with nDVR recording API ?

Say I have the incoming stream split into stream\_high\_bitrate, stream\_medium\_rate and stream\_low\_bitrate which are of different bitrates.

When I require to start the recording with a name ‘recording\_1’, should I be starting up all the 3 bitrates like this ?

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=stream_high_bitrate&recordingname=recording_1&action=start

```

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=stream_medium_bitrate&recordingname=recording_1&action=start

```

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=stream_low_bitrate&recordingname=recording_1&action=start

```

In that case, would SMIL file contain the recording names instead of the stream names ? The recording names keep changing, so how can this be updated in SMIL file dynamically ? And what if there is a latency between starting the three recordings ?

---

<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:** [November 24, 2011, 9:10am UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/2 "2011-11-24T09:10:29Z")

</div>

Yes, you need to start recording all the bitrates.

You’ll have to manage your own smil files.

I would modify the HTTP DVR Recording example to start the 3 streams simultaneously and at the same time generate your smil file.

---

<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:** [November 24, 2011, 12:37pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/3 "2011-11-24T12:37:18Z")

</div>

> Starting the recording of the streams simultaneously would be very helpful. Could you provide the source code to do this? I would imagine it is a common requirement?

you look at the recording ndvr article,

There is http provider source code. Which you can modify to do

multiple streams.

---

<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:** [November 24, 2011, 10:18pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/4 "2011-11-24T22:18:11Z")

</div>

> Thanks Scott,
> 
> Looking forward to see the modified HTTP DVR Recording example to start the 3 streams simultaneously and at the same time generate the smil file.

You may have misunderstood. I’m not planning on providing a new example.

You’ll have to use the current example as a starting point.

---

<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:** [April 10, 2012, 2:22pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/5 "2012-04-10T14:22:43Z")

</div>

Similar to other nDVR URLs, you will need to add “?DVR” to the end of the URL for playing back a SMIL file.

```auto
http://[wowza-ip-address]/live/smil:first_ch.smil/playlist.m3u8?DVR

```

Typically HTTP streaming requires 3 chunks of data to begin streaming, so there is some expected latency. I don’t think it would be different latency for adaptive bitrate. What are you seeing?

-Lisa

---

<div class="post-metadata">

**Author:** ![C\_F](https://avatars.discourse-cdn.com/v4/letter/c/c0e974/32.png) [@C\_F](https://community.wowza.com/u/C_F)\
**Post date:** [November 24, 2011, 11:33pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/6 "2011-11-24T23:33:52Z")

</div>

Starting the recording of the streams simultaneously would be very helpful. Could you provide the source code to do this? I would imagine it is a common requirement?

---

<div class="post-metadata">

**Author:** ![Vasya\_Volkov](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vasya\_Volkov](https://community.wowza.com/u/Vasya_Volkov)\
**Post date:** [April 10, 2012, 8:11pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/7 "2012-04-10T20:11:04Z")

</div>

Hi, Scott

There were questions from db\_2011 but he asked them many time ago.

I ask again similiar questions. Maybe there was any progress in this case:

1. How can I achieve **adaptive bitrate with dvr recording API**? I mean I have got 3 bitrates (200 kbps, 300 kbps, 500 kbps) of channel “first\_ch” which I can record. And by recording API I’ll record them into 3 different folders which I’ll name like “first\_ch\_200” “first\_ch\_300” “first\_ch\_500” by requests like these:

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=first_ch_200.stream&recordingname=first_ch_200&action=start

```

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=first_ch_300.stream&recordingname=first_ch_300&action=start

```

```auto
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=first_ch_500.stream&recordingname=first_ch_500&action=start

```

I can do this by default code of your Recording API. And I can request them or parts of them selectively by Playlist Request Delegate API by URLs like that:

```auto
http://[wowza-ip-address]/live/first_ch_500/playlist.m3u8?DVR&wowzadvrplayliststart=72000000&wowzadvrplaylistduration=300000

```

And my question is how can I get them simultaneously with adaptive feature? As I can do with plain streams by grouping them into smil file and then I can request them with adaptive feature:

```auto
http://[wowza-ip-address]/live/smil:first_ch.smil/playlist.m3u8

```

Is there any way to do this?

1. When I starting up all the 3 bitrates like that requests that I wrote above there will be a little latency between start times of that three recordings. So what if it is? And does Playlist Request Delegate API process it right? And in general does Playlist Request Delegate API can be implemented in such requests?

Thanks!

---

<div class="post-metadata">

**Author:** ![Vasya\_Volkov](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vasya\_Volkov](https://community.wowza.com/u/Vasya_Volkov)\
**Post date:** [April 11, 2012, 9:25am UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/8 "2012-04-11T09:25:58Z")

</div>

> Similar to other nDVR URLs, you will need to add “?DVR” to the end of the URL for playing back a SMIL file.
> 
> ```auto
> http://[wowza-ip-address]/live/smil:first_ch.smil/playlist.m3u8?DVR
> 
> ```
> 
> Typically HTTP streaming requires 3 chunks of data to begin streaming, so there is some expected latency. I don’t think it would be different latency for adaptive bitrate. What are you seeing?
> 
> -Lisa

Hi!

Yes I know about this but I’ve asked about case when I use Recording API and questions regard only that case.

Thanks.

---

<div class="post-metadata">

**Author:** ![Vasya\_Volkov](https://avatars.discourse-cdn.com/v4/letter/v/ba9def/32.png) [@Vasya\_Volkov](https://community.wowza.com/u/Vasya_Volkov)\
**Post date:** [April 11, 2012, 6:47pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/9 "2012-04-11T18:47:45Z")

</div>

Ok! I’ve got it!

I’ve run three streams at once with requests that I wrote above and than generate smil file which refers to folder names of my recordings and all works!

Thanks!

---

<div class="post-metadata">

**Author:** ![Divya\_Bhargov1](https://avatars.discourse-cdn.com/v4/letter/d/ecb155/32.png) [@Divya\_Bhargov1](https://community.wowza.com/u/Divya_Bhargov1)\
**Post date:** [November 24, 2011, 6:42pm UTC](https://community.wowza.com/t/adaptive-bitrate-with-ndvr-recording-api/37542/10 "2011-11-24T18:42:46Z")

</div>

Thanks Scott,

Looking forward to see the modified HTTP DVR Recording example to start the 3 streams simultaneously and at the same time generate the smil file.
