Jump to content
  • 0

Multitrack Not Working



Hi ,

We are using Webrtc publishing stream on Ant Media.

We used this (wss://{AMS_URL}:5443/AppName/?mainTrack={GROUP_ID} ) format URL to communicate and publish stream on Ant Media and on check stream on https://{AMS_URL}:5443/WebRTCAppEE/multitrackplayer.html?maintrack=GROUP_ID. After clicking on Track Button StreamID displayed but No Audio. 

Is our method correct ? or Any other method need to be used. 







Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hi Aditya,

Thank you for joining the community hours and asking this question.  It helps us understand what you would like to achieve. It was great to meet you and you're always welcome to the community hours.

To answer your question. Ant Media Server currently ingests one audio track at a time from WebRTC connection. So you need to send multiple audio tracks to the Ant Media Server. Let me give you the instructions. 

1. Create a stream on the web panel with stream id `maintrack` as in the screenshot


2. Try to publish a stream to Ant Media Server with default stream id 'stream1' your default index.html on `https://{YOUR_ANT_MEDIA_SERVER_FQDN}:5443/WebRTCAppEE/index.html`

3. Open another tab and try to publish audio stream to Ant Media Server with stream id 'stream2' (Write 'stream2' to the box as in the image below)  on `https://{YOUR_ANT_MEDIA_SERVER_FQDN}:5443/WebRTCAppEE/audio_publish.html`


4. At this point there are 2 streams on the Ant Media Server 'stream1'(audio and video), 'stream2'(audio). So let's make the magic happen. Call the following REST Method

curl -X 'POST'  'https://{YOUR_ANT_MEDIA_SERVER_FQDN}:5443/WebRTCAppEE/rest/v2/broadcasts/maintrack/subtrack?id=stream1'  -H 'accept: application/json'

The method above add `stream1` as subtrack of `maintrack` 

5. Add `stream2` as a subtrack of `maintrack` with the following command

curl -X 'POST'  'https://{YOUR_ANT_MEDIA_SERVER_FQDN}:5443/WebRTCAppEE/rest/v2/broadcasts/maintrack/subtrack?id=stream2'  -H 'accept: application/json'

6. Open another tab and go to `https://{YOUR_ANT_MEDIA_SERVER_FQDN}:5443/WebRTCAppEE/multitrackplayer.html` and try to play the `maintrack`. You will see subtracks of `stream1` and `stream2` . You can enable 'stream1' and 'stream2' programmatically with JS SDK. (I see that there is a minor issue in the multitrack player about the list. Even if it makes feel a little weird, fortunately it will not prevent you to see that it's working)



I hope it helps. Please let me know if it works for you or we can do anything for you.

Take care



  • Like 3
Link to comment
Share on other sites

  • 0

Hi Oguz,

I performed same steps but in step 4 REST method (add `stream1` as subtrack of `maintrack`) i received "TTP Status 403 – Forbidden: The server understood the request but refuses to authorize it" Error. 

I tried following command

 curl -X 'POST'  'http://server_ip_address:5080/WebRTCAppEE/rest/v2/broadcasts/maintrack/subtrack?id=stream1'  -H 'accept: app443ation/json'



Link to comment
Share on other sites


  • Create New...