Skip to main content
Jan 29, 2013 2:18 AM UTC
Question

Server-to-Server Publishing doesn't start live

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 is closed to new replies. Start a new post to keep the conversation going.

4 replies

Jan 29, 2013 2:58 AM UTC

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)

Translate
Participating Frequently
Feb 5, 2013 6:43 PM UTC

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?

Translate
Feb 5, 2013 7:39 PM UTC

Hi,

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

Translate