4 Replies Latest reply on Jun 24, 2010 10:15 AM by andrepazleal

    NetStream causes 100% disk use and eventual browser crash

    TheNuttyNut

      I've run into a troubling issue where using the NetStream class is causing odd video playback behaviour, major disk query issues, and also leading to my browsers crashing (tested on FireFox 3.5.X, IE 8, and Safari 3/4 with Flash plugin 10,0,42,34). I tested the issue on a Macbook as well and noticed the same thing, so it wasn't something specific to my machine. I wrote a basic Flex application to test this. I make a NetConnection to my web server. When successful, I create a NetStream to playback the video (F4V encoding of Big Buck Bunny). Immediately in Windows Performance Monitor, I can see the Disk queue jump to 100%. The video eventually pauses for a lengthy period of time. Sometimes the browser also becomes unresponsive at this time, and in other cases it will crash. If the video does eventually resume (disk querying reduces a bit), I experience odd behaviour with the video. If I pause the video (NetStream.pause()), when I resume the video (NetStream.resume()), the video begins to fast-forward to make up for the amount of time lost while the video was paused. So if I paused the video for 10 seconds, Flash will fast-forward in 1-second intervals through 10 seconds worth of video. During this time, NetStream will constantly dispatch buffering end and buffering full events.

       

      What's odd is that the problem doesn't seem to happen when I add an additional arument in the play command. NetStream.play(url) will cause the issue, but NetStream.play(url, 0) will not. However, this doesn't always work. My own player, which has a lot more interface controls and complex logic, still suffers from the problem, despite that I'm not doing anything with the NetStream object.

       

      Is this a known issue with Flash? Is there anything I can do?

        • 1. Re: NetStream causes 100% disk use and eventual browser crash
          TheNuttyNut Level 1

          I managed to solve the 100% disk usage problem. It seems there was some sort of compilation issue when using a SWC library and including its source in the source path. Once I removed the sources from the source path, it's running more optimally now. However, the pause and fast-forwarding issue still remains. As a workaround I noticed if I reset the playhead position before I resume, that will prevent it. However, seeking is not 100% accurate so users do experience a bit of a jump.

          • 2. Re: NetStream causes 100% disk use and eventual browser crash
            TheNuttyNut Level 1

            Alrighty. I got it all figured out now. It seems that when you call SoundMixer.stopAll(), This affects the NetStream somehow and produces the aforementioned problem. I have removed that call for now and will resort to other meaures. Hope this helps anyone who runs into similar problems.

            • 3. Re: NetStream causes 100% disk use and eventual browser crash
              andrepazleal

              The Nutty, I´m using netStream to play some flv´s on a LMS Course that im into, but with the new 10.1 release it keep crashing any browser, I do not understand, it´s not in the same time, not in the same frame, it´s a variable error, sometimes in the beggining sometimes when the cpu reach´s too high, sometimes when its on iddle...!!! I´m using AS2...

              • 4. Re: NetStream causes 100% disk use and eventual browser crash
                andrepazleal Level 1

                This is my script for making the character move and talk, quote, it was all working since flash 9, I use this for all my LMS courses for long 2 years, only with the 10.1 update make a mess on all my work...

                 

                 

                var nc_friend:NetConnection = new NetConnection();

                nc_friend.connect(null);

                var ns_friend:NetStream = new NetStream(nc_friend);

                friend.attachVideo(ns_friend);

                var my_sound_friend:Sound = new Sound();

                my_sound_friend.onLoad = function(success:Boolean)

                {

                    if (success)

                {

                ns_friend.play("friend_sit_talk.flv");

                ns_friend.onStatus = function(info:Object)

                {

                if(info.code == 'NetStream.Play.Stop')

                {

                ns_friend.seek(0);

                }

                }

                    }

                };

                my_sound_friend.onSoundComplete = function()

                {

                friend_rest();

                intro_mc._visible=true;

                var MyTween:Tween = new Tween(next_mc, "_xscale", Regular.easeIn, 800, 100, 1, true);

                var MyTween:Tween = new Tween(next_mc, "_yscale", Regular.easeIn, 800, 100, 1, true);

                color = new Color (_root.next_mc);

                color.setRGB(0xCBFF00);

                MyTween.onMotionFinished = function()

                {

                color = new Color (_root.next_mc);

                color.setRGB(0x002E7A);

                }

                };

                friend_talk_2 = function()

                {

                ns_friend.play("friend_talk_2.flv");

                ns_friend.onStatus = function(info:Object)

                {

                if(info.code=='NetStream.Play.Stop')

                {

                friend_talk();

                }

                }

                }

                friend_talk_3 = function()

                {

                ns_friend.play("friend_talk_3.flv");

                ns_friend.onStatus = function(info:Object)

                {

                if(info.code=='NetStream.Play.Stop')

                {

                friend_talk();

                }

                }

                }

                function friend_rest()

                {

                ns_friend.play("friend_sit_rest.flv");

                ns_friend.onStatus = function(info:Object)

                {

                if(info.code == 'NetStream.Play.Stop')

                {

                ns_friend.seek(0);

                }

                }

                }

                function friend_talk()

                {

                ns_friend.play("friend_sit_talk.flv");

                ns_friend.onStatus = function(info:Object)

                {

                if(info.code == 'NetStream.Play.Stop')

                {

                ns_friend.seek(0);

                }

                }

                }