Skip to content

Back of the envelope calculations: mediasoup

Paulo Lanzarin edited this page Oct 22, 2021 · 16 revisions

Using mediasoup in a 2.4 (> RC.2) installation

  1. If your server is behind NAT (otherwise skip to step 2):
    • Let $SERVER_IPv4 be your server's public IPv4
    • yq w -i /etc/bigbluebutton/bbb-webrtc-sfu/production.yml mediasoup.webrtc.listenIps[0].ip "0.0.0.0"
    • yq w -i /etc/bigbluebutton/bbb-webrtc-sfu/production.yml mediasoup.webrtc.listenIps[0].announcedIp $SERVER_IPv4
    • yq w -i /etc/bigbluebutton/bbb-webrtc-sfu/production.yml mediasoup.plainRtp.listenIp.ip "0.0.0.0"
    • yq w -i /etc/bigbluebutton/bbb-webrtc-sfu/production.yml mediasoup.plainRtp.listenIp.announcedIp $SERVER_IPv4
  2. If you wish to enable IPv6 in mediasoup (otherwise skip to step 3):
    • Let $SERVER_IPv6 be your server's IPv6
    • yq w -i /etc/bigbluebutton/bbb-webrtc-sfu/production.yml mediasoup.webrtc.listenIps[1].ip $SERVER_IPv6
  3. Follow https://github.com/bigbluebutton/bigbluebutton/pull/13112 to control mediasoup usage per meeting (metadata) or server (settings.yml) and then sudo bbb-conf --restart
    • If you're going to use mediasoup server wide, we recommend running the following command as an optional optimization:
      • yq w -i /etc/bigbluebutton/bbb-html5.yml public.kurento.signalCandidates false

Using mediasoup in a development environment

  1. git clone https://github.com/bigbluebutton/bbb-webrtc-sfu.git
  2. npm install -D
  3. cp /usr/local/bigbluebutton/bbb-webrtc-sfu/config/default.yml <CLONE_DIR>/bbb-webrtc-sfu/config/
    • Or set up a new default.yml on your own if you know your way around it
  4. Set https://github.com/bigbluebutton/bbb-webrtc-sfu/blob/5835e76748ede4c328becf78d42c99fc3410f186/config/default.example.yml#L309-L310
    • Server: if NAT, listenIp: 0.0.0.0, announcedIp: pub-IP
    • Server: if ~NAT, listenIp: pub-IP
    • It's an array, so you can set an ip: <IPv6> entry as well
  5. https://github.com/bigbluebutton/bbb-webrtc-sfu/blob/5835e76748ede4c328becf78d42c99fc3410f186/config/default.example.yml#L329-L330
    • Same as step 4 but single stack (just used internally, listen only/mic interop stuff, so prefer IPv4)
  6. Instruct webrtc-sfu to load the mediasoup adapter: https://github.com/bigbluebutton/bbb-webrtc-sfu/blob/5835e76748ede4c328becf78d42c99fc3410f186/config/default.example.yml#L135-L139
    • Add a new entry: with path: mediasoup/mediasoup-adapter.js and name: mediasoup
  7. At bbb-html5's config:
  8. Steps 1-7 should get you ready to use mediasoup, but the default is still Kurento. Bring the system's webrtc-sfu down (systemctl stop bbb-webrtc-sfu), start your local clone (npm start).
  9. Follow https://github.com/bigbluebutton/bigbluebutton/pull/13112 to control mediasoup usage per meeting (metadata) or server (settings.yml)
Clone this wiki locally