ffmpeg-webrtc编译安装
·
x264编译:
wget https://code.videolan.org/videolan/x264/-/archive/master/x264-master.tar.bz2
tar -xjvf x264-master.tar.bz2
cd x264-master
./configure --enable-shared --disable-asm
make -j 2
make install
验证安装:
pkg-config --modversion x264
# 有输出版本信息输出,如:0.165
libopus编译:
wget https://ftp.osuosl.org/pub/xiph/releases/opus/opus-1.5.2.tar.gz
# 或者下载其他版本:https://opus-codec.org/downloads/
tar -xzvf opus-1.5.2.tar.gz
cd opus-1.5.2
./configure --enable-shared
make -j 2
make install
# 验证安装
pkg-config --modversion opus
# 有输出版本信息输出,如: 1.5.2
其他依赖:
apt install -y libssl-dev
apt install -y libvpx-dev
ffmpeg编译:
# 获取ffmpeg-webrtc
git clone https://github.com/ossrs/ffmpeg-webrtc.git
cd ffmpeg-webrtc
whereis ffmpeg # 查看已安装的ffmepg安装路径
# 编译安装,/usr/local/ffmpeg 为指定的安装地址
./configure --prefix=/usr/local/ffmpeg --enable-gpl --enable-libx264 --enable-openssl --enable-version3 --enable-libopus --enable-libvpx --enable-hardcoded-tables --enable-fast-unaligned --disable-debug --disable-doc --disable-ffplay --disable-static --enable-shared --disable-devices --enable-muxer=whip --extra-ldflags="-lpthread -lssl -lcrypto" --disable-x86asm
make -j 2
make install
# 查看安装
/usr/local/ffmpeg/bin/ffmpeg -version
# 正常可输出ffmpeg相关信息
若出现报错:
# error while loading shared libraries: libavdevice.so.62: cannot open shared object file: No such file or directory.
# 执行:
vim /etc/ld.so.conf.d/ffmpeg.conf
# 添加以下内容:
/usr/local/ffmpeg/lib
# 再刷新系统库缓存即可:
ldconfig
更多推荐

所有评论(0)