Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Building ffmpeg executable on Android

Taner Sener edited this page Jan 27, 2020 · 10 revisions

Current versions of build scripts do not create ffmpeg and ffprobe binaries but it is possible to generate them by applying the following changes. Please note that ffplay can not be built.

In build/android-ffmpeg.sh

1. Change --disable-programs line to --disable-ffplay

2. Change --disable-static line to --enable-static

3. Change --enable-shared line to --disable-shared

After applying these changes, android.sh will create ffmpeg and ffprobe binaries under the prebuilt/android-<arch>/ffmpeg/bin path.

Script itself will fail while building mobile-ffmpeg. But ignore this error, mobile-ffmpeg can't use ffmpeg and ffprobe, that's why the build fails.

Building arm-v7a-neon platform on API level 24

ffmpeg: ok

Building arm64-v8a platform on API level 24

ffmpeg: ok

Building x86 platform on API level 24

ffmpeg: ok

Building x86-64 platform on API level 24

ffmpeg: ok

mobile-ffmpeg: failed

Please note that openh264, snappy, tesseract and x265 libraries need to be linked with a c++ library and scripts are configured to use libc++_shared.so. So if you enable them, you need to have libc++_shared.so in the same directory with ffmpeg and/or ffprobe.

libc++_shared.so can be found under the ${ANDROID_NDK_ROOT}/sources/cxx-stl/llvm-libc++/libs/<arch> folder.

Clone this wiki locally