Skip to main content
Participant
October 12, 2010
Question

Video and Audio Freeze intermittently

  • October 12, 2010
  • 1 reply
  • 649 views

I have been running FMIS 3.5 since April of this year. In August, we started recording conferences, but I'm not sure that this is the issue. We are under very low load at the moment. We never have more than one conference going simultaneously. Our server is spec'ed with a 64-bit operating system (MS08), 24GB RAM, and 24 processors.

I notice that in some of our conferences, the video and audio freezes for 5 to 10 seconds. Then they recover and resume where they left off. When this occurs, it recurs every one or two minutes, which is very disruptive. People have to constantly repeat themselves.

FMIS is configured with defaults out of the box, with the exception that we are recording live video and audio. How do I solve a problem like this? Is it Internet latency? Is it our internal network? Is it FMIS 3.5? Not sure where to start.

Now I've inherited much of the Flex 3 code that is used in the stream and player Flash components. I notice in the player component that the original programmer is using a timer to monitor the mx.Event.VideoEvent.STATE_CHANGED event. As long as the event fires, he resets the timer. But if 10 seconds expires and the STATE_CHANGED event has not fired, he restarts the player. Is this a valid methodology? Here is the code fragment.

<mx:Script>
<![CDATA[
var lastUpdate : Number = 0;
private var pulse : Timer = null;

private function onInit() : void {

viewVideo.addEventListener(VideoEvent.STATE_CHANGE, function() : void {
    if (!lastUpdate) {
        pulse.start();
    }
    lastUpdate = new Date().getTime();
    });
    pulse = new Timer(2500);
    pulse.addEventListener(TimerEvent.TIMER, onHealthCheck);
}

public function onHealthCheck(te : TimerEvent) : void {
    var diff : Number = (new Date().getTime() - lastUpdate) / 1000;
    if (diff > HEALTH_THRESHOLD) {
        var t : String = viewVideo.source;
        viewVideo.source = null;
        viewVideo.source = t;
        viewVideo.bufferTime = 0.1;
        playVideo();
    }
}

public function playVideo() : void {
    /* obviously this is a serious hack; (Yes, that's the original programmer's comment!) */
    setTimeout(function() : void {
        try {
            viewVideo.play();
            invalidateDisplayList();
            //notify(PlayerEvent.PlayerStarted);
        }
        catch (ex : Object) {
            playVideo();
        }
    }, 5500);
}
]]>
</mx:Script>
<mx:VideoDisplay width="100%" height="100%" id="viewVideo" live="true" />

Could this logic be causing our video and audio freezing?

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    October 13, 2010

    I think this might be more because of network latency but to be sure do you see anything alarming on FMS logs - if not then its more to do with network latency. Also i do not know why client is written in such fashion, i mean why would you start from beginning just because its stalling - i personally don't think its right approach. I would suggest you getting rid of such code - just keep it simple , Also set slightly higher buffer - like say 2 or 5 seconds and see what experience you are getting.

    ActivelyXAuthor
    Participant
    October 13, 2010

    Thank you for your response.

    The bufferTime is configurable, although it looks like it's hardcoded in the code fragment. I've tried a 2 second buffer, and it disrupted communications so much that all the users complained. So I put it back to the default value of 0.1 seconds. I'm afraid to increase it now.

    I didn't remove the code. Instead, it looks like some kinds of startup logic that keeps trying until a successful connection is made. The problem is that it keeps running, and I think that is interfering with my conferences. So I added logic that enables it at the start of a conference, and disables it after the conference starts playing.

    I'm testing this change over the next couple of days, and I'll let you know how it goes.

    Thanks again.