Building Custom FFmpeg library for MX Player:
Linux or Cygwin or Mac.
Android NDK (r20 for v1.21.0)
FFmpeg source codes (can be downloaded from the download page)
Extract the downloaded FFmpeg sources
Open ffmpeg -> JNI folder
Change CPU_CORE In build.sh and build-ffmpeg.sh to match CPU core number of your building machine.
If you would like to use your own FFmpeg build configuration, configs can be changed by editing config-ffmpeg.sh.
Change the working directory to ffmpeg/JNI directory.
Create an environment variable NDK to point to your NDK path (e.g. export NDK=/usr/src/android-ndk-r20b)
Run rebuild-ffmpeg.sh to build custom codec for all supported architectures
If you would like to build custom codec for a particular architecture, then run both build-openssl.sh and build-ffmpeg.sh with one of the following arguments.
On successful completion of the process, libffmpeg.mx.so file will be generated on relevant subdirectories under the libs folder (e.g. ffmpeg/JNI/libs/arm64-v8a ).
Shipping custom codec.
Since 1.7.29, custom codec file naming convention is changed to the following format:
CPU architecture code is one of the followings:
The version number will be similar to MX Player (e.g. 1.7.29, 1.7.30). However, sometimes MX Player will be upgraded without upgrading codec. So, Custom Codec version may not be exactly the same as the version of MX Player.
If the codec is compressed in a .zip container, it's no longer required to be decompressed manually. MX Player itself extract codec file from .zip file when loading codec. Also, multiple codec files can be compressed on a single .zip file. MX Player loads correct codec from the file automatically.
MX Player will recognize zipped codec files on SDCard root and Download directory automatically if the filename contains version code.
* This build instruction is applicable after version 1.13.0
* From version 1.7.6, file names are changed to libavutil.mx.so, libavformat.mx.so.. so forth to resolve conflict with system library files.
* From version 1.7.16, it generates single file; libffmpeg.mx.so.
* neon64 and x86_64 are supported since version 1.13.0