是否可以将PJSIP (PJSUA2)配置为使用OPUS编解码器?
答案 0 :(得分:5)
我终于找到了一种方法(ubuntu 14.04,要求PJSIP> = 2.5):
使用以下命令从源安装opus@1.1.2:
$ 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
根据http://trac.pjsip.org/repos/ticket/1904安装PJSIP@2.5:
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
确保OPUS可用
std::cout << "Available codecs:\n";
for (auto c : Endpoint::instance()->codecEnum()) {
std::cout << " - " << c->codecId << " (priority: " << static_cast<int>(c->priority) << ")\n";
}
可用的编解码器:
- speex / 16000/1(优先级:130)
- speex / 8000/1(优先级:129)
- speex / 32000/1(优先级:128)
- iLBC / 8000/1(优先级:128)
- GSM / 8000/1(优先级:128)
- PCMU / 8000/1(优先级:128)
- PCMA / 8000/1(优先级:128)
- G722 / 16000/1(优先级:128)
- opus / 48000/2 (优先级:128)
- L16 / 44100/1(优先级:0)
- L16 / 44100/2(优先级:0)
- L16 / 8000/1(优先级:0)
- L16 / 8000/2(优先级:0)
- L16 / 16000/1(优先级:0)
- L16 / 16000/2(优先级:0)
Endpoint::instance()->codecSetPriority("opus/48000", 131);