-
Notifications
You must be signed in to change notification settings - Fork 0
Building
Condensed version of docs/BUILD.md — that file is the canonical, fully detailed guide; this page is a quick reference.
FFmpegKit native build pipeline only runs on Linux or macOS. On Windows, use WSL2 with Ubuntu.
wsl --install -d Ubuntu-22.04Inside Ubuntu:
sudo apt update
sudo apt install -y autoconf automake libtool pkg-config curl git \
build-essential yasm nasm gperf texinfo bison ragel \
python3 python3-pip unzip zip wget meson ninja-build \
doxygen cmake autogen autopoint groff gtk-doc-tools libtasn1-bin \
openjdk-17-jdk
export ANDROID_SDK_ROOT="$HOME/android-sdk"
# ... install cmdline-tools, then:
sdkmanager "platform-tools" "platforms;android-35" "ndk;26.2.11394342"
export ANDROID_NDK_ROOT="$ANDROID_SDK_ROOT/ndk/26.2.11394342"
export JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"groff, doxygen, autogen, autopoint, gtk-doc-tools and libtasn1-bin are easy to miss and only bite deep into a specific library's build (e.g. missing groff breaks libiconv's man-page target with groff: fatal error: cannot load 'DESC' description file).
git clone --recurse-submodules https://github.com/ffmpegkit-maintained/ffmpeg-kit.git
cd ffmpeg-kit
# Full variant, arm64-v8a only (matches what's published)
./android.sh --full --enable-android-media-codec --enable-android-zlib \
--disable-arm-v7a --disable-arm-v7a-neon --disable-x86 --disable-x86-64android.sh only has one variant preset, --full — there are no --enable-audio/--enable-video/--enable-https presets, and no single --arch= flag to keep just one ABI (use --disable-<arch> per ABI you don't want instead; --disable-arm-v7a does not also drop arm-v7a-neon, that needs its own flag). See Compatibility for what's actually published.
Other useful flags: --lts (older NDK/API baseline), -d/--debug, -s/--speed, --enable-gpl (enables x264/x265 but changes the license to GPL-3.0), --api-level=<n>. Run ./android.sh --help for the full list.
Output lands under prebuilt/android-<arch>/ffmpeg/lib/ (shared libraries) and prebuilt/bundle-android-aar/ (the .aar).
The build already links with -Wl,-z,max-page-size=16384 by default, so this should pass without any extra steps — it's a verification, not something you need to enable:
for so in $(find prebuilt -name "*.so"); do
echo "$so:"
objdump -p "$so" | grep -A1 LOAD | grep align
doneSegment alignment should report 2**14 (16384) or higher — see the Android 16 KB page size guide.
See docs/BUILD.md § Troubleshooting for the full list, including fixes for a CMake policy-version error on cpu_features and a host/target link-path issue on libvpx that both came up while wiring up the CI build.