The general idea is to create a static lame build (libmp3lame.a) using NDK, and then use it in the configuration and make scripts of ffmpeg, this way ffmpeg will recognize it a valid coder.
Its a little hackish, but its the only way that I managed to do it, I welcome anyone who can improve the process.
I used Ubuntu (had problems with cygwin) and NDK r5c, so I recommend this environment.
1. Follow the instructions to build ffmpeg using this post from halfninja (Thanks Ninja for the great guide!):
2.1 Download Lame version 3.98.4 from here (latest source didn't work for me):
2.2 Create libmp3lame directory in the jni folder and
2.6 Copy *.h to
4. Create Android.mk_lame as follows:
cp Android.mk_lame Android.mk (rename the original to Android.mk.ffmpeg-x264)
5. call ndk-build to build only lame, this will produce an error, but will also produce libmp3lame.a in the objects directory.
6. copy libmp3lame.a to libmp3lame.
7.1 Edit configure_ffmpeg.sh as follows:
8. call config_make_everything, this should take about 10mins
9. Edit Android.mk.ffmpeg-x264 as follows:
10. cp Android.mk.ffmpeg-x264 Android.mk
11 call ndk-build
12. the libvideokit.so that contains ffmpeg with libmp3lame should be in the lib directory.