Skip to main content
January 20, 2007
Question

Syncronized FLV streams

  • January 20, 2007
  • 4 replies
  • 315 views
I know this has been asked before but I can't find any answers at the moment.

I need to create a simple app, where users will be shown a series of 8 minute videos. After all users view a video, there will be a Q&A session. Then the presenter starts the next video.

My question is, can I ensure all connected users are synced in FLV playback? In other words, when the presenter presses play, all uses are done exactly 8 minutes from that point. I know I could do it if the stream was a live stream from the presenter's cam, but what about from an FLV file?
    This topic has been closed for replies.

    4 replies

    January 21, 2007
    That's what I'd do if I needed to make sure everyone is done viewing a stream. You might even go so far as to have each client report its progress on an interval so the presenter knows how long the slowest client has to go. Might be a little overkill, but I don't know how varied your client's connection speeds will be, or what sort of bitrates you're working with.
    January 21, 2007
    Alrighty, thanks for the advice, Jay,

    Looks like your solution to monitor the attendees position and start the Q&A when everybody is done is the best solution.
    January 21, 2007
    Maybe in a future release.

    I know you know your stuff, but are you sure you can't publish() from a SWF which is using a live stream? What I mean is something like this:
    var nc = new NetConnection();
    nc.connect('rtmp');
    var ns = new NetStream(nc);
    ns.play('myFLV',0); // stream in the 'recorded' FLV file
    ns.publish('yourFLV'); // and publish it back out

    Then in the various attendee SWFs I have
    ns.play('yourFLV');

    But that's all assuming that a single NetStream can both play and publish what its playing at the same time, which I guess it cannot.

    Incidentally, the docs say for NetSream.publish that its "sends streaming audio, video, and text messages from the client to the Flash Media Server". So audio is done via attachAudio, video by attachVideo, but how are "text messages" done? Is that referring to NetStream.send()?
    January 21, 2007
    No. Netsrtreams move in one direction. You're either publishing to it, or viewing a stream on it... not both.

    In order to publish something to a netstream, you first need to attach an audio and/or video source using attachAudio / attachVideo. The only sources those methods accept are camera and microphone objects, so you can'y publish anything other than a camera and/or mic.

    January 20, 2007
    Nope... can't be done reliably.

    The problem is that you can't guarantee that latency will be consistent amongst all of your clients, and you can't guarantee that everyone will have adequate bandwidth to view the stream completely without rebuffering.

    What you might do is add some methods to your SSAS that will notify the presenter when everyone is done viewing the stream. At least that way your presenter will know when everyone is ready for Q&A.
    January 20, 2007
    That makes sense. Is there any way you can feed an FLV file in a SWF into a live NetStream, though? It would be great if you could use NetStream.play('myVideo.flv') in the presenter SWF to play an FLV file, and then NetStream.publish('myVideo') to broadcast it. We are actually considering having a webcam on the presenter side which is actually having the desired video fed into it in some way.
    January 20, 2007
    Nope. You'd need to upload the flv to the FMS server. It would be nice if we could attach sources other than cameras and microphones to a netstream, but we can't.