|
| 1 | +# Android FFmpeg Builder |
| 2 | +A robust shell script to build FFmpeg libraries for Android. This script automatically builds FFmpeg shared libraries (.so files) for multiple Android architectures. |
| 3 | + |
| 4 | +## Current Features |
| 5 | +- Builds FFmpeg version 7.1 for Android |
| 6 | +- Supports multiple architectures (armeabi-v7a, arm64-v8a, x86_64) |
| 7 | +- Minimal configuration focusing on core video/audio functionality |
| 8 | +- Optimized for size and performance |
| 9 | +- Automated build process |
| 10 | +- Pre-built binaries available in releases |
| 11 | + |
| 12 | +## Prerequisites |
| 13 | + |
| 14 | +### Required Tools |
| 15 | +- Android NDK |
| 16 | +- Build essentials (gcc, make) |
| 17 | +- YASM/NASM assembler |
| 18 | +- wget |
| 19 | +- pkg-config |
| 20 | + |
| 21 | +On Ubuntu/Debian: |
| 22 | +```bash |
| 23 | +sudo apt-get update |
| 24 | +sudo apt-get install build-essential gcc make yasm nasm pkg-config wget |
| 25 | +``` |
| 26 | + |
| 27 | +On macOS: |
| 28 | +```bash |
| 29 | +brew install automake yasm nasm pkg-config wget |
| 30 | +``` |
| 31 | + |
| 32 | +Android NDK Setup |
| 33 | +1. Download Android NDK from [Android's NDK page](https://developer.android.com/ndk/downloads) |
| 34 | +2. Extract it to a location (default: `/opt/android-ndk`) |
| 35 | +3. Update the `ANDROID_NDK_HOME` variable in the script if your NDK is installed elsewhere |
| 36 | + |
| 37 | +## Usage |
| 38 | +1. Clone this repository: |
| 39 | +```bash |
| 40 | +git clone https://github.com/husen-hn/android-ffmpeg-builder.git |
| 41 | +cd android-ffmpeg-builder |
| 42 | +``` |
| 43 | + |
| 44 | +2. Make the script executable: |
| 45 | +```bash |
| 46 | +chmod +x build_ffmpeg.sh |
| 47 | +``` |
| 48 | + |
| 49 | +3. Run the script: |
| 50 | +```bash |
| 51 | +./build_ffmpeg.sh |
| 52 | +``` |
| 53 | + |
| 54 | +The built libraries will be in `android/project_libs/`: |
| 55 | +``` |
| 56 | +android/project_libs/ |
| 57 | +βββ arm64-v8a/ |
| 58 | +β βββ libavcodec.so |
| 59 | +β βββ libavformat.so |
| 60 | +β βββ libavutil.so |
| 61 | +β βββ libswresample.so |
| 62 | +β βββ libswscale.so |
| 63 | +βββ armeabi-v7a/ |
| 64 | +βββ x86_64/ |
| 65 | +``` |
| 66 | + |
| 67 | +## Configurations |
| 68 | +The script builds FFmpeg with these configurations: |
| 69 | +- Shared libraries enabled |
| 70 | +- Static libraries disabled |
| 71 | +- Documentation disabled |
| 72 | +- Programs (ffmpeg, ffplay, ffprobe) disabled |
| 73 | +- Hardware acceleration disabled |
| 74 | +- Minimal codec support (h264, aac, mp3) |
| 75 | +- File protocol support |
| 76 | +- MP4 and MKV container support |
| 77 | + |
| 78 | +## License |
| 79 | +This project is licensed under the GNU Lesser General Public Version 3 License - see the [LICENSE](./LICENSE) file for details. |
0 commit comments