【发布时间】: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