Linux下WebRTC框架Janus编译过程

发布时间 2023-10-30 14:50:50作者: 阿风小子

说明
Janus是一个开源的WebRTC服务,由Meetecho设计和开发。该服务目前只支持Linux系统,或者MacOS,不支持Windows系统,如果要在Windows下编译和使用,需要WSL。

编译依赖
基本依赖


​ ​libnice​​ (at least v0.1.16 suggested, master recommended)
​ ​OpenSSL​​ (at least v1.0.1e)
​ ​libsrtp​​ (at least v1.5 suggested)
​ ​usrsctp​​ (only needed if you are interested in Data Channels)
​ ​libmicrohttpd​​ (at least v0.9.59; only needed if you are interested in REST support for the Janus API)
​ ​libwebsockets​​ (only needed if you are interested in WebSockets support for the Janus API)
​ ​cmake​​ (only needed if you are interested in WebSockets and/or BoringSSL support, as they make use of it)
​ ​rabbitmq-c​​ (only needed if you are interested in RabbitMQ support for the Janus API or events)
​ ​paho.mqtt.c​​ (only needed if you are interested in MQTT support for the Janus API or events)
​ ​nanomsg​​ (only needed if you are interested in Nanomsg support for the Janus API)
​ ​libcurl​​ (only needed if you are interested in the TURN REST API support)
一些插件的依赖

​ ​Sofia-SIP​​ (only needed for the SIP plugin)
​ ​libopus​​ (only needed for the bridge plugin)
​ ​libogg​​ (needed for the voicemail plugin and/or post-processor)
​ ​libcurl​​ (only needed if you are interested in RTSP support in the Streaming plugin or in the sample Event Handler plugin)
​ ​Lua​​ (only needed for the Lua plugin)

此外,您还需要以下库和工具

​ ​GLib​​
​ ​zlib​​
​ ​pkg-config​​
​ ​gengetopt​​

安装依赖
CentOS
yum install libmicrohttpd-devel jansson-devel \
   openssl-devel libsrtp-devel sofia-sip-devel glib2-devel \
   opus-devel libogg-devel libcurl-devel pkgconfig gengetopt \
   libconfig-devel libtool autoconf automake

Ubuntu
使用aptitude进行安装,会自动安装相关依赖

aptitude install libmicrohttpd-dev libjansson-dev \
  libssl-dev libsrtp-dev libsofia-sip-ua-dev libglib2.0-dev \
  libopus-dev libogg-dev libcurl4-openssl-dev liblua5.3-dev \
  libconfig-dev pkg-config gengetopt libtool automake

其他安装依赖

Doxygen
Graphviz

编译过程
git clone https://github.com/meetecho/janus-gateway.git
cd janus-gateway
sh autogen.sh
./configure --prefix=/opt/janus
make
make install
make configs

执行完步骤后默认会在/opt/janus下生成整个工程的可执行文件及配置。

可执行文件janus在/opt/janus/bin下面。