How to Compile FFmpeg 2.3 with Android NDK r10: Step-by-Step Tutorial with Build Script Modifications
Introduction
FFmpeg is a powerful open-source multimedia framework renowned for its ability to decode, encode, transcode, and stream audio and video. For Android developers working on legacy projects, there may be a need to integrate older versions of FFmpeg (such as 2.3) with older NDK versions (like r10e) due to compatibility constraints with existing codebases or target devices.
Note: FFmpeg 2.3 (released 2014) and Android NDK r10e (released 2015) are legacy versions. The current FFmpeg release is 9.x and the current NDK is r28c. NDK r10e uses the GCC 4.8 toolchain, which has been deprecated in favor of Clang since approximately NDK r16. This guide is intended for developers who specifically need these older versions for compatibility reasons. For new projects, consider using a current NDK release and the latest FFmpeg version.
Compiling FFmpeg for Android is non-trivial, especially with older NDK versions, as toolchains, build systems, and supported APIs have evolved significantly. This tutorial provides a detailed, step-by-step guide to compiling FFmpeg 2.3 using Android NDK r10e, including critical modifications to the build script to ensure compatibility with NDK r10e’s legacy toolchain structure. By the end, you’ll have static FFmpeg libraries (e.g., libavcodec.a, libavformat.a) ready to link into your Android project.