Page 1 of 3 123 LastLast
Results 1 to 10 of 30

Thread: Adaptive Bitrate with nDVR

  1. #1

    Default Adaptive Bitrate with nDVR

    Hi,

    I am using nDVR addon and I want to achieve adaptive bit rate streaming. My encoder is capable to creating key frame aligned streams from a single stream. I have modified the nDVR HTTPProvider code (com.wowza.wms.plugin.dvrstreamrecord.HTTPDvrStreamRecord) to start and stop recording of the multiple streams by calling following url.

    http://[wowza-ip-address]:8086/dvrstreamrecord?app=[application-name]&streamnameprefix=[stream-name-prefix]&recordingname=[recording-name]&action=[start|stop]
    The modification that I did just calls "start record" function on the stream names inferred from "streamnameprefix" parameter. So lets say I have 3 stream then it will call "start record" function 3 times on each stream one after another. Is there a different way to start multiple stream recordings simultaneously.

  2. #2

    Default

    That seems like a good way. There are other ways to record. The LiveStreamRecord module has an example for starting/stopping recording using a flash app. Is there some other functionality that you need?

  3. #3

    Default

    In my case the recording starts and stops without user interaction, I am using cron jobs. Thats why I had to modifiy it like this.
    In my java code I am calling start recording on each stream one after another now I am wondering will this cause any problem if I where to use these 3 stream for ABR streaming..

  4. #4

    Default

    Quote Originally Posted by josnidhin View Post
    In my case the recording starts and stops without user interaction, I am using cron jobs. Thats why I had to modifiy it like this.
    In my java code I am calling start recording on each stream one after another now I am wondering will this cause any problem if I where to use these 3 stream for ABR streaming..
    That seems like a reasonable way to do it.

  5. #5
    Join Date
    Nov 2011
    Posts
    14

    Default

    Hi Scott,

    I have modified the HTTPProvider in order to start recording 3 streams and am able to do so.
    I am testing 3 bitrates with FMLE and recording the videos on Amazon EC2.

    The recordings are started and stopped together in the HTTPProvider code. The start and stop commands are 1 hour apart.
    So, I would expect all the 3 bitrate recordings to be of 1 hour length. However, the highest bitrate recording length is only 50 minutes.
    The lowest and medium bitrate recordings are closer to 1 hour (about 59 minutes). What could the issue be ?

  6. #6

    Default

    Quote Originally Posted by db_2011 View Post
    Hi Scott,

    I have modified the HTTPProvider in order to start recording 3 streams and am able to do so.
    I am testing 3 bitrates with FMLE and recording the videos on Amazon EC2.

    The recordings are started and stopped together in the HTTPProvider code. The start and stop commands are 1 hour apart.
    So, I would expect all the 3 bitrate recordings to be of 1 hour length. However, the highest bitrate recording length is only 50 minutes.
    The lowest and medium bitrate recordings are closer to 1 hour (about 59 minutes). What could the issue be ?
    My initial guess is that the higher bitrate streams are dropping frames.
    I would look in your log for warnings and errors.

    DVR logs info regarding the first 10 chunks of each stream. I would make sure they are recording generally in sync. You can change the property dvrMaxChunkLogCount to 0 to report all chunks to your log. See here: http://www.wowza.com/forums/content....-Configuration

  7. #7

    Default

    Would this likely be an encoder issue - ie the encoder cannot encode the video fast enough or is this a network issue? Is there some sort of admin interface that would help tell identify the gaps in the dvr'd content easily. Something that says minute 1-13 was recorded, but minutes 13-15 were dropped?

  8. #8

    Default

    Quote Originally Posted by cnfcnf View Post
    Would this likely be an encoder issue - ie the encoder cannot encode the video fast enough or is this a network issue? Is there some sort of admin interface that would help tell identify the gaps in the dvr'd content easily. Something that says minute 1-13 was recorded, but minutes 13-15 were dropped?
    Yes, it could be either network or encoder.

    I would look in the log file for any suspicious warnings/errors.
    When DVR senses there is a gap in the recording, it resets the time mapping between DVR time, packet time, and UTC time. You'll see a log message like this:
    DvrStreamStoreBase.storeChunks[live/_definst_/liveGapD1/liveGapD1.0] : Resetting dvr time from dvr:0/pt:0 to dvr:14370/pt:36066/rt: (Nov 30, 2011 5:02:36 PM)
    This means that DVR time of 14.370 seconds maps to packet time 36066 and the specified real/UTC time.

  9. #9

    Default

    Thanks. I'm just wondering if there is some java code we could insert somewhere to help extract the above information programmatically. For instance, let's say I have the nDVR operating overnight. I want to wake up in the morning and see.

    1. Recorded show a - from 2 am to 3 am (server time). Expected length 60 minutes. Actual length of low bit rate stream 58 min, med bit rate: 57 min and high bitrate: 50 min. Missed chuncks, min 1-2 for low bit rate, minute 2-3 and 4-7 for high bit rate.


    How would I do something like the above to look at the videos and easily identify patterns of error? Would I need to put this in the livestreamrevorder code?

  10. #10

    Default

    Quote Originally Posted by cnfcnf View Post
    Thanks. I'm just wondering if there is some java code we could insert somewhere to help extract the above information programmatically. For instance, let's say I have the nDVR operating overnight. I want to wake up in the morning and see.

    1. Recorded show a - from 2 am to 3 am (server time). Expected length 60 minutes. Actual length of low bit rate stream 58 min, med bit rate: 57 min and high bitrate: 50 min. Missed chuncks, min 1-2 for low bit rate, minute 2-3 and 4-7 for high bit rate.


    How would I do something like the above to look at the videos and easily identify patterns of error? Would I need to put this in the livestreamrevorder code?
    Just FYI. There is some code being worked currently around gap analysis in order to support better alignment of mbr/abr streams. So, some of what I tell you regarding API will likely change (for the better as there should be more information at your disposal for this).

    So if you want to analyze the recording after it has recorded, I would start by using an HTTP Provider. I hacked up some pseudo code to grab the DVR's manifest after it has recorded: http://www.wowza.com/forums/showthre...1908#post81908

    For background, the manifest consists of separate channels, which are essentially other manifests of specific types. So there's a manifest channel for audio records, one for video, one for data, etc. The one you want is for time map entries. This maps the dvrTime to the packet and utc times in the recording. Each recording has at least one time record-- the first one that maps dvrTime=0 to the packet time of the first chunk and the utcTime (the utc time that the chunks initial packet was received by Wowza) of the first chunk.

    If everything goes without a hitch there will only be one time map record. However, if packet times get loopy (jump around, skip back in time), or if the incoming stream stop streaming, the dvr will sense this and a second time map record will be created that maps dvrTime to a new packet and utc time. So you can loop through the records, and compare the deltas between dvrTimes and packet times to find gaps.

    Here's a code snippet that should get you from the example above to the time records:

    DvrChannelManifest timeMap = manifest.getManifestChannel(DvrManifestBase.TIME_MAP_TYPE);
    List<DvrManifestEntry> entries = timeMap.getRecordedEntries();
    for (DvrManifestEntry entry : entries) {
        DvrManifestTimeMapEntry tme = (DvrManifestTimeMapEntry)entry;
        TimeMapRecord tm = tme.getTimeMapping();
    				
        System.out.printf("time map: d:%d -> pt:%d utc:%d\n", tm.getDvrTime(), tm.getPacketTimecode(), tm.getUtcTimecode());
    }
    This API is in the process of being changed slightly, so at some point this code will no longer compile. I'll try to remember to update it and may use this gap analysis idea for an example article to demonstrate the API.

    Scott
    Last edited by ScottKell; 12-12-2011 at 02:16 PM.

Page 1 of 3 123 LastLast

Similar Threads

  1. Bad Strobe Playback performance nDVR Adaptive bitrate
    By videodock in forum AddOn: Wowza nDVR
    Replies: 1
    Last Post: 07-02-2012, 03:58 PM
  2. Adaptive Bitrate, nDVR, SMIL and OSMF Strobe
    By nonsense in forum AddOn: Wowza nDVR
    Replies: 3
    Last Post: 06-28-2012, 02:38 PM
  3. Adaptive bitrate with nDVR recording API
    By db_2011 in forum AddOn: Wowza nDVR
    Replies: 9
    Last Post: 04-11-2012, 08:47 AM
  4. Adaptive bitrate, force a bitrate via HTTPProvider
    By Meinaart in forum Server-side Modules and Code Samples Discussion
    Replies: 9
    Last Post: 04-05-2012, 10:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •