【问题标题】:ffmpeg configure ERROR: libx264 not foundffmpeg 配置错误:找不到 libx264
【发布时间】:2019-09-02 03:56:49
【问题描述】:

我想在 Ubuntu 64 位上配置 ffmpeg,但我收到一个错误:“ERROR: libx264 not found”。 ffmpeg 看不到 libx264!在此之前,我在 QNX 和 Windows 中成功配置了它。 我用 --disable-opencl 阻止了一个已知的错误,但它没有帮助。 在我的项目中,libx264 应该是 static。

libx264 配置:

../configure --prefix=x264 --disable-cli --enable-static --disable-opencl

platform:      X86_64
byte order:    little-endian
system:        LINUX
cli:           no
libx264:       internal
shared:        no
static:        yes
asm:           yes
interlaced:    yes
avs:           no
lavf:          no
ffms:          no
mp4:           no
gpl:           yes
thread:        posix
opencl:        no
filters:       crop select_every
lto:           no
debug:         no
gprof:         no
strip:         no
PIC:           no
bit depth:     all
chroma format: all

没关系!仅感到困惑平台:X86_64

FFmpeg 配置:

../configure --target-os=linux --prefix=ffmpeg --disable-programs \
--disable-ffplay --disable-ffprobe --disable-doc \ 
--disable-htmlpages --disable-manpages --disable-podpages \ 
--disable-txtpages --disable-avdevice --disable-postproc \
--disable-network --disable-encoders --enable-encoder=libx264 \
--disable-decoders --enable-decoder=h264 --disable-hwaccels \
--disable-muxers --enable-muxer=matroska --disable-demuxers \
--disable-parsers --enable-parser=h264 --enable-gpl \
--enable-libx264 \
--extra-ldflags=-L../x264/lib \
--extra-cflags=-I../x264/include

    ERROR: libx264 not found

路径完全正确!

如果删除--enable-libx264:

install prefix            ffmpeg
source path               /home/osuser/develop/libs/source/ffmpeg-3.4.2
C compiler                gcc
C library                 glibc
ARCH                      x86 (generic)
big-endian                no
runtime cpu detection     yes
standalone assembly       yes
x86 assembler             nasm
...

这正是我担心的……为什么是 x86?

ARCH x86(通用)

x86 汇编器 nasm

也许这就是问题所在?如何在 x86_64 中配置 ffmpeg? --arch=x86_64没救了!

更新: 问题已修复,配置libx264时需要添加--enable-pic

【问题讨论】:

  • ffbuild/config.log 说什么?为什么要编译 3.4.2?从 2017 年开始。
  • @Gyan,谢谢!!!分析日志...我看到错误:relocation R_X86_64_32S against symbol x264_cabac_entropy can not be used when making a PIE object; recompile with -fPIC,明白原因。使用旧版本,因为第一个版本是在 2017 年为 Windows 构建的,从那时起它就没有改变
  • 哇!它添加了--enable-pic。谢谢!

标签: ubuntu ffmpeg configure libx264


【解决方案1】:

ERROR: libx264 not found

您正在为 x264 使用自定义 --prefix,因此您需要为您的 ffmpeg 配置添加 PKG_CONFIG_PATH,例如:

PKG_CONFIG_PATH="$HOME/path/to/your/x264/lib/pkgconfig" ./configure

另一个例子见FFmpeg Wiki: Ubuntu。

这就是我担心的问题...为什么选择 x86?

看起来它只是一个包含i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64 的别名。参考configure的内容。

它还在x86_64 上为我显示x86(不使用--arch 或--target)。

【讨论】:

  • 感谢您的提示,我阅读了详细的手册。看了一个日志里的错误,明白是需要用参数--enable-pic收集libx264@
猜你喜欢
  • 2016-06-27
  • 2011-06-11
  • 2012-02-28
  • 2014-09-24
  • 2012-02-15
  • 2016-08-06
  • 1970-01-01
  • 2012-08-26
  • 1970-01-01
相关资源
最近更新 更多