Skip to content

🎬 Android FFmpeg Builder - Automated FFmpeg shared library (.so) builder for Android. Supports multiple architectures, optimized configuration, and includes pre-built binaries.

License

Notifications You must be signed in to change notification settings

husen-hn/ffmpeg-android-binary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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.

About

🎬 Android FFmpeg Builder - Automated FFmpeg shared library (.so) builder for Android. Supports multiple architectures, optimized configuration, and includes pre-built binaries.

Topics

Resources

License

Stars

Watchers

Forks

Languages