webrtc-streamer构建指南

前提条件

准备好chromium/webrtc编译环境。详见:Chromium/WebRTC开发指南

在Windows中构建webrtc-streamer

  1. 配置环境变量
set CLANG_VERSION=ToT
set PYTHONIOENCODING=UTF-8
set MSVC_PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise"
set path=\paht\to\depot_tools\;\paht\to\webrtc\src\third_party\llvm-build\Release+Asserts\bin;\paht\to\webrtc\src\build\toolchain\win\rc\win;%path%
  1. 安装choco
// 在powershell管理员中执行
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
  1. 安装git python2 sed curl windows-sdk-10
choco install --no-progress -y git python2 sed curl windows-sdk-10
  1. 安装cmake
choco install --no-progress -y cmake --installargs 'ADD_CMAKE_TO_PATH=System'
  1. 安装vs2017编译环境
choco install --no-progress -y visualstudio2017buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Component.VC.ATLMFC --includeRecommended --nocache --installPath %MSVC_PATH%"
  1. 运行vs2017编译环境
call %MSVC_PATH%\VC\Auxiliary\Build\vcvars64.bat
  1. 获取源码
git clone --depth=1 https://github.com/mpromonet/webrtc-streamer.git
  1. 构建ninja项目
// 确保webrtc的目录为: ..\webrtc\src
cd webrtc-streamer
cmake -G Ninja -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe .
  1. 编译
ninja

在linux中构建webrtc-streamer

  1. 安装工具链&依赖库
apt-get update && apt-get install -y --no-install-recommends g++ autoconf automake libtool xz-utils libasound2-dev libgtk-3-dev cmake p7zip-full
  1. 获取源码
git clone --depth=1 https://github.com/mpromonet/webrtc-streamer.git
  1. 构建&编译
// 确保webrtc的目录为: ..\webrtc\src
cd webrtc-streamer
cmake . && make
//运行库
apt-get install -y --no-install-recommends libasound2 libgtk-3-0 libssl1.0

你可能感兴趣的:(webrtc)