An optimized FFmpeg build system for iOS and Android, specifically engineered for the TakeFive video processing pipeline. This repository is a specialized fork of FFmpegKit, migrating towards FFmpeg 7.1 with a focus on LGPL compliance and hardware acceleration.
- FFmpeg 7.1 Core: Leveraging the latest video processing improvements.
- Hardware Acceleration: Native support for Apple VideoToolbox (iOS) and Android MediaCodec.
- Commercial Friendly: Strictly configured for LGPL v3.0. GPL/Non-free components are disabled to ensure compatibility with private commercial applications.
- Architecture Optimized: Focused on
arm64(physical devices) andarm64-simulator(Apple Silicon development). - Consolidated Dependencies: Includes patched versions of
libass,freetype,fribidi,lame, andopenh264.
This project uses a cloud-first build strategy via GitHub Actions to bypass local environment inconsistencies (like macOS Gatekeeper/SIP).
- iOS: Universal XCFrameworks (
arm64+arm64-simulator). - Android: Android Archive (AAR) with support for API Level 26+.
To build locally (macOS recommended for iOS):
./ios.sh -x --enable-ios-videotoolbox --enable-ios-avfoundation
./android.sh --api-level=26This engine is licensed under the GNU Lesser General Public License (LGPL) version 3.0.
Important for Developers:
- This build DOES NOT include GPL-licensed libraries (like
x264orx265). - You can safely link this library into your private commercial applications without being required to open-source your app's proprietary code.
- We have implemented strict build-time checks to prevent accidental GPL enablement.
- Modern CMake: Forced minimum CMake 3.5+ for sub-modules to support modern CI environments.
- Apple Silicon Fixes: Patched
lameand other assembly-heavy dependencies for stable iOS simulator builds on M1/M2/M3 chips. - Dependency Isolation: Scripts use a local
src/directory to ensure build reproducibility.
Compiled binaries are available in the GitHub Actions Release Tab.
Because this engine creates pure, precompiled static libraries (e.g., libavcodec.a, libavformat.a) rather than relying on on-the-fly source builds, your mobile application build pipeline remains incredibly fast and immune to C-compiler breaks.
- Download the Artifact: Navigate to the latest successful GitHub Action run and download the
takefive-ffmpeg-ios-arm64.zipartifact. - Extract: Unzip the folder to reveal the
lib/(static.afiles) andinclude/(C headers) directories. - Import to Xcode: Drag and drop the
libfolder completely into your Xcode project's Frameworks, Libraries, and Embedded Content section. - Header Search Paths: In your Xcode Build Settings, add the path to the extracted
include/folder to the Header Search Paths (HEADER_SEARCH_PATHS) setting so your Objective-C or Swift Bridging Headers can locate<libavutil/avutil.h>, etc. - Link Dependencies: Ensure you dynamically link the
VideoToolbox.framework,AudioToolbox.framework,CoreMedia.framework, andAVFoundation.frameworkin Xcode, as FFmpeg relies on these Apple-native libraries for hardware acceleration. - Done: You can now import FFmpeg headers and invoke its C-API directly within your iOS app bundle.
- Download the Artifact: Navigate to the latest successful GitHub Action run and download the generated Android
.zipor.aarartifact containing the compiled.so(shared) or.a(static) binary files forarm64-v8aandarmeabi-v7a. - JNI / CMakeLists: Move the extracted C headers (
include/) and library files (lib/) into your Android project'sapp/src/main/cppdirectory or equivalent natively mounted folder. - Link Libraries: In your Android
CMakeLists.txt, set up the prebuilt libraries for CMake usingadd_library(avcodec STATIC IMPORTED)and point their properties utilizingset_target_properties(avcodec PROPERTIES IMPORTED_LOCATION ...). Do this for all downloaded FFmpeg core structures. - Android Media Framework: Link the requisite NDK acceleration API tools like
libmediandk.sointarget_link_librariesso FFmpeg can decode natively on Android silicon. - Java/Kotlin Invoke: Craft your own local JNI wrappers in C++ (
native()functions) to interface with the extracted headers within your Android environment!
Maintained by the Wake Team for the TakeFive Mobile App.