• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Live Streaming with recording simultaneously

Participant ,
Nov 17, 2009 Nov 17, 2009

Copy link to clipboard

Copied

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.

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 18, 2009 Nov 18, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 18, 2009 Nov 18, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 18, 2009 Nov 18, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 18, 2009 Nov 18, 2009

Copy link to clipboard

Copied

LATEST

Yup you can do that also.

What you need to do is define methods on server which will start and stop recording and let publisher call them when it desires.

So you main.asc code would look like this:

var clientObj=null;

var streamObj=null;

application.onConnect = function(myClient){

     clientObj = myClient;

     clientObj.startRecord= startRecord;

     clientObj.stopRecord= stopRecord;

     return true;

}

application.onPublish = function(myClient,myStream){

     trace("Live Publish began");

     streamObj = myStream;

}

application.onUnpublish = function(myClient,myStream){

      trace("Live Publish stopped");

}

function startRecord(){

     streamObj.record();

}

function stopRecord(){

     streamObj.record(false);

}

From your publisher , you need to call this functions in order to achieve what you want. Publisher client will make call using nc.call

example : nc.call("startRecord",null);

               nc.call("stopRecord",null);

Hope this will solve this issue. Please note this is again bare minimum code , just for one publisher - for you to try , you can modify and add more features.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines