是否可能配置PJSIP (PJSUA2)使用OPUS编解码器?
我最终找到了一种方法(适用于 Ubuntu 14.04,要求 PJSIP >= 2.5):
Install opus@1.1.2 from source using following commands:
$ curl -sO http://downloads.xiph.org/releases/opus/opus-1.1.2.tar.gz
$ tar xzvf opus-1.1.2.tar.gz \
&& rm opus-1.1.2.tar.gz \
&& cd opus-1.1.2 \
&& ./configure \
&& make && make check
$ sudo make install \
&& sudo ldconfig
$ ldconfig -p | grep opus
> libopus.so (libc6,x86-64) => /usr/local/lib/libopus.so
Install PJSIP@2.5 according to http://trac.pjsip.org/repos/ticket/1904:
curl -sO http://www.pjsip.org/release/2.5/pjproject-2.5.tar.bz2
tar xjf pjproject-2.5.tar.bz2 \
&& rm pjproject-2.5.tar.bz2 \
&& cd pjproject-2.5/ \
&& ./configure --prefix=/usr --enable-shared --with-opus=/usr/local/ \
&& make dep && make
$ sudo make install && sudo ldconfig
Make sure OPUS is available
std::cout << "Available codecs:\n";
for (auto c : Endpoint::instance()->codecEnum()) {
std::cout << " - " << c->codecId << " (priority: " << static_cast<int>(c->priority) << ")\n";
}
Endpoint::instance()->codecSetPriority("opus/48000", 131);
可以调整优先级。
pjsua2.so
,那么您还需要使用 NDK 构建 opus。 - csguth