Skip to main content
Participant
February 3, 2011
Answered

Record in default vod application

  • February 3, 2011
  • 1 reply
  • 865 views

Hi!
I'm trying to record a  video to the default FMS vod application with a flash movie, i'm getting this error: "NetStream.Record.NoAccess".

I think the problem is not in my code, but just to make it sure, here is it:

var mycam:Camera = Camera.getCamera(); mycam.setMode(320,240,25); var myvid:Video = new Video(mycam.width,mycam.height); myvid.attachCamera(mycam); stage.addChild(myvid); var conn = new NetConnection(); conn.connect("rtmp://192.168.1.104/vod"); conn.addEventListener(NetStatusEvent.NET_STATUS, statHandler); function statHandler(event:NetStatusEvent) {      if(event.info.code == "NetConnection.Connect.Success") {           conn.addEventListener(AsyncErrorEvent.ASYNC_ERROR,function(){});           var stream = new NetStream(conn);           stream.client = new Object();           stream.attachCamera(mycam);           stream.publish("testrec","record");      } else {           trace("error in connect");      } }

So i want to ask that do i need any configuration to use NetStream.publish("xy","record") on the server?

i checked and the connection to the server is fine.
if i use live streaming, than it's fine (of course in this case i use the live application).
It's maybe a file system related problem. I use windows 7, and given all permissions for all the users.. still dont working.

I think it can be a FMS configuration issue.

    This topic has been closed for replies.
    Correct answer Shiraz Anwar

    Hi Jumika,

    In case you want to record videos on the server side, you may need to first ensure that you are using FMIS (Flash Media Interactive server).

    If you are already using it, then steps are as follows:

    1. Create a new app in the fms application directory.

    2. Make sure in fms.ini VHOST.APPSDIR is correctly pointing to your default FMS application folder (i.e. C:/Program Files/Adobe/Flash Media Server4/applications) folder.

    3. Now, you need to put some server-side code if you want to record the current live streaming, you may like to refer the Server-side actionscript document to see what all APIs you would like to use to create your application. A simple snippet of such code that only records the stream will look like as follows:

    application.onPublish = function(clientObj,streamObj){

    mystream = Stream.get("hello");

    mystream.onStatus = function(info){

    trace("mystream onstatus:"+ info.code);

    }

    mystream.record();

    mystream.play(streamObj.name);

    }

    application.onUnpublish = function(clientObj,streamObj){

    mystream.record(false);

    }

    4. After this restart the server and try to publish from FMLE, you would be able to record your application, otherwise let me know if you face any difficulty.

    1 reply

    JumikaAuthor
    Participant
    February 3, 2011

    I've forgot to mention that i use FMS4 and i don't use the Apache brought width FMS.

    I have edited my fms.ini like this: " VOD_COMMON_DIR = MY_OWN_APACHE_DIRECTORY/www/vod"

    Shiraz AnwarCorrect answer
    Participating Frequently
    February 3, 2011

    Hi Jumika,

    In case you want to record videos on the server side, you may need to first ensure that you are using FMIS (Flash Media Interactive server).

    If you are already using it, then steps are as follows:

    1. Create a new app in the fms application directory.

    2. Make sure in fms.ini VHOST.APPSDIR is correctly pointing to your default FMS application folder (i.e. C:/Program Files/Adobe/Flash Media Server4/applications) folder.

    3. Now, you need to put some server-side code if you want to record the current live streaming, you may like to refer the Server-side actionscript document to see what all APIs you would like to use to create your application. A simple snippet of such code that only records the stream will look like as follows:

    application.onPublish = function(clientObj,streamObj){

    mystream = Stream.get("hello");

    mystream.onStatus = function(info){

    trace("mystream onstatus:"+ info.code);

    }

    mystream.record();

    mystream.play(streamObj.name);

    }

    application.onUnpublish = function(clientObj,streamObj){

    mystream.record(false);

    }

    4. After this restart the server and try to publish from FMLE, you would be able to record your application, otherwise let me know if you face any difficulty.

    JumikaAuthor
    Participant
    February 3, 2011

    Thanks for your help.

    This code completely solved my problem.

    I've just realized the samples in the documentation folder. That also helped mutch.

    Just one more question: Can i somehow adjust the quality of the recorded video on client side? Because the quality is really terrible.
    I dont want to use FMLE. I want a web based Flash interface for recording, so that's why i wrote the code above.