Custom codec

Build FFmpeg for MX Player.Following conditions are required to run included shell script:
  1. Linux or Cygwin.
  2. Latest Google NDK.
First, ffmpeg source codes should be download from download page.

And then shell scripts need to be modified to fix up paths:
  1. Move to ffmpeg/JNI directory.
  2. Create environment variable NDK to point to your NDK. ex) export NDK=/usr/src/android-ndk-r9d
  3. In, change "HOST_PlATFORM" to proper value mathing your compiling device. List of value can be found on <NDK>/toolchains/arm-linux-androideabi-4.8/prebuilt. Default value is linux-x86_64.
  4. In, change TARGET1 and TARGET2 directory to point output directory.
  5. In and, change CPU_CORE to match CPU core number of your building machine.
And modify  <NDK>/toolchains/arm-linux-androideabi-4.8/ file by removing lines setting arch, fpu and link options depending on ABI. In NDKr9d, this is following lines;

ifneq ($(filter $(TARGET_ARCH_ABI), armeabi-v7a armeabi-v7a-hard),)
    TARGET_CFLAGS += -march=armv7-a \
    TARGET_LDFLAGS += -march=armv7-a \
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
    TARGET_CFLAGS += -mfloat-abi=softfp
    TARGET_CFLAGS += -mhard-float \
    TARGET_LDFLAGS += -Wl,--no-warn-mismatch \

    TARGET_CFLAGS += -march=armv5te \
                            -mtune=xscale \

You don't need to touch for x86 and mips toolchains.

  1. In <NDK>/toolchains/arm-linux-androideabi-4.8/,
And then run "" with one of following arguments: (or to build for all architectures)
neon, tegra3, tegra2, v6_vfp, v6, v5te, x86, mips

After this, all library files should be generated on TARGET directories.

Shipping custom codec.

Since 1.7.29, custom codec file naming is changed as followings:<cpu-architecture-code>.<version-number>

CPU architecture code is one of followings:
neon, tegra3, tegra2, v6_vfp, v6, v5te, x86, mips

Version number is similar one to MX Player's such as 1.7.29, 1.7.30. But please note that codec version and MX Player version is not exactly same. Sometimes MX Player will be upgraded without upgrading codec.
For example, if you are building ARMv7 NEON codec for version 1.7.29, its file name should be

If codec is compressed on a .zip container, it does not need to be decompressed any more. MX Player itself extract codec file from .zip file when loading codec. Also multiple codec files can be compressed on single .zip file and then MX Player loads correct codec file automatically.

MX Player will recognize zipped codec files on SDCard root and Download directory automatically if file name contains version code.

* This build instruction is applicable after version 1.8
* From version 1.7.6, file names are changed to, so forth to resolve conflict with system library files.
* From version 1.7.16, it generates single file;