0%

owt-server源码编译和部署

owt-server源码编译和部署

是什么

OWT的媒体服务器提供了一种高效的基于WebRTC的视频会议和流媒体服务。它将单个WebRTC流扩展到多个端点。同时,它为媒体流提供了媒体分析功能。它的特点:

  • 分布式、可扩展、可靠的SFU+MCU服务器
  • Intel®Core™和Intel®Xeon®处理器上的高性能VP8、VP9、H.264和HEVC实时转码
  • 广泛的流协议支持包括WebRTC, RTSP, RTMP, HLS, MPEG-DASH
  • 高效混合高清视频流,节省移动设备的带宽和电源
  • 智能服务质量(QoS)控制机制,以适应不同的网络环境
  • 客户定义的媒体分析插件,以执行分析流从MCU
  • 实时媒体流分析的使用场景,包括但不限于移动/对象检测

安装

环境部署

1
apt-get install sudo wget curl git make gcc-6 g++-6 libglib2.0-dev pkg-config libboost1.67-dev liblog4cxx-dev gyp libx11-dev libkrb5-dev intel-gpu-tools m4 autoconf libtool automake cmake libfreetype6-dev libgstreamer-plugins-base1.0-dev lsb-core net-tools

node安装

1
2
3
4
5
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
nvm use v8.15.0
node -v
npm i --unsafe-perm
npm --unsafe-perm=true --user=0 i

boost安装(不需要)

1
2
3
4
5
6
7
8
// sudo apt install libboost-all-dev
// sudo apt install libboost1.65-dev
dpkg -S /usr/include/boost/version.hpp
// wget https://dl.bintray.com/boostorg/release/xxxx.tar.gz
// cd boost_1_65_1
// sudo ./bootstrap.sh --with-toolset=gcc --with-python=python3.8
// sudo ./b2 install --prefix=/usr/local
// sudo ldconfig /usr/local/lib

gcc安装(编译webrtc需要)

1
2
3
4
5
sudo apt install gcc-6 g++-6
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 100
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 100
sudo update-alternatives —config python3

源码获取

1
2
3
4
5
6
7
8
git clone -b v4.3.1 https://github.com/open-webrtc-toolkit/owt-server.git
git clone -b v4.3.1 https://github.com/open-webrtc-toolkit/owt-client-javascript.git
cd owt-server
#下载依赖
./scripts/installDepsUnattended.sh
#执行编译
scripts/build.js -t all --check
scripts/pack.js -t all --install-module --app-path ${webrtc-javascript-sdk-sample-conference-dist}

开始使用

1
2
3
4
5
cd dist
./bin/init.sh --deps
./bin/start-all.sh
./bin/stop-all.sh
./bin/restart-all.sh

Q&A

1. sipLib.so => not found Something failed to build. Try nvm use v8.15.0 and rerun build.js. getRooms failed( 401 )

1
./managent_api/init.sh

2. 打包的过程中出现缺少quicIO.node的时候

1
2
3
4
change /master/source/agent/addons/quicIO/QuicTransport.cc line 74:
boost::shared_array<uint8_t> new_buffer;
to:
boost::shared_array < char > new_buffer;

3. source/agent/video/videoTranscoder/videoAnalyzer_sw/build/Release/videoAnalyzer-sw.node: undefined symbol: _ZN5boost6system16generic_categoryEv

1
boost 版本必须是1.6x

4. agent/addons/quicIO/build/Release/quicIO.node not exist

1
2
3
cd ./agent/addons/quicIO
node-gyp configure
node-gyp build

5. google浏览器证书问题

1
thisisunsafe 

6. error: ‘RTCPHeader’ does not name a type

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
vi source/agent/webrtc/webrtcLib/binding.gyp 
'erizo/src/erizo/lib',
'erizo/src/erizo/dtls',
'erizo/src/erizo/pipeline',
'erizo/src/erizo/rtp',
'erizo/src/erizo/thread',
'erizo/src/erizo/stats',
'../../../core/common',
'../../../core/owt_base',
'../../../core/rtc_adapter',
'../../../../third_party/webrtc/src',
# 改为:
'erizo/src/erizo/lib',
'erizo/src/erizo/dtls',
'erizo/src/erizo/pipeline',
'erizo/src/erizo/thread',
'erizo/src/erizo/stats',
'../../../core/common',
'erizo/src/erizo/rtp',
'../../../core/owt_base',
'../../../core/rtc_adapter',
'../../../../third_party/webrtc/src',

7. webrtc不能加入会议室

目前查看是由于webrtc的代码版本造成,使用这个即可。
git clone -b 59-server https://github.com/open-webrtc-toolkit/owt-deps-webrtc.git src

Docker安装

镜像获取

1
2
docker pull docker push xujavy/owt-server:v4.3.x
docker run -itd -p 3004:3004 -p 3300:3300 -p 8080:8080 -p 60000-60050:60000-60050/udp -v /home/owt:/home/owt --name owt-server:v4.3.x /bin/bash

配置文件修改

1
2
3
4
# vi /home/owt/webrtc_agent/agent.toml 
[webrtc] network_interfaces = [{name="eth0",replaced_ip_address="192.168.1.4"}]  # default: []
# vi /home/owt/portal/portal.toml [portal] ip_address = "192.168.1.4" #default: ""
cd /home/owt/&& ./bin/init-all.sh && ./bin/start-all.sh
原创技术分享,您的支持将鼓励我继续创作