Results 1 to 9 of 9

Thread: Reliably track time spent viewing an HLS stream

  1. #1

    Default Reliably track time spent viewing an HLS stream

    Hi,

    I need to track the time in seconds that an HLS client spends viewing a live stream. What events should I be using, and what is the most reliable way to calculate the time in seconds?

    Thanks,
    Dan

  2. #2

    Default

    Anyone? Maybe this should have been posted in the help thread...

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Daniel,

    Take a look at this article:

    http://www.wowza.com/forums/content....nce-statistics

    Richard

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Note that Wowza has no way to know how long a user watched the chunks that were cached by the device.

    And the easier method is use log files, though they are not more accurate. Sawmill has a Wowza module.

    Richard
    Last edited by rrlanham; 07-23-2012 at 07:15 AM.

  5. #5

    Default

    Thanks Richard!

    The onHTTPSessionDestroy way is easier for me. I'm fine with tracking the amount of data sent to the client (in seconds), which it looks like I can do with the outbytes and outrate. I looked at the IOPerformanceCounter class and printed out all the stats before I posted this question, but I had a hard time determining how I could use them.

    How is the outrate measured? Is it an average of the bitrate of all off the chunks sent in this session?

    It looks like I can simply do this calculation in onHTTPSessionDestroy and be able to track the number of seconds of video sent to the client:

    Long outbytes = perf.getMessagesOutBytes();
    getLogger().info("Outbytes: " + outbytes);

    Double outrate = perf.getMessagesOutBytesRate();
    getLogger().info("OutRate: " + outrate);

    Double seconds = outbytes / outrate;
    getLogger().info("Seconds: " + seconds);


    Thanks,
    Dan

  6. #6
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Dan,

    The *BytesRate statistic is a rolling 5 second average, from what I understand.

    Richard

  7. #7

    Default

    Hi Richard,

    I tried to characterize this behaviour. The results seem deterministic, but the calculated seconds were always about 60 seconds longer than the duration I watched the live stream. Is there an easy explanation for this? The 60 second delta seemed consistent for all tests. I tested viewing a live stream over HLS for the following durations: 20 minutes, 15m, 10m, 5m, 4m, 3m, 2m, 1m, 30seconds, 20s, 15s, 10s, 5s, 1s.

    Thanks,
    Dan

  8. #8

    Default

    Probably HTTPSessionDestroy does not get fired until 60 seconds after the player disconnects. Run Wowza from the command line to see what's happening in real-time during your tests.

  9. #9
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    That is expected. Wowza doesn't know how much of the cache you played, just what it sent. I don't think this delta is a set amount of time, would have to test that, but I think it is more to do with the chunk size and number of chunks in device cache.

    The log files have the same problem, btw.

    Richard

Similar Threads

  1. Track the time a user has streamed an online video
    By harikrishna266 in forum Wowza Streaming Engine functionality
    Replies: 2
    Last Post: 04-19-2014, 12:36 AM
  2. HLS nDVR stream will not sync for a long time playing
    By guy1260 in forum AddOn: Wowza nDVR
    Replies: 4
    Last Post: 06-16-2013, 05:23 PM

Posting Permissions

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