Skip to main content
January 29, 2013
Question

Server-to-Server Publishing doesn't start live

  • January 29, 2013
  • 1 reply
  • 1173 views

Hey Folks,

We're having a small issue with server-to-server publishing (FMS 4.5).

We currently have a cluster that looks like this:

Flash Media Encoder > Host Machine > Relay Machine (NY), Relay Machine (CHI), Relay Machine(EU)

We accomplish this with the following code in main.asc on onPublish:

var nc = new Array();

var ns = new Array();

nc[1] = new NetConnection();

nc[1].connect("rtmp://xxx.xxx.xxx.xxx/publishing/"+ newpoint);

ns[1] = new NetStream(nc[1]);

ns[1].setBufferTime(10);

ns[1].attach(streamObj);

ns[1].publish(streamObj.name + "?adbe-live-event=liveevent", "live");

          ns[1].onStatus = function(info) {

          trace("Stream Status: " + info.code)

              if (info.code == "NetStream.Publish.Start") {

        trace("The stream is now publishing to NY");

              }          

          }

nc[2] = new NetConnection();

nc[2].connect("rtmp://xxx.xxx.xxx.xxx/publishing/"+ newpoint);

ns[2] = new NetStream(nc[2]);

ns[2].setBufferTime(10);

ns[2].attach(streamObj);

ns[2].publish(streamObj.name + "?adbe-live-event=liveevent", "live");

          ns[2].onStatus = function(info) {

          trace("Stream Status: " + info.code)

              if (info.code == "NetStream.Publish.Start") {

        trace("The stream is now publishing to CHI");

              }          

          }

nc[3] = new NetConnection();

nc[3].connect("rtmp://xxx.xxx.xxx.xxx/publishing/"+ newpoint);

ns[3] = new NetStream(nc[3]);

ns[3].setBufferTime(10);

ns[3].attach(streamObj);

ns[3].publish(streamObj.name + "?adbe-live-event=liveevent", "live");

          ns[3].onStatus = function(info) {

          trace("Stream Status: " + info.code)

              if (info.code == "NetStream.Publish.Start") {

        trace("The stream is now publishing to EU");

              }          

          }

This works wonderuflly, except for one issue.

If we have one flash media encode going, the stream will start live. After this any consequent flash media encode will ALWAYS start at the beginning. In Strobe Media Player, You canm easily go to live by dragging the seekbar all the way to the right - but in Android for example, the seek doesn't work, so you cant go live. What causes this?

We were thinking it has something to do with timecodes, but we may be wrong.

Please please please someone help

This topic has been closed for replies.

1 reply

January 29, 2013

I should add that all encodes on the host server start live - only the relay servers start from the beginning (so it is most likely an issue with our relaying)

Adobe Employee
February 5, 2013

I am not sure if above code would work for multiple publishing. Secondly what are you trying to subscribe from Relay servers - are they HDS streams and is app name "publishing" - duplicate of livepkgr app?

February 5, 2013

Hi,

Yes - HDS/HLS - and publishing is a duplicate of livepkgr, correct.