编译FFmpeg的lib和它添加到NDK源上的Windows8 [英] Compiling FFmpeg lib and add it to NDK sources on Windows8

查看:821
本文介绍了编译FFmpeg的lib和它添加到NDK源上的Windows8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到有关如何编译和使用FFmpeg的Andr​​oid的一些文章。

I've seen some articles about how to compile and uses FFmpeg for Android.

帖都不错照例a - 例1 和<一个href=\"http://stackoverflow.com/questions/10665039/does-anyone-find-this-useful-compiling-ffmpeg-on-windows-with-cywin-and-ndk-r\">example2

Thess are good examplea - example1 and example2

不幸的是,不关他们,或其他人,我发现帮助了我。在这两个例子build_android.sh创建和配置FFmpeg的configuraion文件,并呼吁进行。当我运行该脚本,我发现了以下错误每次:

Unfortunately, non off them, or others I found helped me. In those two examples a build_android.sh is created and configure the FFmpeg's configuraion file and call to make. Every time when I'm running the script I'm getting the following error:

c:\android\development\android-ndk-r9\sources\ffmpeg>sh build_android.sh
c:/android/development/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebu
ilt/windows-x86_64/arm-linux-androideabi/bin/bin/arm-linux-androideabi-gcc is un

able to create an executable file.
C compiler test failed.

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
solving the problem.
Makefile:2: config.mak: No such file or directory
Makefile:49: /common.mak: No such file or directory
Makefile:92: /libavutil/Makefile: No such file or directory
Makefile:92: /library.mak: No such file or directory
Makefile:169: /doc/Makefile: No such file or directory
Makefile:170: /tests/Makefile: No such file or directory
make: *** No rule to make target `/tests/Makefile'.  Stop.
Makefile:2: config.mak: No such file or directory

如果有人遇到并解决了这个问题,它会是多少AP preciated!

If someone encountered and solved this issue it'll be much appreciated!

了建议脚本我遇到了,我可以不解决新问题后,这是脚本的输出:

After trying the suggested script I ran into a new problem that I couldn't solved, this is the output of the script:

....启用组件列表....

.... Enabled components list....

在列表的末尾,我得到了以下内容:

In the end of the list I got the following:

已启用indevs:
DV1394 v4l2i
的fbdev

Enabled indevs: dv1394 v4l2i fbdev

已启用outdevs:
V4L2的fbdev

Enabled outdevs: fbdev v4l2

许可证:LGPL 2.1或更高版本
创建config.mak,config.h中,和DOC / config.texi ...

License: LGPL version 2.1 or later Creating config.mak, config.h, and doc/config.texi...

警告:C:/安卓/开发/ Android的NDK-R9 /工具链/ ARM-Linux的androideabi-
没有找到4.8 / prebuilt / Windows的x86_64的/ bin中/ ARM-Linux的androideabi-pkg配置,溴化锂
元检测可能会失败。
令: *无规则,使目标 libavfilter / libavfilter.so,通过所需的所有业
S'。停止。
令:*
否规则,使目标安装-libavfilter共享,通过需要INSTAL
L-库-肯定的。停止。

WARNING: C:/android/development/android-ndk-r9/toolchains/arm-linux-androideabi- 4.8/prebuilt/windows-x86_64/bin/arm-linux-androideabi-pkg-config not found, libr ary detection may fail. make: * No rule to make target libavfilter/libavfilter.so', needed byall-ye s'. Stop. make: * No rule to make target install-libavfilter-shared', needed byinstal l-libs-yes'. Stop.

推荐答案

您可以粘贴什么在您已FFmpeg的目录中复制您的build_android.sh文件?

Can you paste what's in your build_android.sh file which you've copied inside the FFmpeg directory?

我已经得到了同样的错误时,在哪里设置错误的脚本开始定义的变量之一。请检查您的NDK或SYSROOT或工具链变量设置为一个有效的路径!

I've got the same error when one of the variables defined at the start of the script where set incorrectly. Check to see if your NDK or SYSROOT or TOOLCHAIN variables are set to a valid path!

我已经通过以下步骤尝试和它的工作对我来说:

I've tried using the following steps and it worked for me:

1)下载FFmpeg的

混帐混帐克隆://source.ffmpeg.org/ffmpeg.git的ffmpeg

git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg

2)创建名为FFmpeg的目录内build_android.sh文件

CD ffmpeg的;触摸build_ffmpeg_for_android.sh;

cd ffmpeg; touch build_ffmpeg_for_android.sh;

3)以下内容添加到文件

#!/usr/bin/env bash

NDK=$HOME/Software/Android/android-ndk-r10/
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64

function build_one
{
./configure \
    --prefix=$PREFIX \
    --enable-shared \
    --disable-static \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-avdevice \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
make clean
make -j4
make install
}

CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"

build_one

4)使脚本可执行

搭配chmod + X build_ffmpeg_for_android.sh

chmod +x build_ffmpeg_for_android.sh

5)开始的FFmpeg的版本为Android(ARM)结果
(运行使用bash,即在/ usr /斌/ bash中没有的/ usr / bin / sh的脚本)

./ build_ffmpeg_for_android.sh

./build_ffmpeg_for_android.sh

这篇关于编译FFmpeg的lib和它添加到NDK源上的Windows8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