Skip to main content
Participant
October 31, 2011
Question

recorded streams are different length

  • October 31, 2011
  • 1 reply
  • 389 views

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);
}   
}

    This topic has been closed for replies.

    1 reply

    Participant
    November 2, 2011

    Maybe a more simple question... What happens when bandwidth dips really low on one of the computers that is streaming.  Does it start dropping frames?

    I just ran another 45 minute visit and the recordings for this one was over 20 seconds off.  I don't understand why the recordings would be such a different length when the command to record is given at the same time.