Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle multiple video streams in Red5?

I am writing a Red5 application that provides 1-on-1 video chat to a Flash client over RTMP.

Unfortunately most tutorials I was able to find were sketchy at best and the documentation of Red5 itself tends to be vague when it comes to API concepts and intended usage.

In short, I am a bit stuck and looking for hints on Red5 ApplicationAdapter implementation. Gnarly details are as follows:

  • First of all, the connections come in two flavors: visitors and consultants. A visitor should be able to indicate which consultant it wishes to communicate with. A consultant simply gets connected to the requesting visitor as long as the consultant is not busy servicing another.

  • Obviously, every RTMP connection has two-way traffic: both sending and receiving video. From the standpoint of the server, connections bring in a bunch of video streams that get their receiving endpoints assigned by request.

  • Since several video conversations can be in progress simultaneously, the main task of the application is to handle the mapping of visitor streams to consultants and provide a list indicating each consultant's state (busy/available) via AMF.

So, all in all, I have a pretty good idea what I am aiming for but how to achieve it with Red5 is still a bit of a mystery.

Hopefully someone can enlighten me in any or all of the following:

  1. What is the easiest way to establish the connection type (visitor/consultant)?

  2. Which API classes should be used to implement a persistent, globally accessible list of active connections for reporting the state of each consultant?

  3. How to switch receving endpoints dynamically when the goal is to connect a specific visitor to the selected consultant?

like image 309
Saul Avatar asked Jan 17 '11 22:01

Saul


Video Answer


1 Answers

Saul ,

1.What is the easiest way to establish the connection type (visitor/consultant)?

assuming that both(visitor/consultant) are using flex client via which they start publishing their live video stream ,here you need to make sure that each published video stream name is unique (HOWTO is already mentioned in demo apps)

2.Which API classes should be used to implement a persistent, globally accessible list of active connections for reporting the state of each consultant?

and for providing the list of active connections you simply need to store(preferably in your db) each user's id with the stream name (which is also available as a tutorial demo app) to connect to.

I believe all the code is available for the red5 demos Do try oflaDemo , simpleSubscriber , fitcDemo demo apps.

I hope I am closer to your solution.

like image 154
100rabh Avatar answered Oct 03 '22 09:10

100rabh