How to Setup Flash Media Server 4 for Recording

It is a common seen requirement to use Flash to record audio from browser, like the famous singing search site midomi. These days I did a little survey about this, write down some memo here.

There are a lot of resources introducing how to program in ActionScript to send video/audio stream via RTMP protocol. One particular page I found very useful is this. It gives you out-of-box sample application and full source codes, also with complete related JavaScript sample codes. However the author seems using Red5 server, which I found not maintained as well as FMS(Flash Media Server). Here are some steps to setup FMS4 to work:

  1. Download FMS4 and install it. An Adobe member account is required. I used Windows version.
  2. Open FMS start page and play with it, default location. Test if video streaming is working.
  3. Open FMS admin console and play with it, default location. Here you can view active connections to the server and log.
  4. Replace the application “live” with an unsigned version: backup all contents under path \applications\live\, then delete them; copy all contents under path \samples\applications\live\ to \applications\live. This is based on instructions in \applications\live\readme.txt.
  5. Open \conf\fms.ini, change the line starting with “LIVE_DIR” to
    # LIVE_DIR = C:\Program Files\Adobe\Flash Media Server 4\applications\live
    LIVE_DIR = C:\Program Files\Adobe\Flash Media Server 4\webroot\live_recorded
  6. Restart FMS4 service: run “Stop Adobe FMS4” then “Start Adobe FMS4” in start shortcut group of FMS4.
  7. Open the demo page mentioned above on the FMS4 machine. Use the “Want to test your Red5 install?” part to test your own FMS setup. Fill in “rtmp://localhost/live” and click “Load” button. It should be able to record and play, the file should be saved under \webroot\live_recorded\ as an .flv file.

Embed PicasaWeb Album in WordPress, XHTML 1.0 Compatible

It’s quite convenient that Google PicasaWeb released the new feature of embedding album by flash. But the same as some other places in PicasaWeb, the codes it gives out aren’t XHTML 1.0 compatible, either…

Though it’s not a big deal and I know someone thinks w3c standards stupid, I would like my own blog in clean and tidy codes, and I wish there are some more strict standards in HTML world, that will make programmers life much easier and make Internet more organized.

The more realistic problem, which drove me to do some experiments and write down this post, is that WordPress is actually quite picky with html codes. If you use PicasaWeb’s codes in WordPress, wich use “embed” tag, WordPress will change it to “ibed” tag automatically. That will lead to some annoying small bugs when you want to edit the post or switch between “Visual” and “Code” modes. So I guess I’d better feed WordPress, this picky girl, some W3C compatible codes.

Finally I chose the plugin pb-embedFlash to do that. For example, PicasWeb gives me such codes for embedding one of my albums

<embed type=”application/x-shockwave-flash”
width=”400″ height=”267″

Then with pb-embedFlash, what I need to do is just use codes like this

[ flash
weiwei9%2Falbumid%2F5084619049582967009%3Fkind%3Dphoto%26alt%3Drss w=400 h=267]

Use the swf URL followed by a question mark and the value of flashvars in codes given by PicasaWeb. Note that I leave a blank space between the “[” and “flash” to avoid being converted.

I have to admit it’s not an easy job to insert some Flash in WordPress without plugins, so I strongly suggest the plugin – pb-embedFlash.