WebRTC based distribution with WHIP and WHPP running on AWS Fargate

Install and setup SFU

As SFU we will be using Symphony Media Bridge and we have prepared a Docker container that can be used[1]. Important here is that the container needs to be run in host-mode and thus necessary to run it on a Linux server where host-mode is supported by the Docker engine. The following docker-compose template can be used to get it up and running:

version: "3.7"services:
sfu:
image: eyevinntechnology/wrtc-sfu:latest
restart: always
network_mode: "host"
cap_add:
- SYS_NICE
ulimits:
rtprio: 99
environment:
- HTTP_PORT=8180
- UDP_PORT=0
logging:
driver: "local"
options:
max-size: 10m

Setup WHIP endpoint task

Next step is to setup the WHIP endpoint task on ECS. Based on the NodeJS library @eyevinn/whip-endpoint we have a container image[2] that can be used. Setup an ECS task that will be running the container image eyevinntechnology/wrtc-origin:latest and we also need to set the following environment variables:

  • PORT=8000 : the HTTP port exposed for the service
  • EXT_PORT=443 : the announced HTTP port and as we will use HTTPS termination with AWS Elastic Loadbalancer we will set this to 443
  • SMB_URL=http://<sfu>:8180/conferences/ : The URL to the management API for the SFU
  • HOSTNAME=<whip-host> : The announced hostname for the WHIP endpoint
  • WHPP_API_URL=https://<whpp-host>/api : The URL for the management API for the WHPP endpoint
  • WHPP_EGRESS_URL=https://<whpp-host>/whpp : The URL for which the player will access to initiate the playback

Setup WHPP endpoint task

Next step is to setup the WHPP endpoint. As WHPP is not yet an established egress protocol and there are other initiatives and proposals recently published we have developed and made available a generic egress endpoint library[3]. It currently supports WHPP but can easily be extended to other HTTP egress signaling protocols. In this example we will be using WHPP though as we can use the WHPP based player available already[4].

  • PORT=8000 : the HTTP port exposed for the service
  • EXT_PORT=443 : the announced HTTP port and as we will use HTTPS termination with AWS Elastic Loadbalancer we will set this to 443
  • HOSTNAME=<whpp-host> : The announced hostname for the WHPP endpoint
  • SMB_URL=http://<sfu>:8180/conferences/ : The URL to the management API for the SFU

Testing end-to-end

To test this end to end you can use the web-based WHIP client available at https://web.whip.eyevinn.technology and point to the endpoint at https://<your-whip-endpoint>/api/v1/whip/sfu-broadcaster?channelId=test

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Eyevinn Technology

Eyevinn Technology

925 Followers

We are consultants sharing the passion for the technology for a media consumer of the future.