https://vc.feiyefeihua.top/

ps:视频测试demo,服务器配置很低,加载有点慢;需要有音视频设备,不然会报错。

关于官网文档

官网文档地址

只测试了 Windows 。讲的不是很清楚,文档内容有缺失,通过查询 issues 、官网讨论论坛 和 自我尝试,还好最终编译运行成功了。

官网文档关键点

所有平台需要环境

  • node version >= v12.0.0
  • python version >= 3.6 with PIP
  • GNU make

node 和 python 下载最新版本安装即可

node 没什么注意的

python 需要配置好环境变量并且删除系统自带的程序别名问题

系统用户环境变量里面有一个 %USERPROFILE%\AppData\Local\Microsoft\WindowsApps 这个文件夹里面有 python.exe 的快捷方式?会在安装 mediasoup 时导致 找不到 python pip 问题,进入 WindowsApps  文件夹把 python.exe  python3.exe...删除了就可以。

GNU make 也通过文档提供的地址下载,安装,然后 添加路径(*:\MinGW\msys\1.0\bin)到环境变量,只是安装的时候需要注意,需要安装完 make 会依赖到的所有包

最开始尝试只选中带 make 字段的包安装,在命令行 make -v 能正常弹出信息,但是尝试安装就会出错。具体是哪些不清楚...选了一大半,最后没问题了。

每次 MinGW Installer 下载安装包时,有可能会失败,失败了就可能导致最后 make 会出问题,所以需要关注一下,下载安装的log。

使用的 vscode 终端,make -v 可能没反应,就是有问题,用 cmd 命令行能弹出错误提示,总之, make 有问题就需要 通过 MinGW Installer 重新安装。

然后 Microsoft Visual Studio 可以在 官网下载 

安装配置时必须选上 使用 C++ 的桌面开发

然后添加环境变量,包含三个关键程序的路径:cl.exe、vcvars64.bat、MSBuild.exe

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64

具体路径和 Microsoft Visual Studio 版本有关系,大概位置不变。

最后下载文档里面的证书 安装到计算机上,选择安装到 当前用户 和 本地计算机时,可以两个都装起...

编译时具体环境

安装流程 npm install mediasoup@3 --save

一直使用 vscode 终端 卡了一个错误好久

Directory does not contain a valid build tree:
H:\workspace\mediasoup-demo-3\server\node_modules\mediasoup\worker\out\Release
The Meson build system
Version: 0.60.2
Source dir: H:\workspace\mediasoup-demo-3\server\node_modules\mediasoup\worker
Build dir: H:\workspace\mediasoup-demo-3\server\node_modules\mediasoup\worker\out\Release
Build type: native build
Project name: mediasoup-worker
Project version: undefined meson.build:1:0: ERROR: Compiler cl can not compile programs.

Compiler cl can not compile programs ,让人崩溃。

这个有一个前提 需要提前运行一下  vcvars64 ,并且还有一点区别

默认新开终端是 PowerShell ,此时需要完整执行

cmd /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%/vcvars.txt"

Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}

然后再 npm install mediasoup

如果是选择 cmd ,则只需要  vcvars64 回车一下就好 。

此时应该都能进入正常流程,下载所需要的依赖、然后编译 mediasoup 的关键底层服务。

下载的时候很容易就会出错,导致安装失败

http.client.RemoteDisconnected: Remote end closed connection without response
make: *** [setup] 错误 2

Remote end closed connection without response ,下载每个包都可能这样,如果网络没问题(vpn、番蔷),全部下载成功,即可进入编译,最后安装成功。

PowerShell

