π¬ Automated FFmpeg shared library and binary builder for Android. This script builds FFmpeg with full codec support and hardware acceleration for multiple Android architectures.
- FFmpeg 7.1 with full codec and format support
- Supported architectures:
- arm64-v8a
- armeabi-v7a
- x86_64
 
- Hardware acceleration enabled
- MediaCodec support
- NEON optimization
- Network capabilities
- All encoders and decoders
- All muxers and demuxers
- All protocols enabled
- ffmpeg and ffprobe binaries included
- Android NDK
- Build essentials (gcc, make)
- YASM/NASM assembler
- wget
- pkg-config
On Ubuntu/Debian:
sudo apt-get update && sudo apt-get install -y \
    build-essential \
    gcc \
    make \
    yasm \
    nasm \
    pkg-config \
    wgetOn macOS:
brew install automake yasm nasm pkg-config wget- Download Android NDK from Android's NDK page
- Extract it to a location (default: /opt/android-ndk)
- Update the ANDROID_NDK_HOMEvariable in the script if your NDK is installed elsewhere
- Ensure NDK toolchain is accessible
- Clone the repository:
git clone https://github.com/husen-hn/android-ffmpeg-builder.git
cd android-ffmpeg-builder- Make the script executable:
chmod +x build_ffmpeg.sh- Run the script:
./build_ffmpeg.shandroid/project_output/
βββ arm64-v8a/
β   βββ bin/
β   β   βββ ffmpeg
β   β   βββ ffprobe
β   βββ lib/
β       βββ libavcodec.so
β       βββ libavdevice.so
β       βββ libavfilter.so
β       βββ libavformat.so
β       βββ libavutil.so
β       βββ libpostproc.so
β       βββ libswresample.so
β       βββ libswscale.so
βββ armeabi-v7a/
βββ x86_64/
βββ build_info.txt
The script builds FFmpeg with these features:
- Shared libraries enabled
- Hardware acceleration
- MediaCodec support
- NEON optimization
- Network support
- All codecs and formats
- Debug symbols stripped
- Size-optimized binaries
Pre-built binaries are available in the Releases section. Each release includes:
- Built .sofiles for all supported architectures (arm64-v8a, armeabi-v7a, x86_64)
- ffmpeg and ffprobe binaries
- Build information and checksums
- Source code archive
- Update the version in build_ffmpeg.sh:
# Change this line
FFMPEG_VERSION="7.1"- Download the new FFmpeg source:
wget https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2- Clean old build files:
rm -rf ffmpeg-*
rm -rf android/project_output/*- Run the build script:
./build_ffmpeg.sh
This project is licensed under the GNU Lesser General Public Version 3 License - see the LICENSE file for details.