Adobe Cocomo RTMFP enables “Skype” without installation

3 December 2008

Yesterday, the blog of the Adobe Cocomo team announced a limited service for RTMFP. The entry is very informative and straight; so go read it! RTMFP stands for Real-Time Media Flow Protocol and is well explained in these FAQ. From an end user perspective, RTMFP seems to be as relevant as for example the move in imaging from CCD-sensors to CMOS-sensors: Both technologies can deliver great result, but with CMOS it gets much easier over the years and it is also much cheaper.

Hopes are, that RTMPF can lower costs of high bandwidth audio and video conversations mainly between two users while featuring a higher quality than a server based communication. The only party-stopper might be restrictive firewall rules. In fact, if I were an IT administrator I would block all those outgoing connections.

To start a connection between two users, you need something like a dating service. Adobe Stratus does this job exclusively. Once you know each other, the service is only loosely involved with your interaction.

What’s missing at first glance is the ability to store those streams. I think it is the same problem as with direct communication to Cocomo. You can persist objects but no streams. While it’s fine to start with a proprietary protocol, I hope Adobe releases the specs as soon as possible. I hope to see RTMFP soon in Wowza and Red5.


Streaming server, RMTP, AMF3, HTTP is for…??

12 November 2008

A comment of Fer triggered me to write up a short summary for what all these technologies are for. We are only talking about how Flex/Flash Player can communicate to servers. Communication between Flash Players, .swf-files within Flash Player or the Flash Player and the operating system is not touched. I’m gonna structure this after a totally subjective weighting of use cases:

Text that is not changed every minute

Use XML (or JSON) over HTTP for sending and receiving text between Flex and the server. They are THE standard protocols everybody knows and there is no reason to prefer any other protocol. While there are some cavities, HTTP may be suitable for 95% of all use cases. There are very interesting posts about the performance of AMF3, however I bet that your use case does not profit enough. I even wonder (because I don’t know), if an optimal configuration of application caching, HTTP caching and HTTP compression could reach higher performance numbers than with any proprietary protocol. But the engineering costs and support costs will increase with any other protocols than XML/JSON and HTTP (note that this is not specific to AMF3).

Products: Any web server on earth

Images and binaries such as file.doc that are not changed every minute

Same as above, use HTTP.

Suitable products: Any web server on earth

Text that is changed within 1 minute

Typically, these are for example text chatting or a white board application. For this purpose, all the real time protocols fly! Use any of Adobe’s RTMP protocol in combination with all those nice helper technologies such as Remote Shared Objects.

Suitable products: Adobe BlazeDS, Adobe LiveCycle Data Services, Red5, Wowza Media Server Pro, WebOrbGraniteDS, RubyAMF, AMfPHP, PHPObject, SabreAMF, DjangoAM, …

Audio or video chat, Hugo to Tony and Tony to Hugo

Two parties send a video stream to each other. There are not so many alternatives as above:

Suitable products: Adobe FMS, Red5, Wowza Media Server Pro

Audio or video broadcast, Hugo to many people

For this use case, there are actually two solutions: The progressive download of the Flash Player may be sufficient in many cases. This means that Flash Player starts to download a file and can start playing the video event if the download has not finished.

Suitable products: Any web server or e.g. directly from Amazon S3

If you want to jump to an arbitrary point in the video or audio or you want to broadcast live, you need a streaming server.

Suitable products: Adobe FMS, Red5, Wowza Media Server Pro

Final word

After this simplied explanation, I cannot let you go without saying that you should think through your use case thorougly and don’t take generall statement as above as a base of reasoning in any way.


Beauty Contest between Red5, Wowza and Adobe LiveCycle…

19 August 2007

Beauty contests are a matter of taste. Also take the points below as such. I’m only stating my judgment for my needs. Apropos needs, I assemble a Flex/Air application that draws its data from a server. The format of the data is mostly strings and XML but also video, audio and proprietary file formats such as doc, xls, pdf, etc. So, which server suits my application best?

Adobe LiveCycle Data Services Enterprise Suite

Who ever made up this name, he was stoned – really! Because this contest is about beauty, the name alone would already disqualify the nominee. However, the real killer comes from the price. I suspect that the same person that created the name also set the prices. When you see after a search odyssey these prices, you skip to the next option.

To be fair, I should add that Adobe clearly targets the enterprise world and not small and medium-sized businesses, let alone the geek ‘market’. If you happily spend more than 50′000$ for e.g. a single Oracle database, go for the Adobe Liveblabla.

