Wowza Community

Adaptive bitrate with nDVR recording API

Hi,

I am using 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 ?

http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=stream_high_bitrate&recordingname=recording_1&action=start
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=stream_medium_bitrate&recordingname=recording_1&action=start
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 ?

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.

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.

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.

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

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

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?

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:
http://[wowza-ip-address]:8086/dvrstreamrecord?app=dvr&streamname=first_ch_200.stream&recordingname=first_ch_200&action=start

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

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:

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:

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!

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

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.

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!

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.