Various ramblings-on, mostly about Red5

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.



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: , , , , , , , ,

07 Apr 09 On-demand room / scope creation

I am not sure how or if FMS provides a means for dynamic rooms, but Red5 does and I will try to explain how to use it below. For the following example, you should expect the following url – rtmp://localhost/myapp/room is being used. The method below is an overridden super class method from the Red5 application adapter. The example places a client into an id based “chat” room; the id algorithm could be anything you desire and is not fixed. I have used this block in a couple projects, one of which used an encrypted room and id portion and its url looked similar to this – rtmp://localhost/myapp/29c8109abd29e

	public boolean roomJoin(IClient client, IScope scope) {
		log.debug("roomJoin - client id: {} scope: {}", client.getId(), scope);
		IConnection conn = Red5.getConnectionLocal();

		String scopeName = scope.getName();
		log.debug("Scope name: {}", scopeName);
		//check for "application" scope
		if ("myapp".equals(scopeName)) {
			log.debug("Connection already connected to app scope");
		} else if (conn.hasAttribute("")) {
			//client is already in a room
			log.debug("Connection already connected to room scope");
		} else {
			//the room name
			String roomName = scopeName;						
			//set flag
			conn.setAttribute("", true);
			//get app scope
			IScope appScope = scope.getParent();
			//handle at room level
			if ("room".equals(roomName)) {
				//lookup room (top level)
				IScope roomScope = ScopeUtils.resolveScope(appScope, roomName);
				if (roomScope == null) {
					if (appScope.createChildScope(roomName)) {
						log.debug("Room {} created", roomName);
						roomScope = appScope.getScope(roomName);
					} else {
						log.warn("Room {} was not created", roomName);
				} else {
					log.debug("Room scope {} was found", roomName);
				//get the next room identifier
				String chatId = getNextChatId();
				//room for chat id
				IScope chatScope = ScopeUtils.resolveScope(roomScope, chatId);
				if (chatScope == null) {
					if (roomScope.createChildScope(chatId)) {
						log.debug("Chat scope {} created", chatId);
						chatScope = roomScope.getScope(chatId);
					} else {
						log.warn("Chat scope {} was not created", chatId);
				} else {
					log.debug("Chat scope {} was found", chatId);
				//send the actual join
				return roomJoin(client, chatScope);
			} else {
				return false;
		return super.roomJoin(client, scope);

After this block is executed, your client would be connected to something like this – rtmp://localhost/myapp/room/1001 without having to create any additional NetConnections. The method “getNextChatId()” is meant to provide a chat room id, based on whatever criteria you would like.

Tags: , , , , , ,

28 Jan 09 RTMPT and Red5

By default or so I’ve been told, the Flash Player will try various ports when attempting to connect to a resource. In Red5, RTMP is supported out-of-the-box on the default RTMP port of 1935 and HTTP is setup on 5080. A “special” server is started on 8088 as well to handle RTMPT only requests, but this requires that you set your request url as “rtmpt://myserver:8088/myapp/” which can be confusing and completely ignores the Flash Player port probing. So I offer this solution, allowing you to setup HTTP on port 80 and RTMPT on port 80 as well. Since Red5 includes a servlet container (Tomcat by default), you have a full-fledged HTTP server and servlet engine built-in; allowing a servlet to answer the RTMPT requests.
The first file we need to modify is the server properties file located in the conf directory:

  • Locate the http.port key and change it to 80 instead of 5080
  • Do not change the rtmpt.port entry, it should be 8088
  • Save and close the file

The last file to modify will be your web application configuration or “web.xml” file. The web application configuration file will be located here: red5/webapps/myapp/WEB-INF/web.xml if your application name is “myapp”. Add these entries:






Informational links about FlashPlayer and ports:
HTTP Tunneling protocols

The Trouble with Proxy Servers

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.

Tags: , , , ,

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