Skip to content

Building

LucQuebec edited this page Jun 21, 2026 · 3 revisions

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.

Setup

wsl --install -d Ubuntu-22.04

Inside 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 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"

Clone and build

git clone --recurse-submodules https://github.com/ffmpegkit-maintained/ffmpeg-kit.git
cd ffmpeg-kit

./android.sh --enable-full     # or --enable-audio / --enable-video / --enable-https

Useful flags: --lts (older NDK/API baseline), -d/--debug, -s/--speed, --arch=<arch>. 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).

Verify 16 KB page size alignment

for so in $(find prebuilt -name "*.so"); do
  echo "$so:"
  objdump -p "$so" | grep -A1 LOAD | grep align
done

Segment alignment should report 2**14 (16384) or higher — see the Android 16 KB page size guide on developer.android.com. This check is currently manual; it is not enforced in CI yet (see Compatibility).

Troubleshooting

See docs/BUILD.md, Troubleshooting section, for the full list (missing autoreconf, NDK toolchain path issues, hung configure steps, WSL2 OOM).

Clone this wiki locally