Mac build ffmpeg for Android

我怕爱的太早我们不能终老 提交于 2021-01-29 05:58:11

问题


I want to compile ffmpeg on my Mac. The ndk version is r19c and the FFmpeg version is 4.1.3. The build script is copied from this article. But there are some problems when compiling, as follows:

Thanks!!!


回答1:


Starting with NDK r19 everything you need can be found in the <NDK>/toolchains/llvm/prebuilt/<host> directory.

Stripped down example for arm64-v8a targeting API 28:

export ANDROID_NDK_ROOT=/path/to/android-ndk-r19c
export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/bin:$PATH

SYSROOT=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/darwin-x86_64/sysroot
AS=aarch64-linux-android28-clang
CC=aarch64-linux-android28-clang
CXX=aarch64-linux-android28-clang++
ARCH=aarch64
CPU=armv8-a    

./configure \
    --sysroot=$SYSROOT \
    --as=$AS \
    --cc=$CC \
    --cxx=$CXX \
    --target-os=android \
    --arch=$ARCH \
    --cpu=$CPU \
    --enable-cross-compile \
    [ ... other configure options ...]


来源:https://stackoverflow.com/questions/55804041/mac-build-ffmpeg-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!