Wowza Media Server Pro

Functionally spoken, this server is a clone of the Flash Media Server: It’s focused on streaming data. Everything implemented is done in a way I like (this doesn’t imply that it’s best). It starts with a clear and clean file structure. I also appreciate the straight posting of the product prices.

Getting to the server code, documentation and forum is a real pain. The sign up for the free license and the forum is ridiculously tedious. What do you need the address for? Once you’re through, documentation and in particularly the forum are very useful. The support of Charlie in the forum is world class. He is very responsive and knowledgeable what you can verify yourself in the forum. In my opinion, they should point potential customer more to this unique selling point. However, since I’m used to browse the source of Red5, I have missed this many times with the Wowza server. I don’t like to program against a black box. This is 90′. Another point is that phrases in the sense of “it’s like in FMS” should be banned. I don’t learn first FMS when I want to use Wowza.

Basically, Wowza does not support Flex. They also don’t advertise it. This means that RemoteObject or RemoteClass are not supported. Communication is only over AMF0 because AMF3 is not yet implemented. I also miss some details useful in the Flex world, for example there’s no helper method for XML. Another interesting aspect is that Wowza and Red5 leverage both the power of Apache Mina. I think Wowza handles the traffic without an off-the-shelf servlet container.

I few things are still unclear because I did not bump into the answer at first look: I was not able to find out how to create a SharedObject by the server or whether something similar to ISharedObjectSecurity is available. What about the Red5 rooms? The virtual hosts do certainly not replace the room concept of Red5. Keep in mind that all those questions asked on the forum, I would have the answers within a few hours. Again, I love this service and eventually, it might turn me into a paying customer.

Wowza offers a customized Eclipse IDE that helps you getting off the ground. Unfortunately, this is also optimized for the Flash folks. Because I have already an Eclipse installation for Java, Flex, Scala, etc, I’d get a second Eclipse…grumblegrumble.

Red5

Being under the LGPL, Red5 is our only open source candidate what gives the project a bonus. Red5 is wired together with Spring, leverages Mina for low-level network stuff and takes advantage of quite a number of other libraries. Generally, it feels a bit cluttered. Let’s take the spring configuration as an example: You find four packed configuration files for the Red5 part. On top of this, you find in the files the alternative beans for the Tomcat container instead of Jetty.

Talking about Jetty, it’s definitely a project of my gusto. I perceive it as a focused project that simply does its job. Also in another context, it features some nice things. I have not done performance tests but Jetty might be slower than Tomcat. In a different setup, Jetty was not yet up to Tomcat. Does anybody have a solid comparison?

The architecture and the quality in general are fairly well, particularly when considering the number of current contributors to the core features of the server. There are very few and for this year, Joachim Bauch has done the bulk of the load. Even though this is not optimal, keep in mind that it’s open source and the situation might be even worse with Wowza. There are many others that update the samples, configuration or give some answers in the forum. However, the forum is not as useful as the one of Wowza.

Recently, a few examples for Flex have been added to the samples. Also a first implementation of RemoteObject is done but not yet ready for prime time. It seems that they have paid more attention to the Flex crowd recently (everything done for Flash?). Concerning tests, there are 20-30 unit tests what certainly leaves room for improvement.

Bottom line

There are many more solutions to consider: I haven’t looked at WebOrb, OpenAMF, GraniteDS and the other servers that do not support Java. Some of them are  RubyAMF, AMfPHP, PHPObject, SabreAMF, DjangoAMF and more.

For the moment, Wowza fits best my needs for real time stuff and I will try to combine it with my Scala code. For data exchange, I use good old HTTPService. “good old” relates to HTTP not HTTPService as the Flex class is very restricted in features. More about that in another blog.


How Flex exchanges data with red5

16 July 2007

Let’s focus on what happens between Hugo, the user and NetConnection: What are the options for exchanging data between red5 and Flex?data communication with red5
(click image to enlarge)

  • All of these options are asynchronous.
  • Besides loading video or audio streams, I also save some other loading mechanisms for future blogs:
  • Note that RemoteClass is a different story. This is a metadata tag in ActionScript and tells Flex and red5 that a class in ActionScript corresponds to a class on the Java-side. You can use RemoteClasses with all options except Messaging (I believe).
  • Sources are Joachim’s tutorials, Create new Java red5 application, Flex docs , particularly the API, red5 mailing list and red5 wiki.

