新版 Mediasoup Windows 安装 编译
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 安装 编译的更多相关文章
- Boost下载安装编译配置使用指南(含Windows和Linux
理论上,本文适用于boost的各个版本,尤其是最新版本1.45.0:适用于各种C++编译器,如VC6.0(部分库不支持),VS2003,VS2005,VS2008,gcc,C++ Builder等.先 ...
- Boost下载安装编译配置使用指南(含Windows和Linux) .
理论上,本文适用于boost的各个版本,尤其是最新版本1.39.0:适用于各种C++编译器,如VC6.0(部分库不支持),VS2003,VS2005,VS2008,gcc,C++ Builder等.先 ...
- Windows下编译最新版ChezScheme
据说ChezScheme是最快的神级编译器,一秒钟几百万行,王垠说的2秒内编译自身绝不是夸张(看这里<揭秘Chez Scheme>,Scheme中文社区).ChezScheme由美国印第安 ...
- thrift在windows的编译/安装--c++版
前言: thrift是出于Facebook的rpc网络编程框架, 其对跨平台和多语言的支持优于google protobuf, 但thrift在java/c#语言上应用比较多, 资料也丰富, 在win ...
- FFMPEG在windows平台编译的详细过程,包括环境安装
下面开始: 由于FFMpeg是基于Linux开发的开源项目,源代码和Windows下最常见的Visual Studio提供的C/C++编译器不兼容,因此它不能使用MSVC++编译.要想使用FFMpeg ...
- windows下编译安装BOOST
boost的编译和使用,经过搜集资料和总结,记录成文.感谢文后所列参考资料的作者. 1 下载 地址:http://sourceforge.net/projects/boost/files/boost/ ...
- N2N windows下编译安装文件
n2n安装 n2n原理编译版下载,可直接使用:windows下vpn客户端 n2n_v2_linux_x64 n2n_v2_Win32TAP网卡驱动 #linux环境编译yum install -y ...
- Windows下编译安装 FFmpeg
在Linux/Mac下编译 ffmpeg是非常方便的.但要在 Windows下编译 ffmpeg还真要花点时间.以下就是在 Windowns下编译ffmpeg的步骤: 一.安装Cygwin 在wind ...
- RPC与实践(thrift在windows的编译/安装--c++版)
------------------------------------------------------------------------ RPC 功能目标 RPC 的主要功能目标是让构建分布式 ...
- windows下编译和安装boost库
boost是一个功能强大.构造精巧.跨平台.开源并且完全免费的C++程序库. 获取方式 boost提供源码形式的安装包,可以从boost官方网站下载,目前最新版本是1.59.0. 本机上正好有boos ...
随机推荐
- 获取Java运行环境信息
设备相关信息 获取设备名称 import java.net.InetAddress; import java.net.UnknownHostException; try { InetAddress l ...
- react框架-知识点(ref,, setState)
react的思想:无必要勿增实体 1. ref 使用 myRef = React.createRef() <input ref={this.myRef}></input> 2. ...
- 8.class 类
一.基础语法 class 类名 { } 二.类的属性 基础语法: class 类名 { 属性名: 数据类型 = 属性值; contructor(形参名: 数据类型) { this.属性名 = 属性值; ...
- HJ92 在字符串中找出连续最长的数字串
描述 输入一个字符串,返回其最长的数字子串,以及其长度.若有多个最长的数字子串,则将它们全部输出(按原字符串的相对位置) 本题含有多组样例输入. 输入描述: 输入一个字符串. 输出描述: 输出字符串中 ...
- OL3-Cesium 二三维鼠标事件统一处理
like the github issue: https://github.com/openlayers/ol3-cesium/issues/344#issuecomment-214098148 th ...
- CCF 201909-2 小明种苹果(续)
#include <iostream> #include <bits/stdc++.h> #include <string> using namespace std ...
- com.mysql.cj.jdbc.exceptions.CommunicationsException
mysql数据库链接空闲一段时间后就会关闭连接,但是我们的java程序依然持有该连接的引用,对已经关闭的数据库连接进行操作就会引发上述异常. 解决办法: 1.增大mysql数据库的wait_timeo ...
- TP开发项目时遇到的问题记录
1.下载功能. TP自带Http下载类,使用时new一个就行,示例代码: public function download(){ //接收公文id $id = I('get.fid'); //根据公文 ...
- (二)用go实现二叉查找树
本篇,我们用go简单的实现二叉查找树. 1.节点定义 type BSNode struct{ data int left, right, parent *BSNode } 2.前序遍历 func (p ...
- uniapp(1)
**在项目根目录中新建.gitignore忽略文件,并配置如下: 忽略 node_modules /node_modules /unpackage/dist** 添加页面 新建页面,而后选择scss模 ...