hi i made some hacks in that part also,im pretty sure it was fixed there its something else, thats just for getting the published name which its returning fine to the clients. so the client is trying to stream the live stream of livecam, and the server is archiving as livecam_20061207.flv, but its still trying to play the archive somehow :D

Costin Tuculescu wrote:
Hi Adam,
Seems like a very clever solution, but I would really like to see the functionality behave like FMS does. So I've been digging around in the code, and found that the publish method of the StreamService.java class works kinda strangely -- when there is a Live stream, it does a lot of stuff that it doesn't do where there is a Recorded/Appended stream. In the Publish function, I copied the following code from the Live section of the Switch statement, to the Record and Append sections:

IContext context = conn.getScope().getContext();
IProviderService providerService = (IProviderService) context.getBean(IProviderService.KEY);
bs.setPublishedName(name);
// TODO handle registration failure
if (providerService.registerBroadcastStream(conn.getScope(), name, bs)) {
IBroadcastScope bsScope = getBroadcastScope(conn.getScope(), bs.getPublishedName());
bsScope.setAttribute(IBroadcastScope.STREAM_ATTRIBUTE, bs);
if (conn instanceof BaseConnection)
((BaseConnection) conn).registerBasicScope(bsScope);
}

Now, it registers the stream as part of the scope and its available for live playback. I'm using 0.5 however, and when a user connects to the stream and plays it back, it messes up the recorded stream somehow and creates some weird artifacts in the recording, so I'll have to look into that, or also see if this behavior is different in 0.6rc1. I'll keep you guys posted of the progress I make. Thanks.

Costin


----Original Message Follows----
From: "Adam"
Reply-To: [email protected]
To:
Subject: Re: [Red5] Cannot subscribe to Live Stream if its being Recorded
Date: Wed, 6 Dec 2006 19:37:34 +0100
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 :
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" Reply-To: [email protected] To: 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

_________________________________________________________________
Talk now to your Hotmail contacts with Windows Live Messenger. http://clk.atdmt.com/MSN/go/msnnkwme0020000001msn/direct/01/?href=http://get.live.com/messenger/overview


_______________________________________________
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