1. Remote Shared Object (RSO)

  • Flex API: SharedObject
  • red5 API: SharedObject
  • See previous entry.
  • Some explanations to the drawing: Each dinosaur represents objects like a string, number, xml, class, etc. There is only one real group of dinosaurs. However, Hugo, Fiona and the server have one local copy of the group. As soon as anybody changes the SharedObject, it is automatically communicated to the others.
  • Anna does not have the same SharedObject, so she knows nothing about dinosaurs.
  • You can have any number SharedObjects in your system only limited by resource restrictions (pretty much the same as with groups of dinosaurs on earth).
  • Groups of dinosaurs live in the wild (everybody can access them) or locked in the zoo (restrict access on the server)

2. Remote Procedure Call (RPC), Flex to red5

3. Remote Procedure Call (RPC), red5 to Flex

  • Flex API: set netConnection.client = class with the public method “flexMethodName”
  • red5 API: iServiceCapableConnection.invoke(”flexMethodName”)
  • It’s basically the same as option 2. The main difference is that you need a ServiceCapableConnection. This can be done with all options 1-5 from here, but I suspect very different loads of network traffic. (Has anybody analyzed this?)
  • As above, see Joachim’s guide.

4. Remote Object

  • Flex API: RemoteObject, sample of a call
  • red5: declarative, in code?
  • This is the newest baby of red5. It has been just implemented. You find a sample in the echo application in red5.
  • The dinosaurs symbolize an ancient Java object that hasn’t been necessarily created by the red5 programmer. In other words, you can use POJOs for RemoteObjects including Java classes from third-party libraries.
  • RemotObjects are basically the same as RPC in option 2. It is nicely integrated into Flex so it looks like the other RPC services HTTPService and WebService.

5. Messaging

  • Flex API: Producer, Consumer
  • red5: ???
  • The entire infrastructure like AsyncMessage exists in red5 but I haven´t invested in the how-to/whether.
  • Consumer confirm each message with an ACK. I assume that the acknowledgment does not only go to the server but also to the Producer?
  • Besides the ACK, messaging is a one-way communication. However, nobody will hold you off establishing Consumers also as Producers.
  • There is always one Producer and 0 to infinite Consumer.

Suggestions, corrections, etc are welcome.


What are Remote Shared Objects (RSO) for?

9 July 2007

A RSO lives at least on one client and is always known to the server. Typically, you have the RSO not just on one client but on many. These distributed RSO can be used for two things:

  1. Synchronize data of any type automatically
  2. Send a message to all shared objects

How-to on the client

  • Create RSO: var so:SharedObject = SharedObject.getRemote(“nameOfRSO”, netConnection.uri, false)
  • Create or update a property: sharedObject.setProperty(“propertyName”, propertyValue)
    • With non-primitive types of propertyValue, use sharedObject.setDirty()
  • Send a message: sharedObject.send(“methodName”, arguments)
  • Like a local shared object, you could store the data of a RSO permanently on the client side (=persistence). This brings with it that the size of the RSO has to comply to the global storage setting on each client.

How-to on the red5-side


How Flex talks to red5

8 July 2007

Update 16 July: see also How Flex exchanges data with red5

I found it very hard to grasp all the different possibilities of talking to red5. So I made a drawing:


data communication with red5

(click image to enlarge)

Some remarks:

  • Options 5-7 are also on offer without SSL.
  • AMF is basically something like a zip of your objects, or here explained in other words. AMF3 is choosen by default: netConnection.defaultObjectEncoding = ObjectEncoding.AMF3.
  • How can I choose the application layer? In netConnection.connect(“rtmp://your.red5.com/server”). Here, you define the protocoll such as rtmp, rtmps, rtmpt, http, https.
  • What if a firewall blocks e.g. port 1935? With netConnection.proxyType = none | best | HTTP | CONNECT, you determine this behaviour. Öööm, however my brain power has not been sufficient to understand what really happens behind the curtain. There is some more information on HTTP tunneling but probably outdated.
  • red5 does not support RTMPS directly, but you can use stunnel as described by Macromedia or Sunil Gupta.
  • Note that you can divert all web service calls of a Flash Player over your server. This is done with webService.useProxy = true (default = false). I don’t know whether red5 supports this.
  • I assume the protocol RTMP (area shown in red) is always the same whether you call it RTMP, RTMPT or RTMPS. The only difference is on which protocols they live on.
  • This is a model and doesn’t reflect the entire reality! (otherwise it wouldn’t be a model…)

So these are the options from the application layer starting from AMF3 to the Aether. I hope to come around with a similar post what options exists above NetConnection.

If you know something better than I do, please tell me. I will happily correct it.