Skip navigation
Currently Being Moderated

bite-rate calculate

Jun 13, 2012 2:28 AM

is this possible to calculate playing video bite-rate through as3 ?

 
Replies
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 13, 2012 6:12 AM   in reply to Venkom

    the bitrate is a property of an event object received by the metadataevent.  so, you can just "read" it by listening for the metadataevent.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 15, 2012 6:40 AM   in reply to Venkom

    that's not the bitrate.  you want to determine the download rate.

     

    for that use:

     

     

     

    var previouslyExecuted:Boolean;

    if(!previouslyExecuted){

    previouslyExecuted=true;

    var totalKb:Number;

    var previousTotalKb:Number=0;

    var myInterval:uint;

    }

     

    function videoInfo():void

    {

              totalKb = ((ns.info.byteCount* 8) / 1024);

              trace (totalKb-previousTotalKb);

    previousTotalKb=totalKb

    }

     

    clearInterval(myInterval);

    myInterval = setInterval (videoInfo, 10000);

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 17, 2012 6:37 AM   in reply to Venkom

    you're welcome.

     

    p.s.  if you also want the bitrate, use the metadataevent.  exactly how you do that depends on whether you're using netstream or an flvplayback component.

     
    |
    Mark as:
  • kglad
    62,004 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 19, 2012 11:36 AM   in reply to Venkom

    if you want to send totalKB-previousTotalKb to your js function use:

     

    function videoInfo():void

    {

              totalKB = ((ns.info.byteCount* 8)/1024);

              trace (totalKB - previousTotalKb);

    flash.external.ExternalInterface.call("sendToJS", totalKB-previousTotalKb);

              previousTotalKb = totalKB;

             

    }

     

    clearInterval(myInterval);

    myInterval = setInterval(videoInfo, 10000);

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points