ffmpeg的交叉编译:libvpx解码器版本必须> = 0.9.1

时间:2016-08-25 00:54:00

标签: ffmpeg cross-compiling automake

(注意:我知道标题几乎与this question完全相同,但只有在我自己的系统上构建时才能使用它的解决方案。我正在为嵌入式ARM设备构建。)

我正在尝试构建一个交叉编译的FFmpeg库,以便在arm设备上进行定位,而./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。因为它是针对不同的目标(手臂),我应该将此文件放在其他地方吗? :

# 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

看起来编译器没有提供include和库路径,但我不知道如何解决这个问题。 如果你能提供一些指导,我将非常感激。

2 个答案:

答案 0 :(得分:1)

找到它。

我的图书馆位于

bundle update sass-rails

但是查询pkg-config会给出

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

原来我的arm-openwrt-linux-gnueabi-pkg-config脚本错了。

$ arm-openwrt-linux-gnueabi-pkg-config --libs vpx
-L/home/test/Dev/build-arm/home/test/Dev/build-arm/libvpx/lib -lvpx

这是正确的版本,现在可以使用了。

#!/bin/sh

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

exec pkg-config "$@"

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

答案 1 :(得分:0)

如果您已经构建了用于制作ffmpeg的库,例如libvpx,请记住在安装它们之后以及在ffmpeg中尝试sudo ldconfig之前运行configure

请参阅http://www.frasq.org/en/transcoding-an-audio-or-a-video-file