Flash Streaming Server


Recently I was involved in a discussion about multimedia servers for a game some friends are developping (dotGaia Fleets) and thanks to that discussion, arise this short comparision between the major multimedia server that exists for Flash and Flex: Flash Media Server, Red5 and Wowza. I have worked with all of them, so this is more my working experience than an exhaustive analisys.

Red5, Open Source, free, Java

Red 5

Red5 have a winner argument: is free an open source. This characteristic makes this server the ideal choice for any project in early stages (first testing and modelling) Before you make any choice, you can have something running at a very low cost, and those involved in startups could consider this as a great benefit.

I have used it for broadcasting and socket server with good results, but with some problems for sync between audio and video when recording live. Another problem (key for me) is certain lack of documentation and articles. If you go trough the tutorials that you can find around they cover all the basics (audio and video setup, login, NetConnection and NetStream handling, etc) but as far as you go in more complex scenarios (distributed broadcasting, chain of servers, balance based on ping time, etc) you will need to deal to Java source code, and that will be a challenge (specially for those like me not familiar with Java coding)

There are a few tools you can use to help in your development. Basically any text editor is fine to write code, the XML needed for basic setup or any java code to be deployed. There’s also some debugger an admin panel that recall the one for Flash Media Server and runs smoothly.

Another problem I faced was to find a hosting. Since there are a few, if you need a scalable environment or a CDN you’re in trouble, since the most important CDN (Content Delivery Network) in the market use Wowza or Flash Media Server. The lack of support is also a problem, but recently you can contact red5 developpers and get permissons to create tickets in red5.org site. Scalability is a key for medium to big applications, and as far as you add users, transference and distribution becomes the heavy elements when you need to pay the bills, beeing license a minor item in the equation

Wowza, an interesting alternative

Wowza

Wowza was made by people from the Adobe FMS team that begins his own company, and use also Java in the server side. In this aspect is similar to Red5 and you need to take into account that each time you change your application you need to redeploy and reinit the application. In Wowza you can restart the application whitout problems but in Red 5 I remember to restart the whole server … but there was more than one year ago, so probably currently you can restart the application fine. For those not coming from the Java World, the proccess of redeploy and reinit is slow and tedious at some point, so probably you want to test a batch of change instead of add step by step if time matters.

Wowza have interesting settings for bradcasting audio an video. In example, the XML for the application support a quality a type of stream tags extremely easy to add, specially because documentation is very complete and in Wowza forums you can find easy examples but also more sophisticated ones, with experience people that allways can give you a hand (they help me alot, big thanks)

You can use Wowza in combination with Amazon EC2 Cloud, and there are also some CDN based on Wowza. When looking at this services, pay atention about the avaibility of using server side scripts or not, some of the cheaper offers doesn’t allow to write and deploy your own modules, beeing a no go for more complex applications. Also you can consider an hibryd schema: static server for delivering and a dedicated server with full access for the buisiness layout. The question is: do you really need real streaming? Sometines just serve files in the standard way with an appropiate buffer is enought, and by far, cheaper.

Flash Media Server

fms

And finally mi favourite, Flash Media Server. Many people arguee that the server license is expensive … and really is (around u$s 4000 a pro license) … but you really want to manage your own server?

And here is the real diference: if you want to host your streaming server (I mean put your dedicated server in a NOC) the license cost is a big deal, but if you think about it and select any of the available hosting or CDN, then license becomes a minor item compared to transference and avaibility. And really the big cost is transference. If you did run any stream based service and did pay your bills, probably you will agree with me. Also FMS have alot of services available including CloudFrontStreaming from Amazon, where you paid only for the transference (but you can’t add customized seever side scripts)

I will give some numbers as example: a basic hosting for development (up tp 10 simultaneous users, limited transference, ideal for client showcast) around u$s 10 month, a more stronger server, based on transference and simultaneous conections, between u$s 100/300 per month. My numbers are based on Influxis, the provider I use lately, but there are other similar networks as VitalStream or the expensive Akamai. In Stefan Richter Flashcomguru web you can find a very complete list

Technically FMS is probably the better known server, with ton of articles in Adobe Devnet

As a short list I will mention: admin panel, Javascript 1.5 as the server side script (so much more friendly to an ActionScript developper), application reload fromn the Admin panel, scalability and fail recovery based on Master-Edge servers, DRM (Digital Right Management) for licensed material distribution, dynamic streaming and detailed documentation.

