Skip to main content
February 4, 2011
Question

Recording video in flash using FMS

  • February 4, 2011
  • 2 replies
  • 2397 views

Hello all,

I am developing a flash program which will take video feedback. I have installed FMS 4 (development server) on my machine and trying to record a video using a flash file. Following is the action script in my flash file.

var RTMP:String = "rtmp://localhost/live";

var camLive:Camera = Camera.get();
oVideo1.attachVideo(camLive);

var nc:NetConnection = new NetConnection()
nc.connect(RTMP);

var ns:NetStream = new NetStream(nc);

btnRecord.onRelease = function():Void{

ns.attachVideo(camLive);
ns.publish("demo","record");

btnPlay.enabled = false;
mcRecordInfo._visible = true;

nTimer = setInterval(stopRecording, 10000);

}

When i run this program i see my live webcam in SWF file but when i click recording nothing happens.  As per following code seems like it will save demo.flv file. but i am not sure where?

ns.publish("demo","record");

I checked FMS.ini file and saw my D:\Program Files\Adobe\Flash Media Server 4\applications\live

but still can't see demo.flv

Please help am i missing something !!!!! Your help would be greatly appreciated.

    This topic has been closed for replies.

    2 replies

    Participant
    February 28, 2012

    if u still have the problem..

    go to the samples folder in the FMS installed location.You will see many file one is main.as i guess

    copy all the files into your test folder under applications. Open up the main.as try to locate the line where it says something like permission or write access. I dont remember the complete code but it is a variable whose value is set to "" (like write_permission="") comment out that line and reload the application from FMS admin console.

    Adobe Employee
    February 4, 2011

    You should not record to "live" application. "live" application is meant for only live publishing. What you can do is create new application say "test" (just blank folder named test under applications directory of FMS - same place where you will find live & vod applications). Also make sure "test" has read/write permissions. Then try same client code of yours - it should work.

    February 4, 2011

    i tried its not working... created a test folder in applications folder.. . given read/write permission...

    FMS server is in start mode.....

    anything else i have to start  ?

    Adobe Employee
    February 4, 2011

    I hope you changed the URL used in your client from "rtmp://localhost/live" to "rtmp://localhost/test"  .  If you did that is connection to fms successful?