centos7下源码编译ffmpeg时报错ERROR opus not found using pkg-config问题修复

发布于:2025-07-05 ⋅ 阅读:(18) ⋅ 点赞:(0)

问题描述

配置ffmpeg

sudo PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure   --prefix=/usr/local/ffmpeg   --enable-gpl   --enable-nonfree   --enable-shared   --disable-static   --enable-libx264   --enable-libx265   --enable-libvpx   --enable-libfdk-aac   --enable-libass   --enable-libopus   --enable-libvorbis   --enable-openssl

配置时报错:

ERROR: opus not found using pkg-config

排查步骤

步骤1:安装opus

sudo yum install opus opus-devel

步骤2:查看opus版本

pkg-config --modversion opus

# 输出1.0.2

执行完上述两个步骤,配置ffmpeg时仍然报错。

步骤3:源码编译opus

cd /usr/local/src
sudo curl -LO https://archive.mozilla.org/pub/opus/opus-1.4.tar.gz
sudo tar xzf opus-1.4.tar.gz
cd opus-1.4
sudo ./configure --prefix=/usr/local
sudo make -j$(nproc)
sudo make install

# 查看opus版本
pkg-config --modversion opus

# 输出1.4

步骤4:重新配置ffmpeg

sudo PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/opus/lib/pkgconfig" ./configure   --prefix=/usr/local/ffmpeg   --enable-gpl   --enable-nonfree   --enable-shared   --disable-static   --enable-libx264   --enable-libx265   --enable-libvpx   --enable-libfdk-aac   --enable-libass   --enable-libopus   --enable-libvorbis   --enable-openssl

配置成功。


网站公告

今日签到

点亮在社区的每一天
去签到