Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
mediasoup
Powerful WebRTC SFU for Node.js
IÑAKI BAZ CAS
SOMETHING ABOUT IT
WHAT IS MEDIASOUP?
A WebRTC SFU “Selective Forwarding Unit”
▸Handles the media layer
▸Doesn’t mix audio...
TOPOLOGIES
MULTI-PARTY VIDEO CONFERENCING
TOPOLOGIES
FULL MESH
▸ Each participant sends his audio and
video to all other participants
▸ Each participant receives al...
TOPOLOGIES
MCU: MULTIPOINT
CONTROL UNIT
▸ Each participant sends his streams to a media
server
▸ The server mixes all the ...
TOPOLOGIES
SFU: SELECTIVE
FORWARDING UNIT
▸ Participant sends his streams to a media server
▸ The media server routes the ...
TOPOLOGIES
FULL MESH MCU SFU
Client uplink Very high Low Low
Client downlink Very high Low High
Client CPU usage Very high...
MEDIASOUP
IS AN SFU
YES!
MEDIASOUP
IS
MINIMALIST
MEDIASOUP IS MINIMALIST
WHAT IS *NOT* MEDIASOUP?
▸It is NOT a standalone server
▸It does NOT have “init” scripts for Debia...
MEDIASOUP IS A
NODE.JS MODULE
Yours truly
REMEMBER
SO
WHAT?
OK…
$ npm install —save mediasoup
MEDIASOUP & NODE.JS
A NODE.JS MODULE
▸A Node.js module is a dependency/library within a proj...
MEDIASOUP & NODE.JS
A PACKAGE.JSON EXAMPLE
{
"name": "my-amazing-multiconference-server-app",
"version": "1.0.0",
"descrip...
WHY NODE.JS?
ASK THEM
MEDIASOUP
EXPOSES A
JAVASCRIPT
// Load mediasoup module
const mediasoup = require('mediasoup');
// Create a mediasoup Serv...
MEDIASOUP API
LOW LEVEL API
mediasoup exposes a low level API similar to ORTC
// Create a Peer
let peer = room.Peer('alice...
MEDIASOUP API
HIGH LEVEL API
mediasoup also exposes a high level API similar to WebRTC 1.0
// Create a PeerConnection
let ...
MEDIASOUP JUST
FORWARDS MEDIA
REMEMBER
Sincerely yours
MEDIASOUP API
JUST MEDIA
▸mediasoup does NOT talk the SIP protocol
▸…nor it talks ANY signaling protocol
▸You can use sock...
ROADM
AP
MEDIASOUP ROADMAP
WORKING ON IT…
1.0.0
▸RTCP: process RTCP reports to allow mediasoup
diagnose per peer uplink/downlink is...
YOUR TURN
THE
THE APPLICATION
ASK YOURSELF
▸ Want to build yet another boring
enterprise conferencing app?
▸ May be a funny social app?
...
LET’S DEMO !!!
DEMO APPLICATION
FIRSTSIGHT
“See many people, only talk to one”
Backend
▸Node.js server running mediasoup and websocket mo...
MUCHAS GRACIAS
Iñaki Baz Castillo
THE END
http://mediasoup.org
Próxima SlideShare
Cargando en…5
×

[ElastixWorld 2016] mediasoup: Powerful WebRTC SFU for Node.js

1.291 visualizaciones

Publicado el

My speech at ElastixWorld 2016 in Buenos Aires about mediasoup.

Publicado en: Tecnología
  • Sé el primero en comentar

[ElastixWorld 2016] mediasoup: Powerful WebRTC SFU for Node.js

  1. 1. mediasoup Powerful WebRTC SFU for Node.js IÑAKI BAZ CAS
  2. 2. SOMETHING ABOUT IT WHAT IS MEDIASOUP? A WebRTC SFU “Selective Forwarding Unit” ▸Handles the media layer ▸Doesn’t mix audio/video streams ▸Routes streams to participants A multi-party video solution for Node.js ▸Not a standalone media server ▸A server-side Node.js module ▸Exposes a JavaScript ES6 API ▸Core written in C++
  3. 3. TOPOLOGIES MULTI-PARTY VIDEO CONFERENCING
  4. 4. TOPOLOGIES FULL MESH ▸ Each participant sends his audio and video to all other participants ▸ Each participant receives all the streams from all other participants No media server needed Low latency Lot of encodings in each participant High uplink bandwidth required
  5. 5. TOPOLOGIES MCU: MULTIPOINT CONTROL UNIT ▸ Each participant sends his streams to a media server ▸ The server mixes all the streams and composes a single one ▸ Example: Asterisk meetme Simple at client side: single audio/video mixed stream from the server Interoperability: the server can transcode Low bandwidth required CPU expensive decoding/encoding in server side (high latency) Non flexible client side applications
  6. 6. TOPOLOGIES SFU: SELECTIVE FORWARDING UNIT ▸ Participant sends his streams to a media server ▸ The media server routes the streams to all other participants ▸ …or selects which ones to route ▸ Each participant receives many streams High throughput, low latency Low CPU usage at server side (no decoding/encoding) Good uplink bandwidth usage The client side application can render each remote video stream as desired Simulcast/SVC required for real scenarios
  7. 7. TOPOLOGIES FULL MESH MCU SFU Client uplink Very high Low Low Client downlink Very high Low High Client CPU usage Very high Low Medium Server CPU usage - Very high Very low Latency None High Low Can transcode - Yes No Requires simulcast/SVC - - Yes Flexible video layout Yes No Yes
  8. 8. MEDIASOUP IS AN SFU YES!
  9. 9. MEDIASOUP IS MINIMALIST
  10. 10. MEDIASOUP IS MINIMALIST WHAT IS *NOT* MEDIASOUP? ▸It is NOT a standalone server ▸It does NOT have “init” scripts for Debian or CentOS ▸It does NOT have a “config” file ▸It does NOT implement the SIP protocol ▸It does NOT implement ANY signaling protocol ▸It does NOT provide an “admin” web interface ▸It does NOT provide a client SDK
  11. 11. MEDIASOUP IS A NODE.JS MODULE Yours truly REMEMBER
  12. 12. SO WHAT? OK…
  13. 13. $ npm install —save mediasoup MEDIASOUP & NODE.JS A NODE.JS MODULE ▸A Node.js module is a dependency/library within a project ▸You create your Node.js based project/application ▸You add mediasoup as a module into it
  14. 14. MEDIASOUP & NODE.JS A PACKAGE.JSON EXAMPLE { "name": "my-amazing-multiconference-server-app", "version": "1.0.0", "description": "Enterprise conferencing application", "main": "index.js", "author": "My Great Company", "license": "UNLICENSED", "dependencies": { "express": "^4.14.0", "mediasoup": "^1.0.0", "socket.io": "^1.5.0" } }
  15. 15. WHY NODE.JS? ASK THEM
  16. 16. MEDIASOUP EXPOSES A JAVASCRIPT // Load mediasoup module const mediasoup = require('mediasoup'); // Create a mediasoup Server let server = mediasoup.Server(); // Options for the mediasoup Room const roomOptions = { mediaCodecs: [ { kind : 'audio', name : 'audio/opus', clockRate : 48000 }, { kind : 'video', name : 'video/vp8', clockRate : 90000 } ] }; // Create a mediasoup Room server.createRoom(roomOptions) .then((room) => { // Got the Room instance handleRoom(room); });
  17. 17. MEDIASOUP API LOW LEVEL API mediasoup exposes a low level API similar to ORTC // Create a Peer let peer = room.Peer('alice'); // Create a ICE+DTLS Transport peer.createTransport(options) .then((transport) => { transport.setRemoteDtlsParameters(data); }); // Create a RtpReceiver to handle audio from the browser let audioReceiver = peer.RtpReceiver('audio', transport); // Create a RtpReceiver to handle video from the browser let videoReceiver = peer.RtpReceiver('video', transport);
  18. 18. MEDIASOUP API HIGH LEVEL API mediasoup also exposes a high level API similar to WebRTC 1.0 // Create a PeerConnection let peerconnection = new mediasoup.webrtc.RTCPeerConnection(room, 'alice'); // Set the remote SDP offer peerconnection.setRemoteDescription(desc) .then(() => { return peerconnection.createAnswer(); }) .then((desc) => { return peerconnection.setLocalDescription(desc); }) .then(() => { // Answer the participant request with the SDP answer request.accept({ sdp: peerconnection.localDescription.sdp }); });
  19. 19. MEDIASOUP JUST FORWARDS MEDIA REMEMBER Sincerely yours
  20. 20. MEDIASOUP API JUST MEDIA ▸mediasoup does NOT talk the SIP protocol ▸…nor it talks ANY signaling protocol ▸You can use socket.io (for example) to communicate with browsers/endpoints via WebSocket ▸…or build your own protocol
  21. 21. ROADM AP
  22. 22. MEDIASOUP ROADMAP WORKING ON IT… 1.0.0 ▸RTCP: process RTCP reports to allow mediasoup diagnose per peer uplink/downlink issues ▸WebRTC 1.0: more API needed 2.0.0 ▸Simulcast & SVC: handle multiple streams/layers from clients and select which one to route to others
  23. 23. YOUR TURN THE
  24. 24. THE APPLICATION ASK YOURSELF ▸ Want to build yet another boring enterprise conferencing app? ▸ May be a funny social app? ▸ Will you build the app on Node.js? ▸ Browser app? mobile app? native Android/iOS SDKs? ▸ Do you need interoperability with PSTN? Really?
  25. 25. LET’S DEMO !!!
  26. 26. DEMO APPLICATION FIRSTSIGHT “See many people, only talk to one” Backend ▸Node.js server running mediasoup and websocket modules ▸JS logic to handle media rooms and manage participants Frontend ▸HTML5 application made with React.js ▸JS logic to handle MediaStream from room participants
  27. 27. MUCHAS GRACIAS Iñaki Baz Castillo THE END http://mediasoup.org

×