PS H:\workspace\edumeet-master\server> cmd /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%/vcvars.txt"
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.41
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
PS H:\workspace\edumeet-master\server>
PS H:\workspace\edumeet-master\server> Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
>> if ($_ -match "^(.*?)=(.*)$") {
>> Set-Content "env:\$($matches[1])" $matches[2]
>> }
>> }
PS H:\workspace\edumeet-master\server> npm install mediasoup@3 --save > mediasoup@3.9.2 postinstall H:\workspace\edumeet-master\server\node_modules\mediasoup
> node npm-scripts.js postinstall npm-scripts.js [INFO] running task "postinstall"
npm-scripts.js [INFO] executing command: node npm-scripts.js worker:build
npm-scripts.js [INFO] running task "worker:build"
npm-scripts.js [INFO] executing command: make -C worker
make: Entering directory `/h/workspace/edumeet-master/server/node_modules/mediasoup/worker'
# Updated pip and setuptools are needed for meson
# `--system` is not present everywhere and is only needed as workaround for
# Debian-specific issue (copied from
# https://github.com/gluster/gstatus/pull/33), fallback to command without
# `--system` if the first one fails.
python -m pip install --system --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
python -m pip install --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package" Usage:
h:\Program Files\Python310\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
h:\Program Files\Python310\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
h:\Program Files\Python310\python.exe -m pip install [options] [-e] <vcs project url> ...
h:\Program Files\Python310\python.exe -m pip install [options] [-e] <local project path> ...
h:\Program Files\Python310\python.exe -m pip install [options] <archive url/path> ... no such option: --system
Collecting pip
Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting setuptools
Using cached setuptools-59.2.0-py3-none-any.whl (952 kB)
Installing collected packages: setuptools, pip
Successfully installed pip-21.3.1 setuptools-59.2.0
# Install `meson` and `ninja` using `pip` into custom location, so we don't
# depend on system-wide installation.
python -m pip install --upgrade --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip meson ninja
Collecting meson
Using cached meson-0.60.2-py3-none-any.whl (838 kB)
Collecting ninja
Using cached ninja-1.10.2.3-py2.py3-none-win_amd64.whl (292 kB)
Installing collected packages: ninja, meson
Successfully installed meson-0.60.2 ninja-1.10.2.3
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
--buildtype release \
-Db_ndebug=true \
-Db_pie=true \
-Db_staticpic=true \
--reconfigure \
"" \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/Release || \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
--buildtype release \
-Db_ndebug=true \
-Db_pie=true \
-Db_staticpic=true \
"" \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/Release
Directory does not contain a valid build tree:
H:\workspace\edumeet-master\server\node_modules\mediasoup\worker\out\Release
The Meson build system
Version: 0.60.2
Source dir: H:\workspace\edumeet-master\server\node_modules\mediasoup\worker
Build dir: H:\workspace\edumeet-master\server\node_modules\mediasoup\worker\out\Release
Build type: native build
Project name: mediasoup-worker
Project version: undefined
C compiler for the host machine: cl (msvc 19.16.27045 "���� x64 �� Microsoft (R) C/C++ �Ż������� 19.16.27045 ��")
C linker for the host machine: link link 14.16.27045.0
C++ compiler for the host machine: cl (msvc 19.16.27045 "���� x64 �� Microsoft (R) C/C++ �Ż������� 19.16.27045 ��")
C++ linker for the host machine: link link 14.16.27045.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Downloading openssl source from https://www.openssl.org/source/openssl-1.1.1l.tar.gz
Download size: 9834044
Downloading: ..........
Downloading openssl patch from https://wrapdb.mesonbuild.com/v2/openssl_1.1.1l-2/get_patch
Download size: 10613607
Downloading: .

Command Prompt

H:\workspace\edumeet-master\server>vcvars64
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.41
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64' H:\workspace\edumeet-master\server>npm install mediasoup > mediasoup@3.9.2 postinstall H:\workspace\edumeet-master\server\node_modules\mediasoup
> node npm-scripts.js postinstall npm-scripts.js [INFO] running task "postinstall"
npm-scripts.js [INFO] executing command: node npm-scripts.js worker:build
npm-scripts.js [INFO] running task "worker:build"
npm-scripts.js [INFO] executing command: make -C worker
make: Entering directory `/h/workspace/edumeet-master/server/node_modules/mediasoup/worker'
# Updated pip and setuptools are needed for meson
# `--system` is not present everywhere and is only needed as workaround for
# Debian-specific issue (copied from
# https://github.com/gluster/gstatus/pull/33), fallback to command without
# `--system` if the first one fails.
python -m pip install --system --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
python -m pip install --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip pip setuptools || \
echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package" Usage:
h:\Program Files\Python310\python.exe -m pip install [options] <requirement specifier> [package-index-options] ...
h:\Program Files\Python310\python.exe -m pip install [options] -r <requirements file> [package-index-options] ...
h:\Program Files\Python310\python.exe -m pip install [options] [-e] <vcs project url> ...
h:\Program Files\Python310\python.exe -m pip install [options] [-e] <local project path> ...
h:\Program Files\Python310\python.exe -m pip install [options] <archive url/path> ... no such option: --system
Collecting pip
Using cached pip-21.3.1-py3-none-any.whl (1.7 MB)
Collecting setuptools
Using cached setuptools-59.2.0-py3-none-any.whl (952 kB)
Installing collected packages: setuptools, pip
Successfully installed pip-21.3.1 setuptools-59.2.0
# Install `meson` and `ninja` using `pip` into custom location, so we don't
# depend on system-wide installation.
python -m pip install --upgrade --target=/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip meson ninja
Collecting meson
Using cached meson-0.60.2-py3-none-any.whl (838 kB)
Collecting ninja
Using cached ninja-1.10.2.3-py2.py3-none-win_amd64.whl (292 kB)
Installing collected packages: ninja, meson
Successfully installed meson-0.60.2 ninja-1.10.2.3
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
--buildtype release \
-Db_ndebug=true \
-Db_pie=true \
-Db_staticpic=true \
--reconfigure \
"" \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/Release || \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/pip/bin/meson setup \
--buildtype release \
-Db_ndebug=true \
-Db_pie=true \
-Db_staticpic=true \
"" \
/h/workspace/edumeet-master/server/node_modules/mediasoup/worker/out/Release
Directory does not contain a valid build tree:
H:\workspace\edumeet-master\server\node_modules\mediasoup\worker\out\Release
The Meson build system
Version: 0.60.2
Source dir: H:\workspace\edumeet-master\server\node_modules\mediasoup\worker
Build dir: H:\workspace\edumeet-master\server\node_modules\mediasoup\worker\out\Release
Build type: native build
Project name: mediasoup-worker
Project version: undefined
C compiler for the host machine: cl (msvc 19.16.27045 "���� x64 �� Microsoft (R) C/C++ �Ż������� 19.16.27045 ��")
C linker for the host machine: link link 14.16.27045.0
C++ compiler for the host machine: cl (msvc 19.16.27045 "���� x64 �� Microsoft (R) C/C++ �Ż������� 19.16.27045 ��")
C++ linker for the host machine: link link 14.16.27045.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Downloading openssl source from https://www.openssl.org/source/openssl-1.1.1l.tar.gz
Download size: 9834044
Downloading: ...

