Ready to use – Red5 streamer application

Following Red5 Developer series from Dominick Accattato, and a neat explaination from on CustomFilenameGenerator, Here is a ready to use, fully capable pre-compiled Red5 application for anyone who wishes to set up Flash streaming with Red5 , but does not know where to start.

The application is tested on Red5 0.8. to use it in 0.9 you may have to remove the bandwidth-setting code in main Application class and recompile it.

How to configure Stream/Record paths:

1. Edit the file file red5-web.xml in the WEB-INF directory

2. Move down to the “streamFilenameGenerator” bean definition and adjust values of recordPath and playbackPath as you wish.

3. To use absolute paths, set “absolutePath” property as true.




# Update : Customstreamer for Red5 0.9:



# Update : Customstreamer for Red5 0.7: [Updated June 17 2010]


*Try out the new Red5 application generator HERE

Note:  To compile source, use eclipse J2ee build.

Passing parameters to Red5 application with OSMF

Recently working on a Flex project i had the need to implement a video player in my Flex application. Although my needs did not involve media streaming, rather only playing live streams, i still needed a  industry standard code to my solution. Thats where OSMF (Strobe)  came handy. Tracking OSMF for a few months, seems like we finally have a usable version – OSMF 1.0  (0.93).

The second hurdle was passing parameters to RTMP application. As the traditional Netconnection class allows connection params in the constructor, i was unable  to find a example on the web involving OSMF and passing parameters to RTMP applications. Finally after some struggle , god’s grace 🙂 i think i nailed it. Here is the code snippet showing you how to connect to a RTMP application and passing parameters when connecting.

Note: Make sure you have latest OSMF revision from trunk added to your project classpath.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application applicationComplete="application1_applicationCompleteHandler(event)" xmlns:mx="" layout="absolute" minWidth="1024" minHeight="768">

import org.osmf.containers.MediaContainer;
import org.osmf.elements.VideoElement;

private static const REMOTE_STREAMING:String = "rtmp://localhost/RtmpAuthenticate/DarkKnight.flv";
private var mediaElement:VideoElement;
private var mediaPlayer:MediaPlayer;
private var container:MediaContainer;

protected function application1_applicationCompleteHandler(event:FlexEvent):void
var vector:Vector.<Object> = new Vector.<Object>();
vector[0] = "rajdeep";
vector[1] = "xyz123";

// TODO Auto-generated method stub

mediaElement = new VideoElement(new StreamingURLResource(REMOTE_STREAMING,StreamType.RECORDED,NaN,NaN,vector),new NetLoader);
container = new MediaContainer();
container.addMediaElement( mediaElement );

// Flex requires a DisplayObject to be wrapped in Flex Framework UI Abstraction
videoParent.addChild( container );

// MediaPlayer is a virtual controller. Assign it a media element and it will autoplay the media by default.
mediaPlayer = new MediaPlayer(mediaElement);

container.width = 320;
container.height = 240;

private function onMediaPlayerState(me:MediaPlayerStateChangeEvent):void

<mx:UIComponent x="144" y="110" width="409" height="325" id="videoParent" />

Red5 and Flex 4 Spark VideoPlayer

Here is a little demonstration of the new spark video player in Flex 4 SDK, that plays a rtmp stream from Red5. The Flex 4 SDK is still in beta as of this date and thus there may be some issues if you use it commercially right now. I had some issues with autoplay being false. So i have tried with [autoPlay = true] instead. However i must say it works much better than Flex3 VideoDisplay component with Red5.

Get Adobe Flash player

Download Flash builder project

RED5 vs FMS – Part 1

Red5 and FMS features in comparison

Following are few of the functions and properties of RED5 and FMS in comparison. In most of the aspects you will find Red5 to be slightly more complicated but far more powerful than Flash Media Server. The Red5 Team is working on bring around SSAS (Server side actionscript) to actionscript programmers who may not be very fond of java. Its expected to come put with the first grand release of Red5 ‘s version 1.0 (more…)

last comments

Thank you very much for your great summary!!!