Change the scope/room of a stream

289 views
Skip to first unread message

Rajdeep Rath

unread,
May 19, 2011, 4:41:49 AM5/19/11
to red5in...@googlegroups.com
Ho can i change the scope/room of a stream being broadcasted from a webcam  to a different scope internally in Red5 ??  - Please!!

Rajdeep Rath

Cristian Rusu

unread,
May 19, 2011, 5:50:14 AM5/19/11
to red5in...@googlegroups.com
hehe

I think I had this question myself... courious for an answer

Basically I wanted to addapt my application to work with FMLE and move the started stream under appropriate room once I decode the url, where url contain room ID.



---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com

DZS|All-In-One

unread,
May 19, 2011, 2:31:18 PM5/19/11
to red5
As I was exploring around with Red5's functions. I think I saw a
function that can change the scope long ago. So I think it is
possible.

Cristian Rusu

unread,
May 19, 2011, 2:37:55 PM5/19/11
to red5in...@googlegroups.com
we all think that...

---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com


Cristian Rusu

unread,
May 20, 2011, 2:48:30 PM5/20/11
to red5in...@googlegroups.com
Hi

Rajdeep, any luck with stream scope change?


---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com


davealma

unread,
May 20, 2011, 2:58:11 PM5/20/11
to red5
Have you try this http://ria101.wordpress.com/2010/03/09/red5-cabin-fever-advanced-scope-and-room-management/
It seems to work, I have not tested myself though!!

On 20 mayo, 20:48, Cristian Rusu <cri...@gmail.com> wrote:
> Hi
>
> Rajdeep, any luck with stream scope change?
>
> ---------------------------------------------------------------
> Cristian Rusu
> Web Developement & Electronic Publishing
>
> ======
> Crilance.com
> Crilance.blogspot.com
>
>
>
>
>
>
>
> On Thu, May 19, 2011 at 21:37, Cristian Rusu <cri...@gmail.com> wrote:
> > we all think that...
>
> > ---------------------------------------------------------------
> > Cristian Rusu
> > Web Developement & Electronic Publishing
>
> > ======
> > Crilance.com
> > Crilance.blogspot.com
>

taktod

unread,
May 23, 2011, 4:16:52 PM5/23/11
to red5
Hi

like this?
https://github.com/taktod/streamForwarding

If I don't get point, sorry.

taktod

On 5月21日, 午前3:58, davealma <davidalmanz...@gmail.com> wrote:
> Have you try thishttp://ria101.wordpress.com/2010/03/09/red5-cabin-fever-advanced-scop...

Cristian Rusu

unread,
May 24, 2011, 1:54:22 AM5/24/11
to red5in...@googlegroups.com
From what I see you create another stream.

Not sure about Rajdeep, but what I try to do is to seamlessly integrate FMLE with my existing app.

When I broadacast from web flash, I put the stream in the room user is connected to.
In FMLE I can just use a URL with all parameters I need but that creates a different scope in my Red5 app.
Then I have to create that room, and when broadcast starts, I need to make sure the stream is in the room scope, not in initial scope client connected to wit FMLE.

I can try giving real live example if still not clear...


---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com


bowljoman

unread,
May 24, 2011, 12:32:45 PM5/24/11
to red5
Hey guys, try this. The unregistering methods are similar.

// To register in a scope.

IContext context = outputScope.getContext();//the scope to change to.

IProviderService providerService = (IProviderService)
context.getBean(IProviderService.BEAN_NAME);

if (providerService.registerBroadcastStream(outputScope,
_stream.getPublishedName(), _stream)) {

IBroadcastScope bsScope = (BroadcastScope)
providerService.getLiveProviderInput(outputScope, _stream
.getPublishedName(), true);
bsScope.setAttribute(IBroadcastScope.STREAM_ATTRIBUTE, _stream);

Cristian Rusu

unread,
May 25, 2011, 5:02:29 AM5/25/11
to red5in...@googlegroups.com
What about connection scope?
Basically what I want is to make the connection from FMLE act as if it's in the scope I create based on initial URL.


---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com



Cristian Rusu

unread,
May 25, 2011, 6:44:11 AM5/25/11
to red5in...@googlegroups.com
I just figured out regarding connection scope of FMLE

So ... basically I connect to my App through FMLE:

URL: rtmp://crilance.loc/crilance_live.1.0/Crirus_Channel-crirus-pass-123-none

Scope name become Crirus_Channel-crirus-pass-123-none

Regular web connection scope name is Crirus_Channel and params are crirus, pass, 123, none
 
   public boolean appConnect(IConnection conn, Object[] params) {
        IScope scope = conn.getScope();
        if(params.length==0){
            //connection is through FMLE, we need to create params from URL
            String connStr=scope.getName();//Crirus_Channel-crirus-pass-123-none
            String[] para= connStr.split("-");
            appScope.createChildScope(para[0]);//Crirus_Channel
            scope = ScopeUtils.resolveScope(appScope, para[0]);//here we get the right scope web connect would use

            Object[] prms=new Object[4];

            prms[0]= (String)para[1];
            prms[1] = (String)para[2];
            prms[2] = (String)para[3];
            prms[3] = (String)para[4];

            Boolean res= conn.connect(scope, prms);//forward connection to this scope we created or if already there we just found it
            return res;
        }else{
            //regular web connection
           //above conn.connect will end up here since it's called with parameters and the scope is right this time... hooray
           ....
        }
}

If you want to change stream scope maybe you can change connection scope first then stream published will be in the right scope.
Goorus, let me know if there is any flaw here :)


Thanks


---------------------------------------------------------------
Cristian Rusu
Web Developement & Electronic Publishing

======
Crilance.com
Crilance.blogspot.com



Reply all
Reply to author
Forward
0 new messages