问题
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