PS:此时如果指定安装旧一点版本的 mediasoup ,比如 3.5.14 还会失败...不久之前更改了编译方案的原因,旧的需要改配置。

新版 Mediasoup Windows 安装 编译的更多相关文章

  1. Boost下载安装编译配置使用指南(含Windows和Linux

    理论上,本文适用于boost的各个版本,尤其是最新版本1.45.0:适用于各种C++编译器,如VC6.0(部分库不支持),VS2003,VS2005,VS2008,gcc,C++ Builder等.先 ...

  2. Boost下载安装编译配置使用指南(含Windows和Linux) .

    理论上,本文适用于boost的各个版本,尤其是最新版本1.39.0:适用于各种C++编译器,如VC6.0(部分库不支持),VS2003,VS2005,VS2008,gcc,C++ Builder等.先 ...

  3. Windows下编译最新版ChezScheme

    据说ChezScheme是最快的神级编译器,一秒钟几百万行,王垠说的2秒内编译自身绝不是夸张(看这里<揭秘Chez Scheme>,Scheme中文社区).ChezScheme由美国印第安 ...

  4. thrift在windows的编译/安装--c++版

    前言: thrift是出于Facebook的rpc网络编程框架, 其对跨平台和多语言的支持优于google protobuf, 但thrift在java/c#语言上应用比较多, 资料也丰富, 在win ...

  5. FFMPEG在windows平台编译的详细过程,包括环境安装

    下面开始: 由于FFMpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译.要想使用FFMpeg ...

  6. windows下编译安装BOOST

    boost的编译和使用,经过搜集资料和总结,记录成文.感谢文后所列参考资料的作者. 1 下载 地址:http://sourceforge.net/projects/boost/files/boost/ ...

  7. N2N windows下编译安装文件

    n2n安装 n2n原理编译版下载,可直接使用:windows下vpn客户端 n2n_v2_linux_x64 n2n_v2_Win32TAP网卡驱动 #linux环境编译yum install -y ...

  8. Windows下编译安装 FFmpeg

    在Linux/Mac下编译 ffmpeg是非常方便的.但要在 Windows下编译 ffmpeg还真要花点时间.以下就是在 Windowns下编译ffmpeg的步骤: 一.安装Cygwin 在wind ...

  9. RPC与实践(thrift在windows的编译/安装--c++版)

    ------------------------------------------------------------------------ RPC 功能目标 RPC 的主要功能目标是让构建分布式 ...

  10. windows下编译和安装boost库

    boost是一个功能强大.构造精巧.跨平台.开源并且完全免费的C++程序库. 获取方式 boost提供源码形式的安装包,可以从boost官方网站下载,目前最新版本是1.59.0. 本机上正好有boos ...

随机推荐

  1. Qt控件installEventFilter后不显示了

    原因是在eventFilter函数内return true了,就不会在执行paint事件了,将return true改为return false即可.

  2. 收缩SqlServer数据库日志语句

    收缩SqlServer数据库日志SQL语句 USE[master] ALTER DATABASE XXX SET RECOVERY SIMPLE WITH NO_WAIT ALTER DATABASE ...

  3. 【面试】TCP-IP经典

    整理之前的笔记,发现网络通信通俗易懂的解释. 搞清这15个问题,那你就精通了TCP! 网络协议那么多, 为什么面试喜欢问TCP? 原因无外乎两个: TCP协议直接与进程打交道,写网络程序要用: TCP ...

  4. C - Perform the Combo

    C - Perform the Combo 思路:当读到这个题的时候,第一反应就是枚举,但是,无线超时,没办法,那就变,利用前缀和,减少时间. 代码: #include<iostream> ...

  5. transform2d转换、transition过渡、animation动画效果、@keyframes定义动画关键帧

    transform:translate( 0 , 0 ); -ms-transform:translate( 0 , 0 ); /* IE 9 */ -webkit-transform:transla ...

  6. java开发常用软件下载

    1.idea工具下载:https://www.jetbrains.com/idea/download/#section=windows 2.dbeaver下载:https://dbeaver.io  ...

  7. uni-app初使用

    关于样式 rpx(responsive pixel): 可以根据屏幕宽度进行自适应.规定屏幕宽为750rpx.如在 iPhone6 上,屏幕宽度为375px,共有750个物理像素,则750rpx = ...

  8. 51电子-STC89C51开发板:安装驱动

    全部内容请点击目录列表查看: 51电子-STC89C51开发板:<目录> ---------------------------  正文开始  ---------------------- ...

  9. Mybatis二级缓存(1)

  10. 【GNU/Linux, Debian】使用cups连接HP Laserjet 1012 HB打印机

    woc我怎么第一版打的cpus Cups是个开源的打印软件,于2007年被苹果收购(包括作者负责人也被苹果雇佣),收购后任然使用GPL发行. 然而2021年年底,作为收购前负责人的他表示这个软件再也不 ...