Skip to main content
niteshkumar
Inspiring
November 18, 2009
Question

Live Streaming with recording simultaneously

  • November 18, 2009
  • 1 reply
  • 1174 views

Hi,

     I have got success in making live streaming with telecast at different pc.

     The application which I have made has the features:

     I' am publishing live stream using the connection like: nc.connection("rtmp://10.8.4.56:1935/live");

     publishing the stream like: ns.publish("mycamera","live");

   

     now, on other pc I am running the file for telecast using the following code:

     making connection with server: nc.connection("rtmp://10.8.4.56:1935/live");

     playing the live stream: ns.play("mycamera"); vid.attachNetStream(ns);

Now, that was for the live stream for publish and view. But I want little more than that.I want to record the live stream at the publish end simultaneously.

I have tried the code at publish side like:

nc.connection("rtmp://10.8.4.56:1935/live");

ns.publish("mycamera","live");

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

But it is giving me error: NetStream.Record.NoAccess

when I am changing the connection point to "tmp://10.8.4.56:1935/dvr", t is giving me the result but then effecting the live telecast.

I want to make a single application for Live publish, VOD, Live recording.

Is there any settings on the Server that I am missing or file needed for doing all the three things in one application.

Please help.

Thanx in advance.

    This topic has been closed for replies.

    1 reply

    Participating Frequently
    November 18, 2009

    Its not that difficult. Just create a simple application of yours. Steps as follows:

    1. Create a folder called "myApp".

    2. Create a "streams" folder and under streams folder create "_definst_" folder. Place all your VOD files here.

    3. Create a main.asc file and put below code in it

    application.onConnect = function(){

         return true;

    }

    application.onPublish = function(myClient,myStream){

         myStream.record();

    }

    application.onUnpublish = function(myClient,myStream){

         myStream.record(false);

    }

    Place this main.asc file under "myApp" folder.

    4. Now to publish your code would be:

         nc.connection("rtmp://10.8.4.56:1935/myApp");

         ns.publish("mycamera","live");

    So when you do this automatically recorded file by name "mycamera.flv" would get created.

    5. So if you want to play live stream your client would issue: ns.play("mycamera",-2,-1,true)

        For on goign recording i.e. DVR kind of play ns.play("mycamera",0,-1,true)

        For VOD , say you already have file called "sample" ,  issue ns.play("sample",0,-1,true)

       In all above cases , netconnection would be to "myApp" like how publisher does.

    See if this solves your problem.

    Participating Frequently
    November 18, 2009

    What i have suggested in bare minimum app for you to try , if you want complete solution try out "dvrcast" application from Adobe itself , you can download it from Tools page of FMS :http://www.adobe.com/products/flashmediaserver/tool_downloads/ - DVRCAST APPLICATION FOR FLASH MEDIA INTERACTIVE SERVER 3.5

    niteshkumar
    Inspiring
    November 19, 2009

    Hi SE,

        

         Thanx for quick response, but there is issue in doing recording from the code on server side. The issue is that whenever u want to publish, the recording at server end will be started and which could be a bottleneck. I want to make the streaming live throughout the session but the decision for recording should be at the publisher end not the server end. I've tried with ns.close and nc.close but it stops the live publishing also, which I don't wan't.

    Is there any possibility that I could decide the recording at publishing end.

    Thanx.