Skip to main content
Participant
August 29, 2007
Question

About FMS2 Connection

  • August 29, 2007
  • 2 replies
  • 289 views
Hi all

i want to publish microphone audio to the server but failed. stream always show "live" on fms2_console, and no flv is published on server.
this is my client-script:

Code:
import flash.net.*;
import flash.events.*;
stop();

NetConnection.defaultObjectEncoding = ObjectEncoding.AMF0;
var nc:NetConnection = new NetConnection();
var ns:NetStream;
function ncHandler(eve:NetStatusEvent):void
{
trace(eve.info.code);
if(eve.info.code == "NetConnection.Connect.Success")
{
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, nsHandler);
ns.attachAudio(Microphone.getMicrophone());
ns.publish("blackcamera", "record");
}
}

function nsHandler(eve:NetStatusEvent):void
{
trace(eve.info.code)
}


nc.addEventListener(NetStatusEvent.NET_STATUS, ncHandler);
nc.connect("rtmp://localhost/myApplication");
then, i create a folder called "myApplication" on server root but not create main.asc(i don't think it's necessary).

i run the client and trace "NetConnection.Connect.Success
" and "NetStream.Publish.Start". the server works well but the stream' type always "live", and the bandwidth shows nothing.

thanks
    This topic has been closed for replies.

    2 replies

    Participant
    September 3, 2007
    thank u VashDStampede.

    i installed virtual camera and server began to record! but i have another question. i just wanna record sound with microphone, not camera, how should i solve this problem?the sound recording still didn't work this time. thanks.
    Participant
    August 31, 2007
    I've had the same problem. I cannot guarantee this is the solution, but it seems there's some issue on whether you have an installed camera or not. If you have no camera, then flv are not created. Install a virtual camera or a webcam on the client side and try again. You'll notice the flv is created.