Compiling and installing the mediasoup-demo of the video conference software EasyRTC-SFU on Windows

For the development of the EasyRTC video conferencing system, our research and development partners have really worked hard during this period. Fortunately, the final result is good, all the problems encountered have been solved one by one, and through the investigation of different RTC services, we are constantly optimizing Our EasyRTC.

RTC.png

For example, during the development of EasyRTC-SFU, we investigated various common WebRTC servers and compared the pros and cons of various WebRTC servers. Among them, the recently more popular mediasoup WebRTC server was also investigated. During the investigation, it was found that few people successfully run the mediasoup-demo program on Windows, and even some programmers think that mediasoup-demo cannot be successfully run on Windows, so they will share their experience of successfully running mediasoup-demo on Windows .

1. Environmental preparation

Windows10 operating system
node v10.19.0 (the official website requires >= v8.6.0)
npm-v6.13.4
git-v2.1.10
python-v2.7.17 (not python3)
visual studio v2017 and above (the official website requires 2015 or above, the author is the most I started to try VS2015, and met that the constexpr keyword is not supported. This keyword is supported in VS2015, but if the version is lower, this keyword will not be supported, so please use VS2017 at least), I used VS2019.

Set npm download mirror site as Taobao mirror
npm config set registry https://registry.npm.taobao.org
Note: Please do not use cnpm
to add MSBuild.exe of VS2017 to Path.
My path is D:\Develop\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin.
New environment variable GYP_MSVS_VERSION, the value is 2019. If you are using VS2017, just write 2017. The corresponding MSBuild.exe needs to use the VS2017 path. Otherwise, errors will occur.

2. Download the source code

Github is more difficult to access. You can use the synchronized project in gitee. The project address is: https://gitee.com/xunxinyuan/mediasoup-demo.git
$ git clone https://github.com/versatica/mediasoup-demo .git
$ cd mediasoup-demo
$ git checkout v3
Currently this project should not be updated, so there is no need to switch to v3, the default is v3 version.

3. Install dependencies and compile

Go to the server folder and open the package.json file. Modify line 22 to "mediasoup": "^3.6.16",

If you do not modify this line, the mediasoup-v3 version of the dependency will be downloaded from github, otherwise it will be super slow. After modification, it will be downloaded directly from npm's mirror source to speed up.
Run npm install

The error in the figure below will appear during operation. Don't worry about it. Mediasoup depends on clang-tools-tutorial, which is mainly used in Linux and MacOS, but not in Windows.

4. Modify the server configuration file

  1. Copy config.example.js and modify it to config.js
  2. Add a new certs folder under the server folder, and put your own public key certificate and private key certificate into it. Modify the configuration of config.js. cert is a public certificate, and key is a private certificate.

You can refer to this link to generate a certificate. It can also be generated using openssl.
https://blog.csdn.net/xiejiashu/article/details/86714141
3. Modify all ip and announcedIp to be the native IP. If the internal and public networks are inconsistent, the announcedIP is set to the public IP.

5. Compile and install the client

Enter the mediasoup-demo/app folder, and run the following command to
modify the .eslintrc.js file, which was originally unix, modified to windows

Run the following command:

npm install -g gulp-cli
npm install

6. Run the server

Enter the server folder and run the command line to set temporary environment variables

set DEBUG=${DEBUG:='*mediasoup* *INFO* *WARN* *ERROR*'} INTERACTIVE=${INTERACTIVE:='true'}

Run the server: node server.js
can also run node server.js directly without setting environment variables

7. Run the client

Enter the app folder and run the command line window

gulp live 

The browser will open automatically, or you can enter https://locahost:3000/ in the browser.

About EasyRTC

The development process of the EasyRTC-SFU version, we will also share the development process of the MCU version with you in the later stage, you can follow us. Of course, users who are already using EasyRTC, if they encounter any problems, are welcome to communicate with us to solve them.

EasyRTC.png

EasyRTC can not only support enterprise remote video conferencing, but also successfully used in customs inspections , outdoor surveys , engineering field operations and other scenarios. There are more use scenarios waiting for us to discover, and we will continue to optimize to obtain Better user experience. If you want to learn more about video solutions, welcome to visit TSINGSEE Qingxi Video .

Guess you like

Origin blog.csdn.net/TsingSee/article/details/108618054