Skip to main content
Participant
February 18, 2008
Answered

Re-sync out of sync live streams

  • February 18, 2008
  • 4 replies
  • 1470 views
Hi Guys,

I'm testing an application I've created. It's basically a 2-way A/V chat, with a text chat application on there as well.

Each user publishes a live stream, which is recorded on the server and then resent back down to the other user.

I've been testing it locally and everything is fine, so I signed up to Influxis on their Nitrous plan to give it a test run over the Internet.

Each stream is publishing a 32Kbps video + 8Kbps audio stream. Each user has a fast broadband connection, with around a 140 ping to the server.

Over time, around 10 minutes or so, the live streams get quite far out of sync. It can take over 20 seconds for the stream to reach the other person, making a "live" chat quite useless.

If I stop and start the streams again, it brings everything back into line, so I'm considering this as a potential resolution.

I'd really like to know why this sort of thing occurs, how I can minimise it, and how to recover from it when it does happen.

Any help would be appreciated!
    This topic is closed to new replies. Start a new post to keep the conversation going.
    Correct answer Graeme Bull
    Increase the rate of the audio to 22. This will rid the app of latency, not what you would expect, but supposedly it works.

    4 replies

    Graeme Bull
    Community Expert
    Graeme BullCommunity ExpertCorrect answer
    Community Expert
    February 19, 2008
    Increase the rate of the audio to 22. This will rid the app of latency, not what you would expect, but supposedly it works.
    Inspiring
    February 18, 2008
    Can you elaborate what mechanism is being used to publish live streams?
    BenderBAuthor
    Participant
    February 18, 2008
    Thanks for your quick response!

    I setup the cams like this:

    live_cam.setMode(320, 240, 15);
    live_cam.setQuality(32768, 80);
    live_cam.setKeyFrameInterval(20);
    var live_mic:Microphone = Microphone.get();
    live_mic.setRate(8);
    live_mic.setSilenceLevel(20, 2000);
    var live_cam:Camera = Camera.get();

    Then start the netstreams:

    var out_ns:NetStream;
    out_ns = new NetStream(nc);
    out_ns.attachAudio(live_mic);
    out_ns.attachVideo(live_cam);
    out_ns.publish("ns_tutorAV_CS", "live");

    My server side code then grabs the Client Side live stream, and records it:

    var ns_tutorAV = Stream.get("ns_tutorAV_SS");
    ns_tutorAV.play("ns_tutorAV_CS",-1,-1);
    ns_tutorAV.record("append");

    The other client then receives the stream:

    in_ns= new NetStream(nc);
    in_ns.setBufferTime(0);
    streaming_video.attachVideo(in_ns);
    in_ns.play("ns_tutorAV_CS");

    Sorry, couldn't work out how to attach code?

    Thanks for your help!
    February 18, 2008
    Which version for FMS are you using ?

    your code seems fine to me; If it sure that application runs fine on your own local setup; and problem comes only when you use Influxis setup, then you might want to check with them for following settings :


    - Server side buffer (should be minimum)
    - Live aggregate messages (should be disabled) (applicable only in FMS 3.0)
    - Audio Combine Samples (it should be completely off)