Skip to main content
September 17, 2008
Question

Stream video to MANY clients?

  • September 17, 2008
  • 1 reply
  • 330 views
Hello!
I'm new to Flash Media Server so little help would be really nice!
I intend to do a project where a live video stream should be published on a website there many clients can connect and view it.
I read somewhere that FMS3 creates a connection and a stream to every single clients thats connects to the stream. Is this so? In that case I guess the server would have a hard time if a couple of 100 people connects to the stream?

Is this right? Any tip on how this should be accomplished? (One person sends a stream from his webcam and its live viewed by some hundred persons).
    This topic has been closed for replies.

    1 reply

    Participant
    September 17, 2008
    Yes it' s possible, you have just got to publish the stream in the instance of the app you want ( or just in rtmp://www.yourservername.com/yourappname ) and then every client that connects to the instance can play the stream, here is a small piece of code which should help you:

    this is the code that create the stream (a live stream):

    var nc:NetConnection;
    nc.connect("rtmp://myserver/myapp/myinstance");
    ns = new NetStream(nc);
    ns.publish("stream_name", "live");

    and this is the code with which you play back the stream:

    var nc:NetConnection;
    nc.connect("rtmp://myserver/myapp/myinstance");
    var play_ns:NetStream = new NetStream(nc);
    play_ns.play(radio);

    then, if you want to add a webcam to your stream you can add this code when you create the publishing stream:

    video = new Video();
    video.attachCamera(camera);
    ns.attachCamera(camera);

    Hope I ve been useful, for a better understanding of these things i think you should look at the FMS docs and inside the FMS_INSTALLATION_DIR/documentation/
    Bye!


    September 18, 2008
    Thank you!

    Actually I ready hav set up a stream and tested it (I used OReillys Learning Flash Media Server 3, which I can recommand for other beginners).
    What I had in mind was if the server would have problem streaming a live streamed video to very many people at the same time. This app should be used in a live event where many people gone be watching it at a given time and date.