Skip to content

Latest commit

 

History

History
161 lines (120 loc) · 3.82 KB

File metadata and controls

161 lines (120 loc) · 3.82 KB

Android FFmpeg Builder

🎬 Automated FFmpeg shared library and binary builder for Android. This script builds FFmpeg with full codec support and hardware acceleration for multiple Android architectures.

License FFmpeg Version GitHub last commit GitHub release (latest by date)

🚀 Features

  • 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

📋 Prerequisites

Required Tools

  • 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 \
    wget

On macOS:

brew install automake yasm nasm pkg-config wget

Android NDK Setup

  1. Download Android NDK from Android's NDK page
  2. Extract it to a location (default: /opt/android-ndk)
  3. Update the ANDROID_NDK_HOME variable in the script if your NDK is installed elsewhere
  4. Ensure NDK toolchain is accessible

🛠️ Usage

  1. Clone the repository:
git clone https://github.com/husen-hn/android-ffmpeg-builder.git
cd android-ffmpeg-builder
  1. Make the script executable:
chmod +x build_ffmpeg.sh
  1. Run the script:
./build_ffmpeg.sh

📚 Output Structure

android/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

🔧 Configurations

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

📦 Releases & Pre-built Binaries

Latest Release

Latest Release

Pre-built binaries are available in the Releases section. Each release includes:

  • Built .so files for all supported architectures (arm64-v8a, armeabi-v7a, x86_64)
  • ffmpeg and ffprobe binaries
  • Build information and checksums
  • Source code archive

🔄 Updating FFmpeg Version

  1. Update the version in build_ffmpeg.sh:
# Change this line
FFMPEG_VERSION="7.1"
  1. Download the new FFmpeg source:
wget https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2
  1. Clean old build files:
rm -rf ffmpeg-*
rm -rf android/project_output/*
  1. Run the build script:
./build_ffmpeg.sh

📜 License

This project is licensed under the GNU Lesser General Public Version 3 License - see the LICENSE file for details.