Simulcasting to social media channels
  • 22 Feb 2022
  • 2 Minutes to read
  • Dark
    Light

Simulcasting to social media channels

  • Dark
    Light

This guide describes how to live streaming in Social Media on Ant Media Server.

  1. How to Publish Live Stream on Facebook?
  2. How to Publish Live Stream on Youtube?
  3. How to Publish Live Stream on Periscope?
  4. How to Add/Remove RTMP Endpoint with Ant Media Stream?

How to Publish Live Stream on Facebook?

You can publish live streams on your pages/accounts. Just click the Live button in the Create Post tab.

After the click Live Button, you can see Facebook Live Dashboard as in the image shown below:

You just need to copy the Stream URL and Stream Key.

PS: If you want to use a persistent stream key, you just need to enable Use a Persistent Stream key in Setup Option.

Your Facebook RTMP Endpoint URL that you will use in Ant Media Server should be like this: <StreamURL><StreamKey>

For example: rtmps://live-api-s.facebook.com:443/rtmp/677122211923308?s_bl=1&s_psm=1&s_sc=677124129589969&s_sw=0&s_vt=api-s&a=AbxqZXR6X1VaKBzk

You just need to Add your Facebook RTMP Endpoint URL to the Ant Media Server stream RTMP Endpoint tab as the following image.

So, you can start broadcasting now!

How to Publish Live Stream on Youtube?

You can publish live streams on your YouTube account. Just click the Create button and select Go Live.

Just Click the Go button on the Streaming Software tab.

Then copy the Stream URL and Stream Key.

Your Youtube RTMP Endpoint URL that you will use in Ant Media Server should be like this: <StreamURL>/<StreamKey>

For example: rtmp://a.rtmp.youtube.com/live2/dq1j-waph-e322-waxd-dxzd

You just need to add your Youtube RTMP Endpoint URL to the Ant Media Server stream RTMP Endpoint tab as the following image.

So, you can start broadcasting now!

How to Publish Live Stream on Periscope?

You can publish live streams on your periscope account. Just click the Profile button and select Producer.

Then copy Stream URL and Stream Key.

Your Periscope RTMP Endpoint URL that you will use in Ant Media Server should be like this: <StreamURL>/<StreamKey>

For example: ,rtmp://de.pscp.tv:80/x/baps3a3x7j32

You just need to add your Periscope RTMP Endpoint URL to the Ant Media Server stream RTMP Endpoint tab as the following image.

So, you can start broadcasting now!

How to Add/Remove RTMP Endpoint with Ant Media Stream?

You can Add/Remove RTMP Endpoint with 2 options.

One of them is Add/Remove RTMP Endpoint with Dashboard. It's for the general users.

Another option is Add/Remove RTMP Endpoint with REST API. This option is for advanced users. You can Add/Remove RTMP Endpoint with programmatically. REST API Usage is so basic.

1. Add/Remove RTMP Endpoint with Dashboard

This option is for general users. You just need to click the broadcast properties tab and click Edit RTMP Endpoint as the below image.

2. Add/Remove RTMP Endpoint with REST API

This option is for advanced users. You just need to request rtmp-endpoint REST API.

Here is Add RTMP Endpoint Javascript XHR example:

var data = JSON.stringify({
"rtmpUrl":"rtmps://live-api-s.facebook.com:443/rtmp/sdasdasd=ddfsdfsdf"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "http://<server-domain>:5080/LiveApp/rest/v2/broadcasts/streamID/rtmp-endpoint");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

You can get more info in the REST API.

Here is Remove RTMP Endpoint Javascript XHR example:

var data = JSON.stringify({
"rtmpUrl":"rtmps://live-api-s.facebook.com:443/rtmp/sdasdasd=ddfsdfsdf"
});

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("DELETE", "http://<server-domain>:5080/LiveApp/rest/v2/broadcasts/streamID/rtmp-endpoint");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send(data);

You can get more info in REST API.

Click for more detail about REST API Guide.

PS: Please be sure to add your IP Address to the Use IP Filtering for RESTful API option on Application Settings.

Conclusion

After adding RTMP Endpoint, you need to publish a live stream. Here is our guide for publishing live stream. Finally check the social media account to see the live stream.


Was this article helpful?