msgbartop
Various ramblings-on, mostly about Red5
msgbarbottom

15 Jan 13 Red5 1.0.1 Released

Head over to the Infrared5 blog for details!

Tags: ,

16 May 12 Ivy and Maven

I’ve added some xml to hopefully support Maven and Ivy projects that use Red5 as a dependency just a little better. The group id is “org.red5” and the artifact id is “red5-server” or “red5-client”. For Ivy, add this pattern to your ivysettings.xml:

<artifact pattern="http://red5.googlecode.com/svn/repository/[organisation]/[artifact]/[revision]/[artifact]-[revision].[ext]" />

For your ivy.xml here are the dependency entries:

<dependency org="org.red5" name="red5-server" rev="1.0-RC2" />
<dependency org="org.red5" name="red5-client" rev="1.0-RC2" />

For Maven use this repository:

<repository>
  <id>Red5</id>   <url>http://red5.googlecode.com/svn/repository</url>
</repository>

and these dependency entries:

<dependency>
  <groupId>org.red5</groupId>
  <artifactId>red5-server</artifactId>
  <version>1.0-RC2</version>
</dependency>

<dependency>
  <groupId>org.red5</groupId>
  <artifactId>red5-client</artifactId>
  <version>1.0-RC2</version>
</dependency>

Tags: , ,

17 Jan 12 Android Market

I have created pro version of my broadcaster app for Android and Blackberry (playbook). The pro version allows for FMS or Red5 authentication as well as selection of all available cameras / microphones. The next two things I’ll be adding are i10n/i18n and h.264; the latter may not be possible in mobile air but I’ll give it a go.

Pro: https://market.android.com/details?id=air.org.gregoire.mobile.BroadcasterPro

Free: https://market.android.com/details?id=air.Broadcaster

The free version probably won’t be seeing any updates since I hate working on it in Flash CS5.

Lastly, If there’s enough interest I’ll do a version for iOS.

Update 1/18/12

I got h264 publish working in Android last night! woot! What a pain that was.. I need to verify that all is well with the stream data and my modifications to the application then I’ll put the update in the market.

Update #2 1/18/12

The latest pro build is up on the market 1.0.3, it allows you to stream h.263 or h.264 from your Android device. Enjoy!

 

Tags: , , , , , , , ,

28 Jul 11 Gmail Nesting

I just noticed a cool feature in Gmail, you can “nest” labels now!! Yay!

I also want to tell you all that I have post up on my company’s blog for clustered chat http://bit.ly/qFfkYp

Tags: , ,

31 Mar 10 Stop complaining about Flash

If people aren’t complaining about Flash and HTML5 they are falling back to NoSQL vs RDBMS. There is a time and a place for everything, just remember that tidbit. So to get on with it, I would like to state that I am mostly a Windows user and I love Windows 7.. It f#@king rocks! I also use Google Chrome as my primary browser on both OSX and Windows. I recently loaded the latest dev build of Chrome that contains a streamlined Flash Player and I can say that it is awesome.
To test, I started up a Red5 instance with some mp4 and vp6 videos to see what the CPU usage would be and here is the result: Red5 = 0% to 7% and Chrome = 3% to 6% (average 3%)
The playback was smooth as silk and the audio was perfect. Next up for comparison, I tried IE and FF:
IE 8 with FP10.1 = 5% to 11% (average 5%)
Firefox 3.6 with FP 10.1 = 14% to 66% (average 40%)

Tags: , , , , , , ,

08 Aug 09 Large if block vs list lookup

In Java, something which has always caught my eye or bugs me to no end is a large “if” block. Normally I refactor these into a “switch” to make it cleaner and easier to read, but in the case of String comparison it becomes more difficult. To diverge for a moment, I would point out that you can use a string’s hash code for a switch but you must know it ahead of final compilation (pita). So to get back to the point of this post, I want to show a little code I used today to remove an unruly looking if statement. This is the original code from Red5 (code shortened for brevity):

if (action.equals(ACTION_CREATE_STREAM)
		|| action.equals(ACTION_DELETE_STREAM)
		|| action.equals(ACTION_RELEASE_STREAM)
		|| action.equals(ACTION_PUBLISH)
		|| action.equals(ACTION_PLAY)
		|| action.equals(ACTION_SEEK)
		|| action.equals(ACTION_PAUSE)
		|| action.equals(ACTION_PAUSE_RAW)
		|| action.equals(ACTION_CLOSE_STREAM)
		|| action.equals(ACTION_RECEIVE_VIDEO)
		|| action.equals(ACTION_RECEIVE_AUDIO)) {
	//do something
}

This section has always bugged me, so I decided to make a collection containing all these strings. There may be 11 calls to String.equals in this block alone! Our “optimization” has a problem and it is that the “Constants” class containing the actions is an interface and as we all know you cant execute methods in an interface, or can we?

