Support building FFmpeg for Android with x264.
FFmpeg | x264 | Android NDK | Tested Platform |
---|---|---|---|
3.4.8 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk22,ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu |
4.4.4 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk22,ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu |
5.0 | 31e19f92f00c7003fa115047ce50978bc98c3a0d | ndk25,ndk26,ndk27,ndk28 | macOS/Ubuntu |
For newer versions of FFmpeg, the configure script parameters have changed and require separate adaptation.
The packaging methods included in this repository aim to minimize the package size while ensuring performance, with asm and NEON enabled. For specific build options, refer to the build scripts in the build_script
directory.
- Install git
- Install Android NDK (tested with ndk22, ndk25, ndk26, ndk27, ndk28), do not use
NDK23
!- Tested with all NDK versions on
macOS
andUbuntu 20.04+
- Tested with all NDK versions on
- Install yasm, nasm (via
brew install nasm yasm
orapt install nasm yasm -y
...)
$ export NDK=/path/to/your/android-ndk
$ ./build_android.sh
- Use
./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d
to build the specific version
- Use
$ cd jni && $NDK/ndk-build
- The
libffmpeg.so
is in the folderlibs
# Build ffmpeg 3.4.8
./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d
# Build ffmpeg 3.4.8 + 16kb page size
./build_android.sh --ffmpeg 3.4.8 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb
# Build ffmpeg 4.4.4
./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d
# Build ffmpeg 4.4.4 + 16kb page size
./build_android.sh --ffmpeg 4.4.4 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb
# Build ffmpeg 5.0
./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d
# Build ffmpeg 5.0 + 16kb page size
./build_android.sh --ffmpeg 5.0 --x264 31e19f92f00c7003fa115047ce50978bc98c3a0d --16kb