Skip to content

android.sh

Taner Sener edited this page Aug 21, 2026 · 1 revision

FFmpegKitNext uses these Android entrypoints:

  • Recommended Nix wrapper: ./nix-android.sh -p PROFILE [OPTION]... [VAR=VALUE]...
  • Direct script: ./android.sh [OPTION]... [VAR=VALUE]...

The build options are the same for both entrypoints. The Nix wrapper also supports -p, --profile and --list-profiles.

By default, the Android build enables five architectures: armeabi-v7a, armeabi-v7a-neon, arm64-v8a, x86 and x86_64. No optional external libraries are enabled by default.

When compilation ends, an Android Archive (.aar) is created under prebuilt unless --no-archive is used.

Usage with Nix:

./nix-android.sh -p android-r27d [OPTION]... [VAR=VALUE]...

Usage without Nix:

./android.sh [OPTION]... [VAR=VALUE]...

Specify environment variables as VARIABLE=VALUE to override default build options.

General Options

Option Description
-h, --help Display help and exit
-v, --version Display version information and exit
-d, --debug Build with debug information
-s, --speed Optimize for speed instead of size
-f, --force Ignore warnings
--jobs=N Number of jobs to run, default is auto
--api-level=api Override Android API level, default is 24
--toolchain=path Override the default LLVM toolchain path
--no-ffmpeg-kit-protocols Disable custom ffkitsaf, ffkitmem and ffkitstream protocols

Nix Wrapper Options

Option Description
-p PROFILE, --profile PROFILE Nix develop profile to use
--list-profiles List local Nix develop profiles

Licensing Options

Option Description
--enable-gpl Allow building GPL libraries. Created binaries will be licensed under GPL v3.0

Architectures

Option Description
--disable-arch-arm-v7a Do not build armeabi-v7a
--disable-arch-arm-v7a-neon Do not build armeabi-v7a-neon
--disable-arch-arm64-v8a Do not build arm64-v8a
--disable-arch-x86 Do not build x86
--disable-arch-x86-64 Do not build x86_64

Libraries

Option Description
--enable-lib-all Enable all non-GPL external libraries. With --enable-gpl, also enables GPL libraries
--enable-lib-android-media-codec Build with built-in Android MediaCodec support
--enable-lib-android-zlib Build with built-in Android zlib support
--enable-lib-chromaprint Build with chromaprint
--enable-lib-dav1d Build with dav1d
--enable-lib-fontconfig Build with fontconfig
--enable-lib-freetype Build with freetype
--enable-lib-fribidi Build with fribidi
--enable-lib-gmp Build with gmp
--enable-lib-gnutls Build with gnutls
--enable-lib-harfbuzz Build with harfbuzz
--enable-lib-kvazaar Build with kvazaar
--enable-lib-lame Build with lame
--enable-lib-libaom Build with libaom
--enable-lib-libass Build with libass
--enable-lib-libiconv Build with libiconv
--enable-lib-libilbc Build with libilbc
--enable-lib-libjxl Build with libjxl
--enable-lib-liblc3 Build with liblc3
--enable-lib-libsvtav1 Build with libsvtav1
--enable-lib-libtheora Build with libtheora
--enable-lib-libvorbis Build with libvorbis
--enable-lib-libvpx Build with libvpx
--enable-lib-libwebp Build with libwebp
--enable-lib-libxml2 Build with libxml2
--enable-lib-opencore-amr Build with opencore-amr
--enable-lib-openh264 Build with openh264
--enable-lib-openssl Build with openssl
--enable-lib-opus Build with opus
--enable-lib-sdl Build with sdl
--enable-lib-shine Build with shine
--enable-lib-snappy Build with snappy
--enable-lib-soxr Build with soxr
--enable-lib-speex Build with speex
--enable-lib-srt Build with srt
--enable-lib-tesseract Build with tesseract
--enable-lib-twolame Build with twolame
--enable-lib-vo-amrwbenc Build with vo-amrwbenc
--enable-lib-vvenc Build with vvenc
--enable-lib-zimg Build with zimg

GPL Libraries

These options require --enable-gpl.

Option Description
--enable-lib-libvidstab Build with libvidstab
--enable-lib-rubberband Build with rubberband
--enable-lib-x264 Build with x264
--enable-lib-x265 Build with x265
--enable-lib-xvidcore Build with xvidcore

Custom Libraries

Custom library indexes start at 1 and must be consecutive.

Option Description
--enable-lib-custom-[n]-name=value Name of the custom library
--enable-lib-custom-[n]-repo=value Git repository of the source code
--enable-lib-custom-[n]-repo-commit=value Git commit to download
--enable-lib-custom-[n]-repo-tag=value Git tag to download
--enable-lib-custom-[n]-package-config-file-name=value Package config file installed by the custom build script
--enable-lib-custom-[n]-ffmpeg-enable-flag=value Library name used by FFmpeg configure
--enable-lib-custom-[n]-license-file=value License file path relative to the library source folder
--enable-lib-custom-[n]-uses-cpp Mark the custom library as requiring libc++

Advanced Options

Option Description
--reconf-lib-LIBRARY Run autoreconf before building LIBRARY
--redownload-lib-LIBRARY Download LIBRARY even if it is already downloaded
--rebuild-lib-LIBRARY Build LIBRARY even if it is already built
--disable-lib-LIBRARY Disable LIBRARY without disabling its dependencies
--disable-lib-with-deps-LIBRARY Disable LIBRARY and its dependencies
--lib-version-LIBRARY=n Override default LIBRARY version
--no-archive Do not build the Android archive
--prefab Add a Prefab payload to the AAR for native/CMake consumers
--no-output-redirection Print build output directly instead of redirecting detailed output to build.log
--no-workspace-cleanup-LIBRARY Keep LIBRARY workspace files after the build
--no-link-time-optimization Disable link-time optimization
--extra-cflags=value Append extra C compiler flags
--extra-cxxflags=value Append extra C++ compiler flags
--extra-ldflags=value Append extra linker flags

Clone this wiki locally