android-如何编译ffmpeg的所有CPU架构 [英] android- How to compile ffmpeg for all cpu architectures

查看:1456
本文介绍了android-如何编译ffmpeg的所有CPU架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何编译的ffmpeg在Android的所有CPU架构。目前我使用下面的脚本这对于手臂产生库只。

How to compile ffmpeg for all cpu architectures in android. Currently i'm using the following script which generates libs for arm only.

#!/bin/bash
NDK=$HOME/ndk32
SYSROOT=$NDK/platforms/android-9/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86
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
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

我要支持所有可能的平台。

I want to support all possible platforms.

推荐答案

只要使用不同的工具链,看到的 AndroidFFmpeg 项目作为一个很好的例子相对=nofollow> build_android.sh 。请注意,它处理库ARM NEON SIMD还有,如果检测到NEON支持它在运行时加载的。

Just use different toolchains, see build_android.sh from AndroidFFmpeg project as a good example. Note that it handles library for ARM NEON SIMD as well, it is loaded at run-time if NEON support is detected.

这篇关于android-如何编译ffmpeg的所有CPU架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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