How to handle multiple video streams in Red5?
Asked Answered
L

2

10

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?

Lxx answered 17/1, 2011 at 22:31 Comment(2)
These guys seem to have written up and documented something similar: red5chat.com/features-webcamchat.htmBesmirch
@Besmirch - red5chat hasn't been updated in over 2 years, and according to the comments on its sourceforge page, has horrible docs and isn't complete source.Megrim
R
3

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.

Reporter answered 30/1, 2011 at 13:59 Comment(0)
D
0

Since Oflademo or red5 is capable of 1v1 chats, then replicate this code to make around 50 chats. You can maintain a table with the following columns :

  • chat room number (1 to 50)
  • user1
  • user2
  • status(0 or 1 - unoccupied or occupied)

If let say a visitor V22 wants to get consulted from consultor C33, then a program can detect the first unoccupied room from 1 to 50, if the 7th room is unoccupied then, redirect V22 and C33 to room 7 and change status to 1(occupied). After the video call, the status can be reset to 0, and the table at roomno:7 , user1 of roomno:7, user2 of roomno:7, can be set to NULL. Its like maintaining tables in a restaurant in a computer.

You can basically develop multiple chatting using 1to1 using a database and php queries, no need to edit any swf code or maintain a complicated server etc.

Departed answered 17/8, 2016 at 12:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.