Creating multiple channels on a streaming server

640 views
Skip to first unread message

Juan Diego

unread,
Oct 28, 2012, 8:35:26 PM10/28/12
to red5in...@googlegroups.com
Hi,

I  did many tutorials and checked the code for the simple broadcaster and simple subscriber and did some tests with the oflademo, and created my own suscriber and publisher with flex.  But what I dont understand is how to create multiple "channels".
I asume that at some point I will have to add a database or something that keeps a tab on the channels opened and then on the subscriber, the user will see the lists of channels and he/she can select the channel they want.  But I dont know in how to create these channels.  
I read somewhere about multithreads but I havent being able to find that document again, and I dont know if it is related.
So from one side I know in my app on java there should be a parameter to create a channel and when I connect with flex on the client side I should be able to pass a parameter telling it to create a channel.

Thanks,

Juan Diego 

Juan Diego

unread,
Oct 28, 2012, 10:14:52 PM10/28/12
to red5in...@googlegroups.com
I think what I need is called scopes right?

Andhika Legawa

unread,
Oct 28, 2012, 10:18:38 PM10/28/12
to red5in...@googlegroups.com
Why don't you create another stream. Each channel is a stream, so client just have to tune in to diff stream when changing channel.

--
 
 
 



--
A L - www.andhikalegawa.com

Juan Diego

unread,
Oct 28, 2012, 10:39:17 PM10/28/12
to red5in...@googlegroups.com
Correct me if I am wrong,  in the oflademo there is IServerStream serveStream variable, should I create like an array of these types do you have an example of that.  Also I was reading this
http://ria101.wordpress.com/2010/03/09/red5-cabin-fever-advanced-scope-and-room-management/ which seemed that scopes are more like channels and I can pass the "channel" on the parameters righ?

--
 
 
 

Andhika Legawa

unread,
Oct 28, 2012, 11:10:01 PM10/28/12
to red5in...@googlegroups.com
I default scope and many stream inside of that scope. I don't map the instance, I have an XML file for each Channel, each of this XML will be the base config and data provider of the Stream instance, so each channel will run independently based on that XML file. There is a cron running to scan for these XML, so any change to it will reflect to the stream instance. e.g: ch-news.xml for news channel, ch-comedy.xml for comedy channel.

from the client side, all it needs to know is the stream name, so if user want to see news channel, they can point their player to rtmp://myhost.com/onlinetv/news. onlinetv point to the default Scope when you create an ApplicationAdapter, a WebScope. In streams initialization, I put them in the default scope.

IScope, as explained in the API "are general option for grouping things in application". Since what I need are stream objects, I don't bother to have many scope, I only use the default one.

IMO, you only need more than one Scope if you want to control access to different groups of objects.

Juan Diego

unread,
Oct 28, 2012, 11:14:24 PM10/28/12
to red5in...@googlegroups.com
Thanks, I am going to do some tests.  


--
 
 
 

Dominick Accattato

unread,
Oct 30, 2012, 4:18:04 PM10/30/12
to red5in...@googlegroups.com
I agree about using scopes to separate data. Plus when you stay in one scope and just switch streams, you gain the added benefit of not having to reconnect to a new scope each time. 

--
 
 
 



--
Dominick Accattato
Red5 Co-Project Manager & Engineer
---

Juan Diego

unread,
Oct 31, 2012, 5:15:43 PM10/31/12
to red5in...@googlegroups.com
Ok, so here is the thing that I want to do, I want any of my users to create a broadcast for anyone to listen so I was thinking that in order to avoid name conflicts for these channels it was going to be more like rtmp://myred5server/myapp/USER/channel

So if I do this, my users (that (the ones that are not broadcasting, just listening) will have to reconnect if they want to view a different user/scope, right?  Or can they connect to the main webscope and choose the different scopes and streams.

Regards,

Juan Diego

--
 
 
 

Dominick Accattato

unread,
Nov 1, 2012, 10:13:53 AM11/1/12
to red5in...@googlegroups.com
Juan,

Right, you could have separate scopes with users having to reconnect to each one or you could store all of your users/streams in a single scope.

I would use a Map in a single scope which holds users and their channel data. What you end up having is a data structure which you can then search by a unique id. Again, the data structure would hold not only the user information but also the stream name. This scenario which I describe here is the more graceful way to handle multiple channels even though there are more complexities involved with logic and storage. 

However, the multiple scope scenario isn't all that bad. Connections happen very quick and as mentioned, their data and security are stored separate from other scopes. It could be a cleaner way to handle these channels. 

In the end it's really your design decision as there are pros and cons to each.

- Dominick 

Paul Ploppy

unread,
Nov 3, 2012, 2:08:18 PM11/3/12
to red5in...@googlegroups.com
unsubscribe


Reply all
Reply to author
Forward
0 new messages