Results 1 to 6 of 6

Thread: How many seconds user was watching video?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2014

    Post How many seconds user was watching video?


    I'd like to implement my own statistics sytem. I'm using this code to count how many seconds user was watching video but my tests are different then reality. For example i'm watching video and shutdown player in 10 sec. but logs show me then I was watching video 15 sec. I tested this module in RTMP, RTSP na HLS streaming but always result are bad. How can I solve this problem? Maybe someone has better method to do this?

    Example below:

    public void onStreamDestroy(IMediaStream stream)
    		getLogger().info("onStreamDestroy() - invoked");
    		IOPerformanceCounter perf = stream.getMediaIOPerformance();
    		Long outbytes = perf.getMessagesOutBytes();
    		getLogger().info("Outbytes: " + outbytes);
    		Double outrate = perf.getMessagesOutBytesRate();
    		getLogger().info("OutRate: " + outrate);
    		Double seconds = outbytes / outrate;
    		getLogger().info("Seconds: " + seconds);	

    After 10 sec logs show:

    INFO server comment - Outbytes: 2526989
    INFO server comment - OutRate: 80634.0
    INFO server comment - Seconds: 31.339000917727013
    It's 21 sec. mistake.
    Last edited by summer_soon; 06-20-2014 at 04:33 AM.

Similar Threads

  1. Insufficient permissions with ec2-user SSH user, how to log in as wowza user?
    By elyngved in forum Wowza Media Server 3 for Amazon EC2 Discussion
    Replies: 2
    Last Post: 05-24-2013, 01:39 PM
  2. Replies: 2
    Last Post: 08-19-2012, 06:34 AM
  3. Video Streaming terminating 5 seconds before the end of the video
    By rminari in forum Performance Tuning Discussion
    Replies: 4
    Last Post: 05-15-2012, 04:48 AM
  4. time watching video - vod app
    By Reinaldo Almeida in forum Server-side Modules and Code Samples Discussion
    Replies: 3
    Last Post: 01-20-2012, 01:32 PM
  5. Replies: 2
    Last Post: 11-24-2011, 09:36 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