ffmpeg配置错误:找不到libx264

问题描述 投票:0回答:1

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

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

ubuntu ffmpeg configure libx264
1个回答
0
投票

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上显示x86_64(不使用--arch--target)。

© www.soinside.com 2019 - 2024. All rights reserved.