ffmpeg - ffmpeg : libvpx decoder version must be >=0. 9.1 的交叉编译

标签 ffmpeg cross-compiling automake

(注意:我知道标题与 this question 几乎相同,但它的解决方案仅适用于我在自己的系统上构建的情况。我正在为嵌入式 ARM 设备构建。)

我正在尝试构建一个针对 arm 设备的交叉编译 FFmpeg 库,而 ./configure 命令告诉我 libvpx 已过时。

我的libvpx版本如下:

$ pkg-config --modversion vorbis 
1.3.2

当我运行 ./configure
$ ./configure --prefix=/home/test/Dev/build-arm/ffmpeg-armhf/ --enable-cross-compile --cross-prefix=${CCPREFIX} --arch=armhf --target-os=linux --pkg-config-flags="--libs vpx --static --cflags" --enable-shared --enable-libvpx 
ERROR: libvpx decoder version must be >=0.9.1

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
ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

我的 vpx.pc 文件位于 /usr/share/pkgconfig .因为它是针对不同的目标( ARM ),我应该把这个文件放在其他地方吗? :
# pkg-config file from libvpx v1.6.0-322-gc325fb7
prefix=/home/test/Dev/build-arm/libvpx
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: vpx
Description: WebM Project VPx codec implementation
Version: 1.6.0
Requires:
Conflicts:
Libs: -L${libdir} -lvpx -lm
Libs.private: -lm -lpthread
Cflags: -I${includedir}

在我的 config.log 中,我看到了这个:
(...lots of text...)
arm-openwrt-linux-gnueabi-gcc -Werror=missing-prototypes -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -march=armv7-a -std=c99 -fomit-frame-pointer -marm -fPIC -pthread -c -o /tmp/ffconf.cZcBLWc3.o /tmp/ffconf.sWjTIULb.m
arm-openwrt-linux-gnueabi-gcc: /tmp/ffconf.sWjTIULb.m: Objective-C compiler not installed on this system
check_pkg_config vpx >= 0.9.1 vpx/vpx_decoder.h vpx/vp8dx.h vpx_codec_vp8_dx
false --exists --print-errors vpx >= 0.9.1
check_lib2 vpx/vpx_decoder.h vpx/vp8dx.h vpx_codec_dec_init_ver -lvpx
check_func_headers vpx/vpx_decoder.h vpx/vp8dx.h vpx_codec_dec_init_ver -lvpx
check_ld cc -lvpx
check_cc
BEGIN /tmp/ffconf.gM9G9FSQ.c
    1   #include <vpx/vpx_decoder.h>
    2   #include <vpx/vp8dx.h>
    3   long check_vpx_codec_dec_init_ver(void) { return (long) vpx_codec_dec_init_ver; }
    4   int main(void) { return 0; }
END /tmp/ffconf.gM9G9FSQ.c
arm-openwrt-linux-gnueabi-gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -march=armv7-a -std=c99 -fomit-frame-pointer -marm -fPIC -pthread -c -o /tmp/ffconf.cZcBLWc3.o /tmp/ffconf.gM9G9FSQ.c
/tmp/ffconf.gM9G9FSQ.c:1:29: fatal error: vpx/vpx_decoder.h: No such file or directory
compilation terminated.
ERROR: libvpx decoder version must be >=0.9.1

看起来编译器没有提供包含和库路径,但我不知道应该如何解决这个问题。
如果您能提供一些指导,我将不胜感激。

最佳答案

找到了。

我的图书馆位于

/home/test/Dev/build-arm/libvpx/lib

但是查询 pkg-config 给出了
$ arm-openwrt-linux-gnueabi-pkg-config --libs vpx
-L/home/test/Dev/build-arm/home/test/Dev/build-arm/libvpx/lib -lvpx

原来我的 arm-openwrt-linux-gnueabi-pkg-config 脚本是错误的。
#!/bin/sh

SYSROOT=/home/test/Dev/build-arm 
export PKG_CONFIG_LIBDIR=${SYSROOT}/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=${SYSROOT}

exec pkg-config "$@"

这是正确的版本,现在可以使用。
#!/bin/sh

SYSROOT=/home/test/Dev/build-arm 
export PKG_CONFIG_LIBDIR=${SYSROOT}/pkgconfig
export PKG_CONFIG_SYSROOT_DIR=

exec pkg-config "$@"

感谢轻松和 furq (#ffmpeg irc.freenode.net) 的帮助

关于ffmpeg - ffmpeg : libvpx decoder version must be >=0. 9.1 的交叉编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39135103/

相关文章:

ffmpeg - 使用ffmpeg命令推送rtsp流,不包含SPS和PPS帧

linux - Qt交叉编译Raspi3 - fatal error : unistd. h: No such file or directory

c++ - CMake 命令行定义不会延续到工具链文件

autoconf - Automake 和库

python - 在 Yocto bitbake 中为 autotools 设置 python dist-packages 路径

c++ - Libav AVFrame 到 Opencv Mat 到 AVPacket 转换

video - 连接三个视频和一个音频

python-3.x - ffmpeg 将一张图片转换为视频

c - 以编程方式检索 C 结构成员的内存偏移量,无需硬编码成员名称

c++ - Emacs EDE - Automake 和子目录的顺序