msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

06 Oct 08 Red5 + h.264

I am so happy right now, Steven helped me with the MP4 branch and now it "works"!

After we worked out the time stamping and probable channel issues, it all came down to an SHA256 in the handshake routine. I still have a lot of clean up to do, but at least there is hope for 0.9.0 release :)

If you want alpha level code that only plays one clip, you can grab the branch from here: click

 


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , ,

01 Oct 08 Accessing parameters

I recall seeing a question from a user about accessing servlet parameters from their Red5 application, so I have created a small demo which shows how to not only access sevlet parameters from Red5 apps but the other way around as well.

Retrieve a servlet context parameter from inside a Red5 application (AppContext -> Servlet)

1. Grab a reference to the application context

ApplicationContext appCtx = getContext().getApplicationContext();

2. Get the servlet context

ServletContext ctx = ((XmlWebApplicationContext) appCtx).getServletContext();

3. Get the context parameter

String param = ctx.getInitParameter("myparam");

Retrieve an application context parameter from a inside a servlet (Servlet -> AppContext)

1. Get the servlet context

ServletContext ctx = getServletContext();

2. Grab a reference to the application context

ApplicationContext appCtx = ctx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);

3. Get the bean holding the parameter

MyBean bean = appCtx.getBean("mybean");
String param = bean.getParameter("myparam");

Sample project files: parameterdemo.zip

Instructions:

Unzip the demo and create a new directory named parameterdemo in your red5/webapps directory, then restart your server.

Open your browser and go here: http://localhost/parameterdemo/myservlet?paramName=myparam

You should see "Hello World"

To test the Red5 application you will need to create a Flex or Flash application that connects to: rtmp://localhost/parameterdemo

Then simply call "getParameter" passing a parameter name you want the value of. The name must match a context param in the web.xml file.

 


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , , ,

01 Oct 08 Red5 Admin

I just spent many hours trying to get the Admin (demo) application working properly; it was quite painful. Trying to get JNDI and Spring to cooperate in an Embedded Tomcat instance is not what I call fun, but I have it working alright for now. There still seem to be some underlying classloader issues in the server, because I cannot self-contain the web applications. No matter how I configure the server or application, there are always jars that must be in the shared lib directory; if anyone has any experience with this I would love to hear it.  So without further rambling, here are the steps to take to get it working:

1. Obtain the admin war or use my archive

2. Unzip the archive into the webapps directory (red5/webapps/admin)

3. Move the following jars to your shared lib directory (red5/lib)

  • derby-10.4.2.0.jar
  • jasper-el-6.0.18.jar
  • el-api.jar
  • simple-jndi-0.11.4.1.jar
  • spring-jdbc-2.5.5.jar
  • spring-orm-2.5.5.jar
  • spring-tx-2.5.5.jar

4. Restart Red5

5. Go to http://localhost:5080/admin/register.html to add new users

I hope this helps those of you new to red5, since I know it can be difficult to get things going at times. :)

Here is my test version zipped for your convenience: admin_10012008.zip (1.02Mb)


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , , , , , , ,

28 Sep 08 Tomcat connectors

In Red5, you have pretty much full access to manipulate the embedded Tomcat engine via Spring. With that being said I would like to give details on how to change the http connector between two available options; there are several other options, but I'll only be covering NIO and BIO. First a quick explanation of these two options:

  • BIO - Blocking Input / Output, this has been around since the beginning of internet time. It uses one thread per socket connnection to handle requests.
  • NIO - Non-blocking Input / Output, this has been available in the JDK since 1.4. It uses a single thread to handle many socket connections.
In most cases, you should find NIO to be much faster and more able to handle a lot more connections than BIO will. The default connector was set to NIO until today when I switched it to BIO to prevent problems with Unix-based systems (OSX / Linux).
The configuration of Tomcat in Red5 for HTTP, RTMPT, and RTMPS is nearly identical so you may apply the configuration items below to any of the embedded servers. To configure with a BIO connector, locate the connector section and change the constructor arg value:

<property name="connector">
  <bean class="org.apache.catalina.connector.Connector">
    <constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11Protocol" />
    <property name="port"><value>80</value></property>
    <property name="redirectPort"><value>443</value></property>
    <property name="enableLookups"><value>false</value></property>
  </bean>
