自行编译ffmpeg解决树莓派(Raspberry Pi)上oicq发不了语音的问题

这个问题的典型报错为:音频转码到amr失败,请确认你的ffmpeg可以处理此转换,此时应有ffmpeg报错输出
Automatic encoder selection failed for output stream #0:0. Default encoder for format amr (codec amr_nb) is probably disabled. Please choose an encoder manually.

树莓派自带的 ffmpeg 没有启用 libopencore_amrnb 库,你需要自己编译一个 ffmpeg。

步骤如下。

1. 安装依赖

sudo apt install build-essential libxvidcore-dev libx264-dev libmp3lame-dev
sudo apt build-dep ffmpeg

1.1 添加src源

sudo nano /etc/apt/sources.list

然后把里面的 deb-src 那行的注释去掉,保存

sudo apt update
apt-get source ffmpeg
cd ffmpeg-*

2. 卸载官方源的 ffmpeg

sudo apt autoremove ffmpeg

3. 编译并安装 ffmpeg

./configure --enable-nonfree --enable-gpl --enable-libx264 --enable-zlib --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
sudo make install

在我自己的 Raspberry Pi 4 Model B 4GB RAM 版本上,编译大概需要35分钟左右。

至此发送语音功能应该可以正常使用了

Mark

广岛大学社会心理学(预备)研究生。忙。AE/PR/FCPX/PS/LR/AI(Adobe Illustrator)。会一点Python。

相关推荐

ffmpeg在macOS上调用GPU

太长不看系列 # 使用H.264编码: ffmpeg -vcodec h264_videotoolbox -i <input> <output> # 使用H.265编码 …

暂无评论

有什么想法说出来听听?

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据