GithubHelp home page GithubHelp logo

versatica / mediasoup Goto Github PK

View Code? Open in Web Editor NEW
5.9K 5.9K 1.1K 165.3 MB

Cutting Edge WebRTC Video Conferencing

Home Page: https://mediasoup.org

License: ISC License

Makefile 0.05% C++ 52.66% JavaScript 0.57% Python 0.90% Dockerfile 0.02% TypeScript 14.40% HTML 0.06% Rust 30.62% C 0.07% Shell 0.17% Meson 0.47%
c-plus-plus nodejs rust server-side sfu webrtc

mediasoup's Introduction

mediasoup v3

Website and Documentation

Support Forum

Design Goals

mediasoup and its client side libraries are designed to accomplish with the following goals:

  • Be a SFU (Selective Forwarding Unit).
  • Support both WebRTC and plain RTP input and output.
  • Be a Node.js module or Rust crate in server side.
  • Be a tiny TypeScript and C++ libraries in client side.
  • Be minimalist: just handle the media layer.
  • Be signaling agnostic: do not mandate any signaling protocol.
  • Be super low level API.
  • Support all existing WebRTC endpoints.
  • Enable integration with well known multimedia libraries/tools.

Architecture

Use Cases

mediasoup and its client side libraries provide a super low level API. They are intended to enable different use cases and scenarios, without any constraint or assumption. Some of these use cases are:

  • Group video chat applications.
  • One-to-many (or few-to-many) broadcasting applications in real-time.
  • RTP streaming.

Features

  • ECMAScript 6/Idiomatic Rust low level API.
  • Multi-stream: multiple audio/video streams over a single ICE + DTLS transport.
  • IPv6 ready.
  • ICE / DTLS / RTP / RTCP over UDP and TCP.
  • Simulcast and SVC support.
  • Congestion control.
  • Sender and receiver bandwidth estimation with spatial/temporal layers distribution algorithm.
  • Data message exchange (via WebRTC DataChannels, SCTP over plain UDP, and direct termination in Node.js/Rust).
  • Extremely powerful (media worker thread/subprocess coded in C++ on top of libuv).

Demo Online

Try it at v3demo.mediasoup.org (source code).

Authors

Social

Sponsor

You can support mediasoup by sponsoring it. Thanks!

License

ISC

mediasoup's People

Contributors

aankur avatar aggresss avatar arcinston avatar dependabot[bot] avatar dsdolzhenko avatar enimo avatar fippo avatar ggarber avatar gnauhtt avatar grootgordon avatar ibc avatar j1elo avatar jcague avatar jianxiamage avatar jmillan avatar jurshsmith avatar mstyura avatar nazar-pc avatar penguinol avatar piranna avatar remikalbe avatar saghul avatar satoren avatar smortex avatar stefansundin avatar stevemcfarlin avatar t-mullen avatar universeroc avatar vpalmisano avatar yangjinecho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mediasoup's Issues

Check Fingerprint value syntax

Currently mediasoup generates Fingerprint values in hexadecimal uppercase:

SHA-1   fingerprint: 11:BB:5F:BE:48:18:5A:6C:87:D2:55:5F:4D:88:3A:DB:25:84:50:6E +0ms
SHA-224 fingerprint: 87:06:5A:7E:9E:92:2A:F2:29:62:66:01:E2:BA:E1:5A:69:D8:DC:A8:F6:5B:8E:42:A3:17:ED:5B +0ms
SHA-256 fingerprint: B0:9E:7C:B9:9C:B8:79:BB:CC:9A:3C:C5:8C:06:73:D2:D8:F0:92:99:7A:D0:BA:3C:1A:09:FF:18:9D:ED:7F:D4 +0ms
SHA-384 fingerprint: E1:47:23:6A:C3:E5:F2:94:1E:E7:30:F2:9B:7E:F7:5C:A4:57:57:33:22:E9:56:02:0B:BB:15:D4:77:1D:A2:A9:2E:E7:DA:49:22:0E:99:65:5E:38:CD:8C:37:96:CC:34 +0ms
SHA-512 fingerprint: 26:14:BD:0E:4B:1B:BD:75:6D:FF:67:70:96:03:44:A3:1A:50:24:07:30:8B:A5:51:08:7A:6D:26:E3:EE:8D:51:11:CF:6E:BC:DC:A4:20:6A:07:BB:C8:4C:87:8C:75:AC:03:5D:67:A2:39:8B:19:91:F0:88:CB:74:AC:DE:E8:FF

However that is just the "SDP" syntax described by RFC 4572. As commented in ORTC there is no real reason for that:

w3c/ortc#315

Server as peer to process decoded video frames

Hey,

This looks like an awesome module. I'm about to dig in deep, but before I do, just want to make sure it can do what I'm hoping:

I'd like my Node server to act as a WebRTC peer and allow me to process decoded video frames in real time on the server.

Is it doable? Any pointers in the right direction? I've started reading through the code in mediasoup/test, but am still not quite sure where I might be able to get access to the video stream.

Thanks!

Set a proper license

People cannot take the risk of looking at your code unless you license it properly.

Revert RTCRtpCodecRtxParameters

In both WebRTC 1.0 and ORTC, RTX "codecs" (RFC 4588) are signaled as common codecs, so we must revert the RTCRtpCodecRtxParameters entry in RtpCodecParameters.

BUNDLE and payload values constraint

According to BUNDLE draft, if the same payload value appears more than twice in m= lines belonging to the same BUNDLE group, then those codecs MUST be the very same.

Not yet completely clear what would happen if the same transport is used to receive the same codec (payload, parameters, etc) from different participants (H264 video from Alice, from Bob, from Carol, etc).

Implement backpressure in TCP/UDP

libuv offers (now) public API to check the write/send queue size (in bytes). So:

  • Add a setter SetBackPressure(value).
  • When in Write() or Send() check if such a value is greater than the handle write/send queue.
  • If so call listener->onBackPressureExceeded(current_value).

Usage Example/Getting Started Documentation

What?

Readme needs a usage example for people interested in getting started with the package

Why?

Would love to test drive this package but it's lacking clear explanation of how to get started. Would be great if this could be added to the README or the website.

Note: The api documentation is great but not the best reference for getting started.

API to get peers certificate (how to create a Certificate in Node given a PEM)

In 85e698b I've added transport.dtlsRemoteCert which (once DTLS is connected) provides the peer's certificate in PEM format.

Example:

transport.on('dtlsstatechange', (dtlsState) =>
{
    if (dtlsState === 'connected')
        console.warn('remote certificate:\n%s', transport.dtlsRemoteCert);
});

This prints:

remote certificate:
-----BEGIN CERTIFICATE-----
MIIBmTCCAQKgAwIBAgIEAitymDANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAZX
ZWJSVEMwHhcNMTYwNTEwMTkyMTI4WhcNMTYwNjA5MTkyMTI4WjARMQ8wDQYDVQQD
DAZXZWJSVEMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANPh1C7jFo3lnWJh
flnueuC1HeSrurt3JHXxK7sYBB1+RNoeCBBPCSHwS51U253SRcCuChupCuZl4E4/
pUz0yzanR0HYQzFrL06KfLSwYoAf40LKKAfjNxSCfSgObRF4LAGs42pGa91U+iHt
Ct4jDGUPLVieDzJBXx3Q/DEHSN8rAgMBAAEwDQYJKoZIhvcNAQELBQADgYEAavSb
CHV+3+l0s+HbVw79bVYPjSBTUAdziaV48QBkxwoNjXmkGlmg59pfhCYytFYWmEHI
5UHX9u2Z5H2UWJ7gTw+Z4fHDZV7BOv8U0Zsz791Mm+1gMhzOV+FATpHLJbRl0GF/
NsSQw9h8tjGfsH3cALPYl88yRGy6GeplPLjcL4M=
-----END CERTIFICATE-----

This can be useful for the app to check the certificate and prove some kind of WebRTC identity mechanism and so on.

But... I need a way to create a crypto.Certificate instance in Node given a cert in PEM format, and I don't find how to do that... :(

it works !!!!!

i am testing the new webrtc api,

let peerconnection = mediasoup.webrtc(room,'alice',{}); 

will just stuck there.

create_parse_bye test fails in Linux

[18:11:21] worker/out/Debug/mediasoup-worker-test
minimum_header .................................................... PASS
buffer_is_too_small ............................................... PASS
version_is_zero ................................................... PASS
length_is_wrong ................................................... PASS
type_is_unknown ................................................... PASS
parse_sdes_chunk .................................................. PASS
create_sdes_chunk ................................................. PASS
parse_sender_report ............................................... PASS
create_sender_report .............................................. PASS
parse_receiver_report ............................................. PASS
create_receiver_report ............................................ PASS
create_parse_bye .................................................. FAIL ***
parse_rtpfb_nack_item ............................................. PASS
create_rtpfb_nack_item ............................................ PASS
parse_rtpfb_tmmb_item ............................................. PASS
parse_rtpfb_tllei_item ............................................ PASS
parse_rtpfb_ecn_item .............................................. PASS
parse_psfb_sli_item ............................................... PASS
parse_psfb_rpsi_item .............................................. PASS
parse_psfb_fir_item ............................................... PASS
parse_psfb_tst_item ............................................... PASS
parse_psfb_vbcm_item .............................................. PASS
parse_psfb_lei_item ............................................... PASS
parse_psfb_afb .................................................... PASS

----------------------------------------------------------------------------

FAILED TESTS


../test/test-rtcp.cpp(339):
    chq_eq_int: 2222 != 2222
../test/test-rtcp.cpp(352):
    chq_eq_int: 2222 != 2222

RtpReceiver.js: Add API to receive RTP packets

Add a setter into the RtpReceiver class than activates RTP reception via JS. This would allow:

  • Stream recording handled by the JS app.
  • Using the RTP somewhere else.

Initial proposal:

let rtpReceiver = peer.RtpReceiver(...);

rtpReceiver.listenForRtp = true;

rtpReceiver.on('rtp', (packet) =>
{
  // packet is a Node Buffer instance
  console.log('RTP packet received');
});

Better WebRTC API

  • Implement RTCRtpTransceiver object.
  • Better handling of Unified-Plan (Firefox) and Plan-B (Chrome).
  • Don't require sending audio+video initial SDP offer from the client. Instead:
    • Allow receiving initial SDP offer from client with just audio or video, and just in receive mode.
    • Allow mediasoup to generate the SDP offer for new clients.

NOTE: This may change, and probably will do. More in comments below.

Add announced IPv4/IPv6 settings

In AWS or Google Cloud, the host has private IP. However we need to announce a public IP address in the ICE candidates generated by mediasoup.

Implement simulcast

mediasoup must be ready to accept simulcast from clients and choose the appropriate simulcast profile to forward to other participants based on their network bandwidth or other parameters (such as selection via API).

I can't install mediasoup on ubuntu 14.04 lts

5901 verbose stack Error: [email protected] postinstall: make Release
5901 verbose stack Exit status 2
5901 verbose stack at EventEmitter. (/root/node-v7.2.1-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
5901 verbose stack at emitTwo (events.js:106:13)
5901 verbose stack at EventEmitter.emit (events.js:191:7)
5901 verbose stack at ChildProcess. (/root/node-v7.2.1-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
5901 verbose stack at emitTwo (events.js:106:13)
5901 verbose stack at ChildProcess.emit (events.js:191:7)
5901 verbose stack at maybeClose (internal/child_process.js:885:16)
5901 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
5902 verbose pkgid [email protected]

DTLS handshake fragmentation

https://tools.ietf.org/html/rfc6347#section-4.2.2

Solution in OpenSSL:

#define RTPPAYLOADSIZE 1350

// Disable automatic MTU discovery.
SSL_CTX_set_options(ssl_ctx, SSL_OP_NO_QUERY_MTU);

// Set MTU of datagrams so it fits in an UDP packet.
SSL_set_mtu(ssl, RTPPAYLOADSIZE);
// DTLS_set_link_mtu(ssl, MTU);   // ¿?¿?¿?
BIO_ctrl(write_bio, BIO_CTRL_DGRAM_SET_MTU, RTPPAYLOADSIZE, NULL);

Got errors when running npm install mediasoup --save

I got errors below when running npm install mediasoup --save

6293 error Linux 4.8.6-x86_64-linode78
6294 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mediasoup" "--save"
6295 error node v7.4.0
6296 error npm v4.0.5
6297 error code ELIFECYCLE
6298 error [email protected] postinstall: make Release
6298 error Exit status 2
6299 error Failed at the [email protected] postinstall script 'make Release'.
6299 error Make sure you have the latest version of node.js and npm installed.
6299 error If you do, this is most likely a problem with the mediasoup package,
6299 error not with npm itself.
6299 error Tell the author that this fails on your system:
6299 error make Release
6299 error You can get information on how to open an issue for this project with:
6299 error npm bugs mediasoup
6299 error Or if that isn't available, you can get their info via:
6299 error npm owner ls mediasoup
6299 error There is likely additional logging output above.

Check multi-stream related drafts

Drafts

Others

use case about mediasoup

hi,

mediasoup is a greate lib, and i can't wait to have a try.

my use case is that at least two publisher and tens of viewer in one room, can mediasoup be used like this?

Need a better Makefile and built-in dependencies

I don't want that MediaSoup depends on 3rd libraries globally installed (openssl, libsrtp, etc). Let's imitate the Node way (all the dependencies included in the source tree). And then use gyp or ninja or lalala.

/cc @saghul

Can I connect mediasoup with browser

I need browser client A push mediastream to mediasoup ,then mediasoup send the mediasteam to browser client B,but I can't connect mediasoup with browser. Broswer use ice-full ,but mediasoup use ice-lite,so,I don't know how to use ice-lite in brower.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.