Skip to main content
April 3, 2008
Question

how to reduce video / audio delay

  • April 3, 2008
  • 2 replies
  • 866 views
Hello friends,
I have developed a audio/video chatroom application using Flash 8 and Red5 server.

Application works fine for text chat only but take lots of time, when some one is publishing audio and video to others, they receive the published audio/video after a bad delay.
i m using following client side code:-

for publishing video stream:-

var nc:NetConnection = new NetConnection();
nc.connect("rtmp://domain/folder_name")
var out_netstream:NetStream = new NetStream(nc);
mycam = Camera.get();
mycam.setQuality(0, 80);
mycam.setMode(320, 240,15);
out_netstream.attachVideo(mycam);
out_netstream.publish("videotest", "record");

for playing video stream:-

var in_netstream = new NetStream(nc);
in_netstream.play("videotest");
rcv_video.attachVideo(in_netstream); //here rcv_video is video object

please help me on this issue its very urgent
thnaks in advance
    This topic has been closed for replies.

    2 replies

    April 4, 2008
    thnak u so much for your reply.I want to ask u one more thing:-
    i m using shared object to send messages like this:-

    var soChat = SharedObject.getRemote("text_chat", nc.uri, true );
    soChat.client = this;
    soChat.connect(nc);

    soChat.newMessage=function(str:String)
    {
    trace("message recieved-->> "+str)
    }

    this code is on Click event of button:-

    on(click)
    {
    soChat.send( "newMessage","Hello How r u?");
    }

    above code working fine and without any delay in receiving messages.But as user play friends video there is so much delay (1/2min) in receiving messgaes.

    Thanks in advance
    April 4, 2008
    Try using the least buffer on client side (NetStream.setBufferTime()). 0.1 to 0.2 second should suffice.

    On FMS, you can try decreasing the Live Buffer/queue size OR disabling the Live Buffer/queue completely, But with a caution as disabling the queue will give very low latency but will affect the server performance.