gpt4 book ai didi

audio - PJSIP (PJSUA2) - OPUS 编解码器

转载 作者:行者123 更新时间:2023-12-01 11:25:41 24 4
gpt4 key购买 nike

是否可以配置 PJSIP (PJSUA2)使用OPUS编解码器?

最佳答案

我终于找到了一个方法(ubuntu 14.04,要求 PJSIP >= 2.5):

  1. 使用以下命令从源代码安装 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
  2. 根据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
  3. 确保 OPUS 可用

    std::cout << "Available codecs:\n";
    for (auto c : Endpoint::instance()->codecEnum()) {
    std::cout << " - " << c->codecId << " (priority: " << static_cast<int>(c->priority) << ")\n";
    }

Available codecs:

  • speex/16000/1 (priority: 130)
  • speex/8000/1 (priority: 129)
  • speex/32000/1 (priority: 128)
  • iLBC/8000/1 (priority: 128)
  • GSM/8000/1 (priority: 128)
  • PCMU/8000/1 (priority: 128)
  • PCMA/8000/1 (priority: 128)
  • G722/16000/1 (priority: 128)
  • opus/48000/2 (priority: 128)
  • L16/44100/1 (priority: 0)
  • L16/44100/2 (priority: 0)
  • L16/8000/1 (priority: 0)
  • L16/8000/2 (priority: 0)
  • L16/16000/1 (priority: 0)
  • L16/16000/2 (priority: 0)
  1. 使用 Endpoint::instance()->codecSetPriority("opus/48000", 131); 调整优先级

关于audio - PJSIP (PJSUA2) - OPUS 编解码器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37377767/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com