Skip to content

nix android.sh

Taner Sener edited this page Jul 28, 2026 · 1 revision

FFmpegKitNext uses these Android entrypoints:

  • Recommended Nix wrapper: ./nix-android.sh -p PROFILE [OPTION]... [VAR=VALUE]...
  • Direct script: ./scripts/start-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:

./scripts/start-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-arm-v7a Do not build armeabi-v7a
--disable-arm-v7a-neon Do not build armeabi-v7a-neon
--disable-arm64-v8a Do not build arm64-v8a
--disable-x86 Do not build x86
--disable-x86-64 Do not build x86_64

Libraries

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

GPL Libraries

These options require --enable-gpl.

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

Custom Libraries

Custom library indexes start at 1 and must be consecutive.

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

Advanced Options

Option Description
--reconf-LIBRARY Run autoreconf before building LIBRARY
--redownload-LIBRARY Download LIBRARY even if it is already downloaded
--rebuild-LIBRARY Build LIBRARY even if it is already built
--skip-LIBRARY Skip LIBRARY during the build
--disable-lib-LIBRARY Disable LIBRARY after enabled-library resolution
--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