sudo apt-get install libopus-dev
配置ffmpeg
–enable-libopus 表明生成ffmpeg时,使用libopus库。
–enable-encoder 表明开启名字为’libopus’的编码器。
./configure --enable-libx264 --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libopus --enable-encoder=libopus --extra-libs=‘-L/home/yqw/ffmpeg-metartc-all/FFmpeg-n4.3.3/metartc2 -lmetartccore2 -lspeexdsp -lpthread -lsrtp2 -lssl -lcrypto -ldl’
//将音频转为opus
ffmpeg -i /home/test/test.wav -c:v copy -acodec libopus -b:a 32k -vbr on -compression_level 10 /home/test/test_1.opus
-c:a copy -c:v copy
参考:https://www.cnblogs.com/little-kwy/p/11305759.html
https://segmentfault.com/a/1190000022957430?utm_source=tag-newest