配置ffmpeg的configure时,找不到x265的错误
./configure --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libx264 --enable-libx265 --prefix=../ffmpeg
#输出还是会报错
ERROR: x265 not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
首先pkg-config --list-all | grep x265看看pkg-config有没有找到x265.pc
没找到则需要配置下
pkg-config --list-all | grep x265 #看看有没有输出x265相关信息
echo $PKG_PKG_CONFIG_PATH #看看有没有找到x265.pc
export PKG_PKG_CONFIG_PATH=$PKG_PKG_CONFIG_PATH:/path/x264/lib/pkgconfig:/path/x265/lib/pkgconfig #替换成你的路径
pkg-config --list-all | grep x265 #可以找到x265路径了
以上步骤都是必须确认的 再次执行
./configure --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libx264 --enable-libx265 --prefix=../ffmpeg
#输出还是会报错
ERROR: x265 not found using pkg-config
If you think configure made a mistake, make sure you are using the latest
version from Git. If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "ffbuild/config.log" produced by configure as this will help
solve the problem.
经过查资料得知
configure还需要加上
--extra-libs="-lpthread" --pkg-config-flags="--static"
于是
./configure --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libx264 --enable-libx265 --prefix=../ffmpeg --extra-libs="-lpthread" --pkg-config-flags="--static"
#终于成功了
install prefix ../ffmpeg
source path .
C compiler gcc
C library glibc
ARCH x86 (generic)
big-endian no
runtime cpu detection yes
standalone assembly yes
x86 assembler nasm
MMX enabled yes
MMXEXT enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AESNI enabled yes
... #中间省略1万字
Enabled indevs:
alsa fbdev lavfi oss v4l2 xcbgrab
Enabled outdevs:
alsa fbdev oss v4l2
License: nonfree and unredistributable
后面编译
make -j12 #电脑又多少个核心就-j几
GEN libavutil/libavutil.version
GEN libswscale/libswscale.version
GEN libswresample/libswresample.version
GEN libpostproc/libpostproc.version
GEN libavcodec/libavcodec.version
GEN libavformat/libavformat.version
GEN libavfilter/libavfilter.version
GEN libavdevice/libavdevice.version
CC libavdevice/alldevices.o
CC libavdevice/alsa.o
CC libavdevice/alsa_dec.o
CC libavdevice/alsa_enc.o
CC libavdevice/avdevice.o
CC libavdevice/fbdev_common.o
CC libavdevice/fbdev_dec.o
CC libavdevice/fbdev_enc.o
CC libavdevice/lavfi.o
CC libavdevice/oss.o
... #中间省略一万字
...
LD libavcodec/libavcodec.so.58
LD libavformat/libavformat.so.58
LD libavfilter/libavfilter.so.7
LD libavdevice/libavdevice.so.58
LD ffmpeg_g
LD ffprobe_g
STRIP ffprobe
STRIP ffmpeg
#编译成功
make install #安装
最后把安装的路径添加到PATH里面就可以随时调用了
标签:enable,ffmpeg,--,libavdevice,x265,using,config From: https://www.cnblogs.com/sathcal/p/18536348