2 Replies Latest reply on Jan 24, 2010 9:52 AM by rexdtripod

    Possible NetStream bufferLength bug?

    rexdtripod Level 1

      Platform: Flex/FMS, streaming H.264 live from FMLE

       

      I'm experiencing a problem that I've read a few others are having.  I've tried some logging to clearly illustrate the issue.

       

      The problem is the NetStream object reports the wrong value for bufferLength property, causing irratic playback behavior. I think it's a bug, but I wanted to run it by the folks here.

       

      Essentially the buffer doesn't fill to the full 20 seconds that I set it to.  It stops short because the NetStream bufferLength property jumps to a false, artificially high number, randomly.

       

       

      Below is a typical dump of my bufferLength property at 1 second intervals while live streaming. Note the quick jump from 5.987 to 37.95 after the first "Buffer empty" event. My buffer is set a 20 sec so the NetStream object properly fires the buffer full message, even though it is not really full (it thinks it is as 46.794 > 20).

       

      Note the subsequent correction shortly thereafter from 46.794 to 5.374 (the video skips wildly there).

       

      Note the "Buffer empty" event shortly thereafter, as the buffer was never really filled and didn't have far to go to be emptied.

       

       

      Again I have read of a few others experiencing the quick buffer empty/full and jump position symptoms but nobody has posted the data as below.  My take is that it's a bug.  Really can't think of programmatic circumstances that should have the bufferLength property jumping around so wildly from second to second.

       

      But I'm willing to entertain other insights.  They would be greatly appreciated.  Have important broadcasts coming up and am in dire need of a workaround.

       

      Thanks much.

       

      4.854

      4.538

      4.248

      3.815

      3.545

      3.249

      3.051

      2.503

      1.851

      1.242

      0.581

      Buffer empty:

      0.423

      0.919

      1.768

      2.591

      3.374

      4.21

      5.151

      5.987
      Buffer full:
      37.95
      47.596

      47.346

      47.251

      46.922

      46.731

      46.794
      5.374
      5.098

      4.429

      3.95

      3.334

      2.979

      2.441

      2.093

      1.869

      1.514

      1.479

      1.228

      0.88

      0.577

      0.483

      Buffer empty:

      0.521

      1.148

      2.062

      2.536

      3.264

      3.917

      4.753

      5.572

      6.268

      7.182

      8.018

      8.75

      9.638

      10.395

      10.657

      11.101

      11.611

      12.172

      12.694

      13.4

      13.922

      14.81

      15.568

      16.45

      17.266

      17.971

      18.676

      19.512

      Buffer full:

        • 1. Re: Possible NetStream bufferLength bug?
          rexdtripod Level 1

          It's my network at the office.  It's corrupting data before it reaches the video player.  The player uses this bad data and improperly calculates the current buffer size.  But read on.  Real good read for live streaming people.

           

          I've been doing extensive testing and observing.  You know, playing and encoding from different locations.  I get the problem repeatedly while playing the video at my office (dual T1's) no matter where I encode from, my office or offsite.  I don't get it if I PLAY the video from home on a cable connection or on an AIR card in a laptop; again, no matter the encoding location.  I can run for an hour at a ridiculously high bitrate (like 2000kbps).  I do not get the bad bufferLength data problem once.  The player obviously struggles to keep up with the high data rate but it functions properly.  It plays through it's buffered data completely, stops, rebuffers completely, plays and repeats the cycle.  At the really high data rate I can rebuffer say 90 times in 60 mins.  Never get bad bufferLength data values.

           

          Playing at the office, I repeatedly get bad data values like those listed in this post.

           

          Obviously not a Flash bug.  It's bad data reaching the player.

           

          Would love to know the exact anatomy of the problem.

           

          Not an expert but I imagine the player has to calculate the data it thinks is in the buffer based on metadata contained within the live stream.  Maybe things like frames per second and resolution and such.  Somehow it must get bad values for these things.  How?  From the stream source - FMS?  Not likely.  From the same FMS source I get no data errors at the player if I play from home or on an AIR card.  So it's the network at my office because it happens on all machines there.

           

          Easy to say well the network has a poor design or faulty switches or routers, but what specifically about that causes the bad data values in the live stream.  Is it corrupted packets or lost packets?  Would love to know the exact anatomy there.

          • 2. Re: Possible NetStream bufferLength bug?  Urgent, please respond.
            rexdtripod Level 1

            Turns out this is not my network.  I'm experiencing the problem offsite and on 3G cards as well.

             

            I really don't understand it.  How can anything I do in my application cause the bufferLengh property to contain the wrong value?  I have definitely demonstrated that the numbers returned are wrong. When buffering up and checking the time in the buffer every second, the numbers 37.95-46.794 below are definitely wrong.  This must be a bug.

             

            Could someone from Adobe please respond to this issue.  It is wrecking playback.  I enter repeated buffering cycles because the buffer never fills to the 20 seconds I've set it to.  The false values are killing the playback functionality.

             

            I was under the impression that when I play my live stream, and set a bufferTime property of 20 seconds, that it would buffer that full amount before playing.  What am I doing wrong?  Doesn't seem like there is much to it.  Set the NetStream bufferTime property to 20, like so,

             

            ns.bufferTime = 20;

             

            And playback should wait until 20 seconds worth of data are in the buffer before playback occurs.  How can I screw this up?

             

            Buffer empty:

            0.423

            0.919

            1.768

            2.591

            3.374

            4.21

            5.151

            5.987
            Buffer full:
            37.95
            47.596

            47.346

            47.251

            46.922

            46.731

            46.794
            5.374

            5.098

            4.429

            3.95

            3.334