recorded streams are different length
I am trying to record a video chat being done through FMS. I have made my program start recording only when the second stream publishes. Then, I stop recording when either streams stops publishing. In my last test I recorded a 45 minute chat. The resulting flv files show that there are 13 seconds difference between them. The video gets more out of sync as it goes along. My first guess is that it is something to do with dropped frames. That's just a novice guess. Is there any way to force FMS to fill in dropped frames or does anyone have any other ideas as to what my problem may be? I'm posting my code for starting and stopping recording:
application.onPublish = function(myClient,myStream)
{
application.streams.push(myStream);
if (application.streams.length == 2)
{
bRecordingStarted = "false";
for (i = 0; i < application.streams.length; i++)
{
fo=new File("/streams/WVisit_" + this.MyVisitManager.VisitId + "/" + application.streams.name + ".flv");
if (fo.exists)
{
bRecordingStarted = "true";
}
}
for (i = 0; i < application.streams.length; i++)
{
if (bRecordingStarted == "true")
{
application.streams.record("append");
}
else
{
application.streams.record();
}
}
}
else
{
trace("iUsers=" + application.streams.length);
}
}
application.onUnpublish = function(myClient,myStream)
{
var idx = -1;
for (i = 0; i < application.streams.length; i++)
{
application.streams.record(false);
if (application.streams.name == myStream.name)
{
idx = i;
}
}
if (idx != -1)
{
trace("Removing Stream: " + application.streams[idx].name);
application.streams.splice(idx, 1);
}
}
