Re: Re: Php client for Red5

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re: Php client for Red5

Walter Tak
Ah yeah right now I see what you mean. I used SabreAMF to make calls to the
Red5 http-gateway to gain access to my Red5 application. No need for RTMP
there.

Btw , just curious, why did you want to connect with PHP using RTMP btw ?
Imho PHP isn't the best "tool" to do real-time communication since it's
often used in a state-less way e.g. client calls PHP-scripts, script does
it's things and then dies. Or have you built some php-server that runs
continuously ofcourse.

W.

----- Original Message -----
From: "QwantiX" <[hidden email]>
To: "red5" <[hidden email]>
Sent: Friday, 20 November 2009 09:16
Subject: [Red5] Re: Php client for Red5


I'm not sure what you mean.  Neither amfphp nor sabreamf have a rtmp
client. They're just amf server.
In fact, php-rtmp-client use sabreamf for its amf serialisation/
deserialisation need.


On Nov 20, 12:13 am, "Walter Tak" <[hidden email]> wrote:

> Or SabreAMF which has a RTMP-client as well to make Red5 calls from PHP.
> It's on OSFlash as well ;http://osflash.org/sabreamf
>
> W.
>
>
>
> ----- Original Message -----
> From: "Andy Shaules" <[hidden email]>
> To: <[hidden email]>
> Sent: Thursday, 19 November 2009 17:47
> Subject: Re: [Red5] Php client for Red5
>
> > Great job!
>
> > Was there something lacking with the amfphp client? I have been using
> > that
> > object to call red5 from php. Its included with the amfphp distribution.
>
> > Andy
>
> > ----- Original Message -----
> > From: "QwantiX" <[hidden email]>
> > To: "red5" <[hidden email]>
> > Sent: Thursday, November 19, 2009 12:14 AM
> > Subject: [Red5] Php client for Red5
>
> >> Hi,
>
> >> I recently created a new project :
> >>http://code.google.com/p/php-rtmp-client/
> >> It's PHP script that provide a simple synchronous connection to a rtmp
> >> server like Red5 and allow to invoke remote methods
>
> >> This script avoids using Javabridge to call method Red5 from a PHP
> >> script.
>
> >> send me your feedbacks...

Reply | Threaded
Open this post in threaded view
|

Re: Re: Php client for Red5

QwantiX
Rtmp it's an other way to invoke method... rtmp-client-php hasn't be developed just for red5.
There is one thing that the gateway can not do, rtmp client allow rpc from red5 server..


2009/11/21 Walter Tak <[hidden email]>
Ah yeah right now I see what you mean. I used SabreAMF to make calls to the Red5 http-gateway to gain access to my Red5 application. No need for RTMP there.

Btw , just curious, why did you want to connect with PHP using RTMP btw ? Imho PHP isn't the best "tool" to do real-time communication since it's often used in a state-less way e.g. client calls PHP-scripts, script does it's things and then dies. Or have you built some php-server that runs continuously ofcourse.

W.

----- Original Message ----- From: "QwantiX" <[hidden email]>

To: "red5" <[hidden email]>
Sent: Friday, 20 November 2009 09:16
Subject: [Red5] Re: Php client for Red5



I'm not sure what you mean.  Neither amfphp nor sabreamf have a rtmp
client. They're just amf server.
In fact, php-rtmp-client use sabreamf for its amf serialisation/
deserialisation need.


On Nov 20, 12:13 am, "Walter Tak" <[hidden email]> wrote:
Or SabreAMF which has a RTMP-client as well to make Red5 calls from PHP.
It's on OSFlash as well ;http://osflash.org/sabreamf

W.



----- Original Message -----
From: "Andy Shaules" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, 19 November 2009 17:47
Subject: Re: [Red5] Php client for Red5

> Great job!

> Was there something lacking with the amfphp client? I have been using > that
> object to call red5 from php. Its included with the amfphp distribution.

> Andy

> ----- Original Message -----
> From: "QwantiX" <[hidden email]>
> To: "red5" <[hidden email]>
> Sent: Thursday, November 19, 2009 12:14 AM
> Subject: [Red5] Php client for Red5

>> Hi,

