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/out/Release path).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:
Python is only required if no prebuilt mediasoup-worker binary was fetched.
gcc and g++ >= 8 or clang (with C++17 support)cc and c++ commands (symlinks) pointing to the corresponding gcc/g++ or clang/clang++ executablespython3-pip DEB package, otherwise PIP package manager might be unavailable.build-essential DEB package. It includes gcc/g++.yum groupinstall "Development Tools".linux-headers package must be installed, otherwise abseil-cpp C++ subproject fails to build due to “linux/futex.h: No such file or directory”.If there is neither python3 nor python command pointing to Python 3 executable, set the PYTHON environment variable during mediasoup installation:
$ PYTHON=python3.9 npm install mediasoup@3
If the 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.