Adobe to contribute AMF support to Zend Framework
The cat is out of the bag. Go read Andi’s post!
The cat is out of the bag. Go read Andi’s post!
Lee Brimlow posted a New video tutorial on using AMFPHP and it is very good.
Learn how to install AMFPHP and create a simple service that sends email
It covers the majority of what you will need to know in order to really get a grasp on AMFPHP. Thanks Mike Potter for pointing out this great asset.
I am speaking about a project that I have been working on with Adobe and Zend at ZendCon this year. I am supper excited about this advancement as it brings together to languages that I love. Drop a comment if you are thinking about going or want to meet up. Also if there is something specific that you want to see in the presentation let me know! Session information should be released in the enxt couple weeks on the ZendCon website under RIA
A mil spec hardened FMS server and raw video stream publisher were required in order to stream drive camera , ptz and thermal surveillance video over RTMP streams from a robot back to a Flex user interface. I opted to use a PC-104 stack from to meet the temperature requirements and a mil spec hard drive. I also used a PC-104 4 input frame grabber in order to get all four robot cameras online. The frame grabber showed up as /dev/video0 with all four channels and we had to write a crop tool that brook the four quadrants of data and placed them onto vloopback V4L2 buffers. The new Flash Player 10 beta2 player was not able to pick-up vloopback as a valid V4L2 device so I opted for using the FlashCam project to convert my V4L2 device back to V4L. I used an AIR application that picked up the four streams and “published” the video at it’s highest quality to a localhost FMS server. Because of this need I had to have an X sessions so I used Xbuntu as the operating system. It is pretty slick install as it gets rid of all the traditional junk the Ubuntu desktop has in order to keep it fast. I assume that I could have cut down RHEL and gone with a supported FMS server but the following information will tell you how to get a dev version of FMS up and running on Xbuntu 8.04.
To install Flash Media Server on the box I had to follow the patch process outlined by Markus Bertheau and the first half of these steps were taken from this aYo Binitie II.
The following process gets Flash Media Server installed properly.
Install the additional libraries needs to run FMS on Ubuntu
$ sudo apt-get install libnspr4-dev
Unzip the download which for me was on my Desktop
$ unzip Flashmedia3_Int_Strm_ALP.zip
$ cd Flashmedia3_Int_Strm_ALP
$ tar xvzf FlashMediaServer3.tar.gz
Download and install the patch
$ cd FMS_3_0_1_r123/
$ wget http://www.bluetwanger.de/~mbertheau/flash-media-server-3-ubuntu.patch
$ patch -p1 < flash-media-server-3-ubuntu.patch
$ sudo ./installFMS
I ran with the defaults on everything. If you have Group issues then the patch did not work properly!
Installation complete! Double check
$ sudo /etc/init.d/fms restart
$ tail /var/log/messages
Jul 16 08:24:10 wade-laptop Service[21193]: Server stopped .
Jul 16 08:24:10 wade-laptop Service[22858]: Server starting…
Jul 16 08:24:10 wade-laptop Service[22858]: Server started (/opt/adobe/fms/conf/Server.xml).
Jul 16 08:24:10 wade-laptop Adaptor[22878]: Listener started ( _defaultRoot__edge1 ) : localhost:19350/v4
Jul 16 08:24:10 wade-laptop Adaptor[22878]: Listener started ( _defaultRoot__edge1 ) : 1935/v4
Jul 16 08:24:15 wade-laptop Service[23053]: Server starting…
Jul 16 08:24:15 wade-laptop Adaptor[23053]: Listener started ( FCSAdminIpcProtocol ) : localhost:11110/v4
Jul 16 08:24:15 wade-laptop Adaptor[23053]: Listener started ( FCSAdminAdaptor ) : 1111/v4
Jul 16 08:24:15 wade-laptop Service[23053]: Server started (./conf/Server.xml).
$ ps -e | grep fms
22858 pts/1 00:00:00 fmsmaster
22878 pts/1 00:00:00 fmsedge
22881 pts/1 00:00:00 fmscore
23053 pts/1 00:00:00 fmsadmin
Now to add an application and set proper permissions. I had a PTZ applications folder on my desktop with the new FMS app that I wanted installed. The following commands are necessary because you need to first make the applications owned by the user and group fms and then you need to remove the setuid bit that is added.
$ sudo cp ~wade/Desktop/applications/PTZ /opt/adobe/fms/applications/PTZ
$ ls -la /opt/adobe/fms/applications/ | grep PTZ
drwx–S— 2 root fms 4096 2008-07-16 08:52 PTZ
$ sudo chown -R fms:fms /opt/adobe/fms/applications/PTZ
$ sudo chmod 755 -R /opt/adobe/fms/applications/PTZ
$ ls -la /opt/adobe/fms/applications/ | grep PTZ
drwxr-sr-x 2 fms fms 4096 2008-07-16 08:52 PTZ
$ chmod -s -R /opt/adobe/fms/applications/PTZ
$ ls -la /opt/adobe/fms/applications/ | grep PTZ
drwxr-xr-x 2 fms fms 4096 2008-07-16 08:52 PTZ
Note that the setuid bit has changed from s to x
$ sudo /etc/init.d/fms restart
Your good to go now! Start using FMS like the documentation says and everything will work fine.
In response to some questions and emails
The specification for AMF serialization define a type market for each data type. There are 13 types in AMF A type marker is one byte in length and describes the type of encoded data that follows. The general data type is very simple to handle but what is more inportant is when a second byte exists called the ecoding type byte. Type markers may be followed by the actual encoded type data, or if the marker
represents a single possible value (such as null) then no further information needs to be encoded. What data type you need to serialize based on the first byte of data field. Once you get this type you there. This is fine if you have all the time in the world to implement every type in the specification. However most people when they think of array they think of just one type. But there are three types of arrays defined by AMF and if you really want a complete implementation you need to handle all three. Outside of teh speficication people really think of AMF as Life Cycle Data Services. I need AMF in php usually is someone implying that they want all the functionality of LifeCycle DS in PHP. This is really where the OOp functionality comes into play. A fully imlemented AF gateway falls well short of LifeCycle. In the next serialization implementation that I am working on it has to be able to add these additional mapping tools that are more generic than class mapping your custom classes to be a part of the release. A common request is ArrayCollections. Class mapping ArrayCollections is something that you need in almost every Flex project but it really is not part of the AMF specification. In this specific case AMF would treat the incoming Data as an object type which it is. By using a more OOP implementation it is easy to add this as an object type but then also used an optimized ArrayCollection handler that is part of the core library’s without having to have everyone role there own.
Headers fall into this too. Most developers like to toss additional session specific or session instantiation specific data into the AMF header. The new aproach allows you to create your own handlers for those headers and of course support the defined amf_server_debug, Credentials, DescribeService.
I have been working on a new code base for Amf to PHP Serialize’er and it all seems to be working. I am super excited about this! Mostly because I have spent the last 5 weeks working on building the architecture the way that I have always wanted it and it actually worked! It makes it super easy to make new amf/value/newtype.php so that the filter can be applied to the byte type coming in. You can also add amf/header/types.php so that you can easily deal with incoming AMF headers for things such as security. My hope is that this architecture keeps serialization advancements available to other developers so that it is not always on the project leads. So far the tests are really fast even with additional OOP functionality.
This is the last 38 hours of consumption minus starbucks trips and office coffee just so that I could make Mike Potter happy.
Love!
Just got my author copies of The Essential Guide to Open Source Flash. Obviously I am excited to see my name along with many of my friends and fellow flash zealots on the cover of this book. I have thumbed through the book and I am super excited to take the time to read the other chapters. There is already a lot of stuff that I started looking into to improve what I do. I want to thank Apress for putting up the cash to have those of us in the open source community do a professional job on documenting these great projects. I have found that one of the biggest difference between paid software and open source is documentation. Paid software usually has more documentation than functionality and open source can do everything you ever wanted as long as you watch the mailing list for year! Again thanks Apress, fellow authors, and please run out and buy a copy!
If I any idea how to monetize my blog I would have some nuts amazon referral thing but just go get a copy! I need to talk to Aral on that at some point~!
Recent Comments