>> I recently created a new project :
>>http://code.google.com/p/php-rtmp-client/
>> It's PHP script that provide a simple synchronous connection to a rtmp
>> server like Red5 and allow to invoke remote methods

>> This script avoids using Javabridge to call method Red5 from a PHP
>> script.

>> send me your feedbacks...


Reply | Threaded
Open this post in threaded view
|

Re: Re: Php client for Red5

Mário Júnior
In reply to this post by Walter Tak
Yes Walter, you are correct! A php script even die when finishs.
But, already exists some techniques as "PHP APC" or "Memcached" that allow to store and share informations (as single objects and sessions) between scripts and diferent requests as objects.

BR.


2009/11/21 Walter Tak <[hidden email]>
Ah yeah right now I see what you mean. I used SabreAMF to make calls to the Red5 http-gateway to gain access to my Red5 application. No need for RTMP there.

Btw , just curious, why did you want to connect with PHP using RTMP btw ? Imho PHP isn't the best "tool" to do real-time communication since it's often used in a state-less way e.g. client calls PHP-scripts, script does it's things and then dies. Or have you built some php-server that runs continuously ofcourse.

W.

----- Original Message ----- From: "QwantiX" <[hidden email]>

To: "red5" <[hidden email]>
Sent: Friday, 20 November 2009 09:16
Subject: [Red5] Re: Php client for Red5



I'm not sure what you mean.  Neither amfphp nor sabreamf have a rtmp
client. They're just amf server.
In fact, php-rtmp-client use sabreamf for its amf serialisation/
deserialisation need.


On Nov 20, 12:13 am, "Walter Tak" <[hidden email]> wrote:
Or SabreAMF which has a RTMP-client as well to make Red5 calls from PHP.
It's on OSFlash as well ;http://osflash.org/sabreamf

W.



----- Original Message -----
From: "Andy Shaules" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, 19 November 2009 17:47
Subject: Re: [Red5] Php client for Red5

> Great job!

> Was there something lacking with the amfphp client? I have been using > that
> object to call red5 from php. Its included with the amfphp distribution.

> Andy

> ----- Original Message -----
> From: "QwantiX" <[hidden email]>
> To: "red5" <[hidden email]>
> Sent: Thursday, November 19, 2009 12:14 AM
> Subject: [Red5] Php client for Red5

>> Hi,

>> I recently created a new project :
>>http://code.google.com/p/php-rtmp-client/
>> It's PHP script that provide a simple synchronous connection to a rtmp
>> server like Red5 and allow to invoke remote methods

>> This script avoids using Javabridge to call method Red5 from a PHP
>> script.

>> send me your feedbacks...




--
Mario Junior
Enterprise Java / Flex Architectures
Adobe Certified Expert Flex 3 with AIR

Sofshore Informática
http://www.sofshore.com.br
+55 (48) 3337 2003
Rua Pastor Willian Richard Schisler Filho 452 sl 102, 88034-100 Itacorubi
Florianopolis SC Brasil
Reply | Threaded
Open this post in threaded view
|

Re: Re: Php client for Red5

Walter Tak
Perhaps I'm missing the point here, just trying to figure out in what situation one would want to communicate from PHP over RTMP to , say, Red5 or FMS , when an HTTP gateway (Jetty/Tomcat) is available which can talk "internal" to your custom application with a few lines of code.
 
I'm aware of various caching mechanisms for PHP but still ; if a PHP script is being executed by the user, which is always by a HTTP-request in a browser, then the script can, using the nice php-rtmp-client made by qwantix (which is a remarkable performance!), can make a direct call to a RTMP-server and even accept a callback from Red5/FMS and others. However ; you don't want a PHP-script to keep running on the server, normally it performs it's things like doing a database-query, inserting some records, retrieving some records, parsing a template etc etc and then return it to the user.
 
The main use of RTMP is that it's stateful ; the client keeps a connection to the server and is therefor reachable from the server at any time as long as the client stays connected. That's needed for video and audio transfer and it's pretty useful for creating multi-user applications like a chat or a game.
 