</property>

To use the NIO connector simply change the constructor arg as shown below:

<property name="connector">
  <bean class="org.apache.catalina.connector.Connector">
    <constructor-arg type="java.lang.String" value="org.apache.coyote.http11.Http11NioProtocol" />
    <property name="port"><value>80</value></property>
    <property name="redirectPort"><value>443</value></property>
    <property name="enableLookups"><value>false</value></property>
  </bean>
</property>


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , , , , , ,

18 Sep 08 Logging work-around

I have given up waiting for someone to claim the bounty or produce a fix for the web context logger issue. After much trouble tracking everything down, I have finally "fixed" the logging for web contexts, that is for those of you using the bootstrap method of server start up. The fixed revision is 3068 and its a little rough; meaning I still need to do bit of refactoring. I just wanted to let you all know.

Part 1

Here is what you have to put in your web.xml for each web application to get an individual logger context:

[listener]
[listener-class]org.red5.logging.ContextLoggingListener[/listener-class]
[/listener]

(more...)


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , ,

12 Sep 08 RTMP load tester

I want to let everyone know about a simple RTMP load testing tool that I wrote in flex. Its really simple and allows you to rip a stream from either FMS or Red5 as quickly as possible. If you find it useful or want to add to it, let me know.

The source link is for the latest version in which I have started adding shared object testing; I could use some assistance with that part if any of you have time. The bin link is to the "old" version.


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , ,

12 Sep 08 Using custom objects in AMF3 with Red5

I created a post about this subject almost a year ago, but there were a couple minor issues with the examples. Here I will show what eight additional months of experience can provide. The example provided here uses a custom object in Flex to pass information to and from the server, which in this case will be Red5. If one of you has an example which uses FMS on the server-side, I would be glad to include it here.
(more...)


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , , ,

06 Sep 08 IvyDE - Part 2

Sorry for the delay in posting this, but I was a tad busy with the svn sync :)
I also had some trouble getting the IvyDE to behave as I expected. The screen cast below will show you how to get Red5 to build properly in Eclipse. One of the key points is to use Ant from a console to pull any suborn libraries down into the correct location, to do this simply turn off the auto build in your eclipse project and use this command:
ant -Divy.conf.name="java6, eclipse" dist
Note: substitute java5 for java6 if you are using JDK 1.5.
When you've finished using ant, remember to turn auto-build back on.


(more...)


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , ,

03 Sep 08 Fun with svnsync and googlecode

Today we (Red5) moved our cvsdude repository to our existing google code repository. One of the first steps to take care of is to remove anything in your google code repository and have it reset to revision 0. To get the reset, you have to post to the google code discussion group and request it. If your repository is already empty you may see the option to reset under your projects "Source" tab.

Before you start your sync I suggest that you perform an svn update, svn commit, and svn clean up on your source repository; in that order.

Step 1: Open a terminal or command window and issue this command from top level directory of your checkout location
svnsync init --username yourusername https://myproject.googlecode.com/svn/ https://svn1.cvsdude.com/myproject

The username is for your destination which is the first url specified, the next url is for the source. You may be presented with a password prompt and / or a key accept dialog, answer and proceed

Step 2: Issue the sync command, which will be used every time you need to restart the sync
svnsync sync https://myproject.googlecode.com/svn

The url should point to your destination.

If everything goes smoothly, you will not see any errors and your repository will exist on the destination. This was not the case for us, so here are the ways we got past the issues that resulted.
(more...)


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , ,

30 Aug 08 IvyDE - Part 1

Some of you may know that there are at least two different versions of the IvyDE, the plugin which interfaces Eclipse with your Ivy files. To use the plugin with Red5 you will need the latest version, especially if you use Ganymede. I will record some screen casts to help you through the upgrade / fixes. I apologize now for my large screen size, I will record smaller versions in the future. So without further rambling here is the first video: IvyDE part 1


View this Post in: Chinese(S) Chinese(T) French Arabic Bulgarian Croatian Czech Danish Dutch Finnish German Greek Hindi Italian Japanese Korean Norwegian Polish Portuguese Romanian Russian Spanish Swedish

Tags: , , , ,