You can't use Flash Media Encoder 2 in Linux, so you have to make your own publisher with Flash. Idea is to make own Flash application which connects to webcam and send/publish this live video to Flash Media Server 3 and then clients can connect to Flash Media Server 3 and start to view this live broadcast. Here are simple default instructions to send live video from Linux to Flash Lite 3.0 application.
Install Linux and Flash Media Server 3:
- Install some Linux distribution (I installed Fedora Core 8 )
- Download and install Flash Media Server 3 (you might have to use -platformWarnOnly)
- go to your fms directory: cd /opt/adobe/fms
- start Flash Media Server 3: ./fmsmgr server fms start
You can use command: "ps aux | grep fms" to see list of fms processes running. There should be following processes listed: fmscore, fmsedge, fmsmaster and fmsadmin. If not, there are some problems
in your configuration and maybe you want to read this: Flash Media Server does not start after successful installation on RedHat Linux
Creating own publisher with Flash is quite simple. Open NetConnection to Flash Media Server 3. After you get NetConnection.Connect.Success, you can start connection to your webcam and publish stream to Flash Media Server 3.
Publisher:
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.net.ObjectEncoding;
import flash.media.Video;
import flash.media.Camera;
import flash.events.NetStatusEvent;
import flash.events.AsyncErrorEvent;
var nc:NetConnection;
var ns:NetStream;
var video:Video;
var camera:Camera;
// create NetConnection-object
nc = new NetConnection();
nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nc.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
// connect FMS 3 default live application
nc.connect("rtmp://localhost/live");
// error handling
function asyncErrorHandler(event:AsyncErrorEvent):void {
trace(event.text);
}
// if connected, start publishing
function netStatusHandler(event:NetStatusEvent):void {
if (event.info.code == "NetConnection.Connect.Success") {
startPublishing();
}
}
// publish webcam's live to server
function startPublishing():void {
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
camera = Camera.getCamera();
if (camera != null){
video = new Video();
video.attachCamera(camera);
ns.attachCamera(camera);
// show video in publisher also
addChild(video);
ns.publish("livestream", "live");
} else {
trace("Please check your camera and microphone");
}
}
Publish your live video publisher in Flash and upload it (swf, html, js) to your web server. Open your publisher in Web browser and you should see your live video in publisher. Start Flash Media Server Admin console and you should see one live application running and publishing live video.

Next you have to make Flash Lite 3.0 application to connect your FMS 3 server and play your live stream. Create Video-object in screen and type following code in first frame in Flash.
Client:
import flash.net.ObjectEncoding;
var video:Video;
var ns:NetStream;
var nc:NetConnection = new NetConnection();
nc.objectEncoding = ObjectEncoding.AMF0;
nc.onStatus = function(info:Object):Void {
if (info.code == "NetConnection.Connect.Success") {
startStreaming();
}
}
function startStreaming() {
ns = new NetStream(nc);
ns.setBufferTime(2);
video.attachVideo(ns);
ns.play("livestream",-1,-1,true);
}
status_txt.text = "Status : Connect....";
nc.connect("rtmp://your.server.ip.here:1935/live");
Note!
You might have some issues with Linux firewalls, then you must edit /etc/sysconfig/iptables to allow connect FMS ports. Add following lines to iptables to allow ports: 1111 and 1935 access from remote and restart your iptables with command: /etc/rc.d/init.d/iptables restart
# flash media server 3 -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1111 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT














