Install mediasoup via NPM within your Node.js application:
$ npm install mediasoup@3
During the installation process, the mediasoup NPM package will try to fetch a prebuilt mediasoup-worker binary appropriate for current platform and architecture. If not found, it will locally build the mediasoup-worker binary.
git+ssh(instead of via
npm), and if “MEDIASOUP_FORCE_WORKER_PREBUILT_DOWNLOAD” environment variable is not set, the installation process won't attempt to fetch any prebuilt mediasoup-worker binary and it will build it locally instead.
MEDIASOUP_SKIP_WORKER_PREBUILT_DOWNLOAD="true" npm install mediasoup@3
MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" npm install mediasoup@3 MEDIASOUP_WORKER_BIN="/home/xxx/src/foo/mediasoup-worker" node myapp.js
In order to build the mediasoup C/C++ components the following packages and libraries must be available in the target host:
g++>= 8 or
clang(with C++17 support)
c++commands (symlinks) pointing to the corresponding
python3-pipDEB package, otherwise PIP package manager might be unavailable.
build-essentialDEB package. It includes
yum groupinstall "Development Tools".
If there is neither
python command pointing to Python 3 executable, set the
PYTHON environment variable during mediasoup installation:
$ PYTHON=python3.9 npm install mediasoup@3
MEDIASOUP_MAX_CORES environment variable is set, the build process will use that number of CPU cores. Otherwise, it will auto-detect the number of cores in the machine.