For challenging development, probably the best choice, but the decision is up to you

Conclusion

One of the best books for reading about Flash streaming is “Programming Flash Communication Server“, with complete examples and the best set of examples never writed. Is a little old (2005) and the code is in AS2, but I never find another book with the same depth of concept (and I have read a lot), so if you really want to work on this, is a must read book. It includes a couple of little frameworks and an overview of the FMS AS2 components (that probably you never want to use, hehe)

Tip for arquitects: With an adequate multiuser logic encapsulation (say a good proxy), you can move from one to another server whitout much panic. .

Another one: You always need to evaluate if real streaming is neccesary in the project because is by far the more expensive item. If you can use static files with standard servers (progressive streaming) even in an hybrid environment (say one streaming server + many standard servers) your costs will become sustantially lower

 

Advertisements

Install Flash Server on Windows — Install Red5 Server


Download required files
Red5

Download the latest Red5 edition (currently is 0.6.3) for Windows.
Download page: http://www.osflash.org/red5/red5downloads

JDK:

Download from the official site. Red5 requires JDK1.5 or a higher version to be used and here it is JDK-1_5_0_11.

Download page: http://www.sun.com/download/

Installation Step

1) Install JDK

If you have installed JDK, please go to next step.

Double-click the installation file jdk-1_5_0_11-windows-i586-p.exe to start installation. The whole installation process is simple and users just need to pay attention to the selection of installation path.

The file path can only be composed by letter, number and underline. It can not contain blank space or any other special characters. The structure and level of directory are very clear, e.g. D:\JDK, so it is convenience for maintain later. Even if JDK is upgraded, it does not affect the use of other program because the path doesn’t change.

2) System Environment Configuration:

Right click “My Computer”, go to “Properties”, “Advanced”, and select “Environment Variables”.

Add following variables: (Suppose the installation path of Java JDK is D:\jdk.)

Add variable PATH and set its value as D:\jdk\bin

Add variable CLASSPATH, value .;D:\jdk\lib;D:\jdk\lib\tools.jar;D:\jdk\lib\dt.jar

Add variable JAVA_HOME, value D:\jdk

Note: Here “.” cannot be omitted.

If variable name exists already, edit it and add relevant information.

When finishing configuration, we need to test if the JAVA developing environment has been installed successfully or not. Open the command-line window and input command “java” and execute it. If there is no error message that means the installation is successful. If not, please check if you have finished the above steps correctly.

3) Start the installation of Red5.

Double-click the downloaded file setup-red5-0.6.2.exe to show installation wizard.

Following the wizard, it requires to select a path for JAVA Runtime Environment (JRE). The installation will search for the path automatically, and if it failed, please define one manually.

Then select the installation directory of Red5 and non-system disk is recommended, for example: D:\red5.

And then select components to install. By default, all items are selected and we do not suggest changing the settings.

There are installation options in “Select Additional Tasks”.

If you want to set it as system service, pick “Register as service”. (Recommended)

If you want to “Create a desktop icon”, tick the left checkbox.

If you want to “Download sample streams”, tick the left checkbox.

4) Red5 Configuration

Last, pay attention to the system configuration of Red5.

RTMP port is the serving port of Red5 and it is the communication port of server and client.

HTTP servlet engine port is the http communication port of Red5 and it is mostly used by administrator.

In default situation, no change is needed, unless a default port has already been occupied by other applications. If so, change it to an idle port. (Note: Only port number above 1024 is permitted.)

Besides, please pay attention to the notice, the password of Red5 default administrator account is “admin”.

When installation is finished, we can still change the port.
Enter into Red5 installation catalogue, open file “red5.properties” under folder “conf”:

rtmp.host_port = 0.0.0.0:1982

http.host = 0.0.0.0

http.port = 5080

rtmpt.host = 0.0.0.0

rtmpt.port = 8088

debug_proxy.host_port = 1936

proxy_forward.host_port = 127.0.0.1:5080

rtmp.threadcount = 4

Here list the basic configuration, and for more details please consult the help file of Red5. After changing port, the new port does not go into effect until the Red5 server is restarted.

The whole installation is finished by now. We can find Services program in the “Management Tools” of “Control Panel”. Start it, then find Red5.

Start up the service, visit http://127.0.0.1:5080/admin, and log in as “admin” and so as the password. If everything is OK, it means Red5 has already worked.

Next, you are suggested to read Install Video Chat Server RED5 Edition.

TOP