public static final List<String> STREAM_ACTION_LIST = new ArrayList<String>(11){
	{
		//Add all the stream actions to make lookup simpler
		add(ACTION_CREATE_STREAM);
		add(ACTION_DELETE_STREAM);
		add(ACTION_RELEASE_STREAM);
		add(ACTION_PUBLISH);
		add(ACTION_PLAY);
		add(ACTION_SEEK);
		add(ACTION_PAUSE);
		add(ACTION_PAUSE_RAW);
		add(ACTION_CLOSE_STREAM);
		add(ACTION_RECEIVE_VIDEO);
		add(ACTION_RECEIVE_AUDIO);
	}
};

Using a class initializer we can accomplish what we want! If you use this, dont forget to replace the brace characters.
So now the old if block becomes this:

if (STREAM_ACTION_LIST.contains(action)) {
	//do something
}

Tags: , ,

07 Aug 09 How to add an IoFilter per Application or Server

A new feature has been added to Red5 to allow any number of Mina IoFilters to be added to a connection at the Server or Application level. The particular filter detailed here is one that simply counts the connections and rejects any that exceed the set maximum number. This post details setting the filter at the Application level, but if you want it at the server level simply add the below bean definitions to your global webapp configuration located here: red5/webapps/red5-default.xml.

To add the filter you must first edit your applications red5-web.xml and add your beans:

<!-- Limits connections on a per-session basis -->
<bean id="connectionFilter" class="org.gregoire.red5.ConnectionShapeFilter">
    <property name="maxConnections" value="2"/>
</bean>			

Next create a “config” bean to inform the server about your filter bean names:

<bean id="config" class="org.red5.server.adapter.Config">
    <!-- List of filter bean names to be loaded -->
    <property name="filterNames">
        <list>
	    <value>connectionFilter</value>
	</list>
    </property>
</bean>  	

One important thing to note is that since classes in the main server are creating the connections, your filter classes must be found by the URLClassloader. The URLClassloader created by the server uses jar files within Red5’s lib directory, so put your filter classes here (red5/lib) inside a jar. Once your classes are in-place, start your server and the filters will take effect.

An example Eclipse / FlexBuilder project can be found here.

Tags: , , ,

15 Jun 09 Quartz schedulers

When you want to schedule a particular task or job within Red5, you have at least two options available which are built into the server. We use Quartz for our scheduler, but you are not required to use it; I just wanted to get that disclaimer out of the way, this is Java so use whatever you like.  The first option is the “server-wide” scheduler which is created when the server starts up and requires no configuration from your application. This scheduler is sufficient for most of the jobs you may want to create, but you will run into problems if you attempt to access an application class from within your job. The second option resolves this issue by providing an application level scheduler, one which can access your classes. The only caveat with this scheduler is that you must provide some configuration details, your applications context name.

Accessing the “server-wide” scheduler is done in your application like so (using scope):

schedulingService = (ISchedulingService) scope.getContext().getBean(ISchedulingService.BEAN_NAME);

Accessing the application scheduler is slightly different (using app context):

schedulingService = (ApplicationSchedulingService) ((BeanFactory) applicationContext).getBean("scheduler");

I prefer to make sure the schedulingService member is setup in my “appStart” method, since this is essentially where the application is “started” within Red5.

The following entry must be made in your applications red5-web.xml file if you want to use an application scheduler:

<bean id="scheduler" class="org.red5.server.scheduling.ApplicationSchedulingService">	 	
    <property name="applicationName" value="myapp" />
</bean>

Make sure you set the correct application name / context (replace “myapp”).
Once you have the scheduling service, you can add your job amongst many other options which I don’t want to cover here.

Tags: , , , , , ,

06 Jun 09 PHP support in Red5

I’ve updated my “parameterdemo” to include a couple PHP pages. The latest trunk (0.8.1-dev) now supports PHP through the use of Quercus. To enable it simply set a context parameter in your web.xml and include the quercus and resin-utils jars in your WEB-INF/lib. See the zip file for a complete example (eclipse + ant).

Once you deploy the war, go to these urls to test (update your port to match your servers setting):

PHP example getting value from Red5 application: 

<a href="http://localhost/parameterdemo/getparam.php">http://localhost/parameterdemo/getparam.php</a>

Same example with debug output: 

<a href="http://localhost/parameterdemo/getparam.php?debug=true">http://localhost/parameterdemo/getparam.php?debug=true</a>

Java servlet example: 

<a href="http://localhost/parameterdemo/myservlet">http://localhost/parameterdemo/myservlet</a>

The web.xml entry must look like so:

	<context-param>
	   <param-name>enable-php</param-name>
	   <param-value>true</param-value>
	</context-param>

Note: You dont have to install Resin to use Quercus, simply download one of the wars on this page: http://quercus.caucho.com/ and grab the libraries from WEB-INF/lib

Tags: , , , , ,

05 Jun 09 Red5 0.8.0 released

Come one, come all.. Red5 0.8.0 is now available. Make your way to our google code page and download the installer for your platform. http://code.google.com/p/red5/

PS. If someone wants to build the Debian package, we are looking for a volunteer.

Tags: , ,


Fatal error: Call to undefined function akismet_counter() in C:\xampp\htdocs\paulgregoireblog\wp-content\themes\googlechrome\footer.php on line 9