Joe-Palmer / rtmplite

Automatically exported from code.google.com/p/rtmplite
0 stars 0 forks source link

Stream switcher using rtmplite #50

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
First reported by Fabio Di Bernardini fdb@altraqua.com on Tue, Jul 26, 2011

---
I need a simple streaming system where only one client at a time can
stream (due to bandwitdh issues) and a director can choose which
client.

Look at this sketch: http://goo.gl/8vauk

At the end of this system there is a converter and a streaming service
(like ustream, icecast or similar) needed to broadcast the choosed
client.

What do you think? Is it feasible with rtmplite?

---

Hi Fabio,

Yes, this should be feasible with rtmplite.

Assuming that it is your web client, and the simplest option would to
be to send RPC commands from rtmplite to your Flash application to
enable/disable publish of the stream. The Flash client application
connects to the server rtmp://server/myapp/scope123. But the Flash
client will not publish until it receives "start_stream" command from
the server. The server built using rtmp.py and rtmpclient.py creates a
new FlashServer instance to listen to incoming Flash client
connections. The server already keeps track of list of connected
clients, and can decide which client it wants to start streaming from.
Then it sends a "stop_stream" command to any previously active client,
and "start_stream" command to new active client, using the "call"
method (look for how self.client.call is called in siprtmp.py to
indicate an event from server to client). The client application
invokes publish/close based on when it receives "start_stream" or
"stop_stream" commands. If you are using a third party Flash client
application, then you will need to handle this signaling out of band,
e.g., using separate signaling channel.

On the other side of the system, you will need to use the
NetConnection/NetStream objects of rtmpclient.py module to connect to
your existing streaming server, or have the existing streaming server
connect to rtmpclient. The rtmpclient module is capable of connecting
to existing RTMP server to publish or play a stream. You can use the
onPublishData callback (see rtmp.py) to receive the audio data from
the client, and NetStream's send to send it to the other streaming
service.

Original issue reported on code.google.com by kundan10 on 27 Jul 2011 at 4:55