The client that calls the PHP script (which implemented the php-rtmp-client) is always called over a stateless http-connection. In order to send the result to the client it has to 'stop' (or empty it's buffer using for example ob_flush ( http://www.php.net/manual/en/function.ob-flush.php ). The concept of the callback from Red5 , at any given moment in time , back to the PHP-script is kinda useless in that situation since you don't want to keep open the http-connection between server and client since it will eat up resources (e.g. an Apache child that cannot die since there's still a connection in use).
 
I do see a totally different scenario where it could be very useful ; to automatically collect certain data from a running Red5/FMS server by running the php-script (and php-rtmp-client) on the server itself from commandline (PHP CLI version) from a scheduler like CRON(tab).
 
However why not use the java RTMPClient for that, if you can run Red5 on a server why not use a java-client to access it. And even then ; why not access the http-gateway with AMFPHP or SabreAMF.
 
@qwantix ; as you see I'm very curious why you had to develop an RTMP-client for PHP :)
 
----- Original Message -----
Sent: Saturday, 21 November 2009 16:18
Subject: Re: [Red5] Re: Php client for Red5

Yes Walter, you are correct! A php script even die when finishs.
But, already exists some techniques as "PHP APC" or "Memcached" that allow to store and share informations (as single objects and sessions) between scripts and diferent requests as objects.

BR.


2009/11/21 Walter Tak <[hidden email]>
Ah yeah right now I see what you mean. I used SabreAMF to make calls to the Red5 http-gateway to gain access to my Red5 application. No need for RTMP there.

Btw , just curious, why did you want to connect with PHP using RTMP btw ? Imho PHP isn't the best "tool" to do real-time communication since it's often used in a state-less way e.g. client calls PHP-scripts, script does it's things and then dies. Or have you built some php-server that runs continuously ofcourse.

W.

----- Original Message ----- From: "QwantiX" <[hidden email]>

To: "red5" <[hidden email]>
Sent: Friday, 20 November 2009 09:16
Subject: [Red5] Re: Php client for Red5



I'm not sure what you mean.  Neither amfphp nor sabreamf have a rtmp
client. They're just amf server.
In fact, php-rtmp-client use sabreamf for its amf serialisation/
deserialisation need.


On Nov 20, 12:13 am, "Walter Tak" <[hidden email]> wrote:
Or SabreAMF which has a RTMP-client as well to make Red5 calls from PHP.
It's on OSFlash as well ;http://osflash.org/sabreamf

W.



----- Original Message -----
From: "Andy Shaules" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, 19 November 2009 17:47
Subject: Re: [Red5] Php client for Red5

> Great job!

> Was there something lacking with the amfphp client? I have been using > that
> object to call red5 from php. Its included with the amfphp distribution.

> Andy

> ----- Original Message -----
> From: "QwantiX" <[hidden email]>
> To: "red5" <[hidden email]>
> Sent: Thursday, November 19, 2009 12:14 AM
> Subject: [Red5] Php client for Red5

>> Hi,

>> I recently created a new project :
>>http://code.google.com/p/php-rtmp-client/
>> It's PHP script that provide a simple synchronous connection to a rtmp
>> server like Red5 and allow to invoke remote methods

>> This script avoids using Javabridge to call method Red5 from a PHP
>> script.

>> send me your feedbacks...




--
Mario Junior
Enterprise Java / Flex Architectures
Adobe Certified Expert Flex 3 with AIR

Sofshore Informática
http://www.sofshore.com.br
+55 (48) 3337 2003
Rua Pastor Willian Richard Schisler Filho 452 sl 102, 88034-100 Itacorubi
Florianopolis SC Brasil
Reply | Threaded
Open this post in threaded view
|

Re: Re: Php client for Red5

QwantiX
I Walter,

I just created this client for a project containing high technical constraints: no access to the source server, and no gateway...
To solve the problem, we used Javabridge + RTMPClient but this is just too unstable, so I decided to get into the realization of a client in php...

Brice.



2009/11/21 Walter Tak <[hidden email]>
Perhaps I'm missing the point here, just trying to figure out in what situation one would want to communicate from PHP over RTMP to , say, Red5 or FMS , when an HTTP gateway (Jetty/Tomcat) is available which can talk "internal" to your custom application with a few lines of code.
 
I'm aware of various caching mechanisms for PHP but still ; if a PHP script is being executed by the user, which is always by a HTTP-request in a browser, then the script can, using the nice php-rtmp-client made by qwantix (which is a remarkable performance!), can make a direct call to a RTMP-server and even accept a callback from Red5/FMS and others. However ; you don't want a PHP-script to keep running on the server, normally it performs it's things like doing a database-query, inserting some records, retrieving some records, parsing a template etc etc and then return it to the user.
 
The main use of RTMP is that it's stateful ; the client keeps a connection to the server and is therefor reachable from the server at any time as long as the client stays connected. That's needed for video and audio transfer and it's pretty useful for creating multi-user applications like a chat or a game.
 
The client that calls the PHP script (which implemented the php-rtmp-client) is always called over a stateless http-connection. In order to send the result to the client it has to 'stop' (or empty it's buffer using for example ob_flush ( http://www.php.net/manual/en/function.ob-flush.php ). The concept of the callback from Red5 , at any given moment in time , back to the PHP-script is kinda useless in that situation since you don't want to keep open the http-connection between server and client since it will eat up resources (e.g. an Apache child that cannot die since there's still a connection in use).
 
I do see a totally different scenario where it could be very useful ; to automatically collect certain data from a running Red5/FMS server by running the php-script (and php-rtmp-client) on the server itself from commandline (PHP CLI version) from a scheduler like CRON(tab).
 
However why not use the java RTMPClient for that, if you can run Red5 on a server why not use a java-client to access it. And even then ; why not access the http-gateway with AMFPHP or SabreAMF.
 
@qwantix ; as you see I'm very curious why you had to develop an RTMP-client for PHP :)
 
----- Original Message -----
Sent: Saturday, 21 November 2009 16:18
Subject: Re: [Red5] Re: Php client for Red5

Yes Walter, you are correct! A php script even die when finishs.
But, already exists some techniques as "PHP APC" or "Memcached" that allow to store and share informations (as single objects and sessions) between scripts and diferent requests as objects.

BR.


2009/11/21 Walter Tak <[hidden email]>
Ah yeah right now I see what you mean. I used SabreAMF to make calls to the Red5 http-gateway to gain access to my Red5 application. No need for RTMP there.

Btw , just curious, why did you want to connect with PHP using RTMP btw ? Imho PHP isn't the best "tool" to do real-time communication since it's often used in a state-less way e.g. client calls PHP-scripts, script does it's things and then dies. Or have you built some php-server that runs continuously ofcourse.

W.

----- Original Message ----- From: "QwantiX" <[hidden email]>

To: "red5" <[hidden email]>
Sent: Friday, 20 November 2009 09:16
Subject: [Red5] Re: Php client for Red5



I'm not sure what you mean.  Neither amfphp nor sabreamf have a rtmp
client. They're just amf server.
In fact, php-rtmp-client use sabreamf for its amf serialisation/
deserialisation need.


On Nov 20, 12:13 am, "Walter Tak" <[hidden email]> wrote:
Or SabreAMF which has a RTMP-client as well to make Red5 calls from PHP.
It's on OSFlash as well ;http://osflash.org/sabreamf

W.



----- Original Message -----
From: "Andy Shaules" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, 19 November 2009 17:47
Subject: Re: [Red5] Php client for Red5

> Great job!

> Was there something lacking with the amfphp client? I have been using > that
> object to call red5 from php. Its included with the amfphp distribution.

> Andy

> ----- Original Message -----
> From: "QwantiX" <[hidden email]>
> To: "red5" <[hidden email]>
> Sent: Thursday, November 19, 2009 12:14 AM
> Subject: [Red5] Php client for Red5

>> Hi,

>> I recently created a new project :
>>http://code.google.com/p/php-rtmp-client/
>> It's PHP script that provide a simple synchronous connection to a rtmp
>> server like Red5 and allow to invoke remote methods

>> This script avoids using Javabridge to call method Red5 from a PHP
>> script.

>> send me your feedbacks...




--
Mario Junior
Enterprise Java / Flex Architectures
Adobe Certified Expert Flex 3 with AIR

Sofshore Informática
http://www.sofshore.com.br
+55 (48) 3337 2003
Rua Pastor Willian Richard Schisler Filho 452 sl 102, 88034-100 Itacorubi
Florianopolis SC Brasil