http://jira.red5.org/browse/SN-3

not possible for two streams happening at once if its possible, required to have double the bandwidth ?


Adam wrote:
Hi,
you can't subscribe to a stream in record mode? This bothered me too!
btw there is ticket for this, but i guess without any progress.
My solution is a bit screwed, but its working.
publish a stream by:
ns.publish(streamname,"live");
than switch to:
ns.publish(filename,"record");
its recording the live stream, but without the record.start event! (Also with your specified Filename) now the tricky part.
if you want to switch back by
ns.publish(streamname,"live");
youre expiriencing the new event publish.badname (since 0.6) what is stopping/unpublishing the stream. instead iam calling via
nc.call("closeSubscriberStreams", nc, roomName);
a server function to close all related subscriber stream "ISubscriberStream.close();".
this function returns success to the broadcast client.OnResult,
where i close and publish again.
nc.onResult = function(obj) {
 if (obj=="close: true") {
  ns_cam.close();
  ns_cam.publish(roomName,"live");
 }}
With this you got rid of the publish.badname status and you can publish under same name again. Now you need to reconnect the subscribers. Therfore i put in streamBroadcaststart at serverside a reconnect function. This is calling at the subscriber clients a streamRefresh function.
nc.streamRefresh = function(obj){
     statusCode("nc.refresh"+obj);
  ns_stream.close();
  ns_stream.play(roomName);
  return "Ok";
}
et voila. for the subscribers will the stream halt for 1-3 seconds when recording switches back to live. all this just because you cant subscribe to a stream in record mode!! -And about this status event "publish.badname". i guess its wrong, but i dont know it for sure. i dont know fms. But i would suggest that this "badname" is triggert when more than one broadcaster in a scope is using the same live stream name. Unfortunetaly you cant publish/broadcast when there is a subsriber thats connected to this stream name. -> bad "badname". - The next thing is IBroadcastStream.saveAs(filePath, isAppend). I could not figure out how to stop this once saveAs has started. Its saving/recording the stream till the braodcaststream ends. It could be a nice way to record and controll recording serverside. This 2 points i also would like to have incorporated.
What your are thinking about this?
hopefully i could help you. greets
-Adam-
2006/12/5, Costin Tuculescu <[EMAIL PROTECTED]>:
>
> Do I need to do this on the server-side or on the client-side? I would
> prefer server side since I want everything published to that stream
> recorded, regardless of the publisher.
>
> In FMS there's no need for 2 streams, because this functionality works as
> documented in the Flash Player docs.
>
> ----Original Message Follows----
> From: "Ruben Sainz de la Maza" <[EMAIL PROTECTED]>
> Reply-To: [email protected]
> To: <[email protected]>
> Subject: Re: [Red5] Cannot subscribe to Live Stream if its being Recorded
> Date: Tue, 5 Dec 2006 18:00:17 -0300
>
> You need to create 2 Streams, one for Live and another to record.
> In FMS I make this, and works very well.
>
> Ruben
>
> -----Mensaje original-----
> De: [EMAIL PROTECTED] [_mailto:[EMAIL PROTECTED] En nombre
> de Costin Tuculescu
> Enviado el: Martes, 05 de Diciembre de 2006 05:49 p.m.
> Para: [email protected]
> Asunto: [Red5] Cannot subscribe to Live Stream if its being Recorded
>
> Hi guys,
>
> Great work on the Red5 server. Its an amazing piece of software.
>
> I've been working on implementing a live streaming app, but I also need
> it
> to record the live stream, but I've found that if you publish the stream
>
> using "record", then the subscribers don't get the live stream when they
>
> play it. They only get the recorded stream. This is what I'm doing:
>
> Publisher:
> mystream.publish("streamName", "record"); // red5 starts recording
> the
> stream on the server
>
> Subscriber:
> mystream.play("streamName", -1); // this should play a live stream,
> but
> it plays nothing.
>
> If I do:
> mystream.play("streamName"); // the stream will start playing from
> the
> beginning of the recorded stream, not the live stream.
>
> I really need a solution for this quickly... any hints on where I can
> look
> to try to modify this behavior? Thank you.
>
> -Costin
------------------------------------------------------------------------

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to