Android – FFMPEG for Android toolchains: arm-linux-armeabi-eabi-pkg-config – is there any toolchain in existence containing the pkg-config tool

androidcompilationffmpeglinux-toolchainstatic-libraries

Does anybody know any toolchain for ffmpeg linux arm platform which contains the arm-linux-androideabi-pkg-config tool?

The Android NDK does not contain it. Also has anybody succeeded in building ffmpeg for android that contains the alsa device? Please note that libasound is present on my Ubuntu x86 PC.

After very extensive research visiting forums including ffmpeg.org, ffmpeg–nabbles, groups.google.com including the andro and android-ndk gropus, and the Internet in general, I have not succeeded in finding anyone who seems to know of its existence. At best, I have read people saying ignore it. Considering what it is needed for, I consider that a naive thing to say.

A careful review of the standard ffmpeg configure script shows that for certain input and output devices a toolchain described as pkg_config_default=pkg-config is required. Also all items on the HAVE_LIST are SYSTEM DEPENDENT. The configure script states very clearly what dependencies are required for each indev or outdev item. Apparently this tool is used then to verify the libraries which are needed for the dependencies

This is what happens when you attempt to configure ffmpeg for android

jasongipsyblues@android-master:~/android-ffmpeg/Project/jni$ ./configure_ffmpeg.sh


..
….
License: GPL version 3 or later
Creating config.mak and config.h…

config.h is unchanged

config.asm is unchanged

libavutil/avconfig.h is unchanged

WARNING: /home/jasongipsyblues/Desktop/apps/android-ndk-r8b/toolchains/arm-linux-androideabi-
4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-pkg-config not found, library detection may
fail.

On a PC with Ubuntu there is no issue with pkg-config.

Please compare the following outputs when one greps for the in/out device alsa from the config.log files for an Ubuntu x86 PC and that for the android box using the android-ndk-r8 toolchain

jasongipsyblues@android-master:~/android-ffmpeg/Project/jni/ffmpeg$ cat config.log|grep >alsa
alsa_indev
alsa_outdev
alsa_asoundlib_h
INDEV_LIST='alsa_indev
OUTDEV_LIST='alsa_outdev
alsa_indev='yes'
alsa_indev_deps='alsa_asoundlib_h snd_pcm_htimestamp'
alsa_outdev='yes'
alsa_outdev_deps='alsa_asoundlib_h'
indevs_if_any='alsa_indev
outdevs_if_any='alsa_outdev
check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
check_func_headers alsa/asoundlib.h snd_pcm_htimestamp -lasound
1 #include
/tmp/ffconf.VCjQQAHQ.c:1:28: error: alsa/asoundlib.h: No such file or directory

This is the compiler output showing the source of the error:

check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
check_func_headers alsa/asoundlib.h snd_pcm_htimestamp -lasound
check_ld cc -lasound
check_cc
BEGIN /tmp/ffconf.VCjQQAHQ.c
1 #include
2 long check_snd_pcm_htimestamp(void) { return (long) snd_pcm_htimestamp; }
3 int main(void) { return 0; }
END /tmp/ffconf.VCjQQAHQ.c
/home/jasongipsyblues/Desktop/apps/android-ndk-r8b/toolchains/arm-linux-androideabi->4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc –sysroot=/home/jasongipsyblues/Desktop/apps/android-ndk-r8b/platforms/android-14/arch-arm -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -I../x264 -mcpu=cortex-a9 -std=c99 -fomit-frame-pointer -fPIC -marm -c -o /tmp/ffconf.I2B2AXfH.o
/tmp/ffconf.VCjQQAHQ.c
/tmp/ffconf.VCjQQAHQ.c:1:28: error: alsa/asoundlib.h: No such file or directory
/tmp/ffconf.VCjQQAHQ.c: In function 'check_snd_pcm_htimestamp':
/tmp/ffconf.VCjQQAHQ.c:2: error: 'snd_pcm_htimestamp' undeclared (first use in this function)
/tmp/ffconf.VCjQQAHQ.c:2: error: (Each undeclared identifier is reported only once
/tmp/ffconf.VCjQQAHQ.c:2: error: for each function it appears in.)

This is for the Ubuntu x86PC ffmpeg
jasongipsyblues@android-master:~/ffmpeg$ cat config.log|grep alsa
alsa_indev
alsa_outdev
alsa_asoundlib_h
INDEV_LIST='alsa_indev
OUTDEV_LIST='alsa_outdev
alsa_indev='yes'
alsa_indev_deps='alsa_asoundlib_h snd_pcm_htimestamp'
alsa_outdev='yes'
alsa_outdev_deps='alsa_asoundlib_h'
indevs_if_any='alsa_indev
outdevs_if_any='alsa_outdev
check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
check_func_headers alsa/asoundlib.h snd_pcm_htimestamp -lasound
1 #include

There is no error here and alsa is successfully included in the ffmpeg build

Best Solution

https://github.com/guardianproject/android-ffmpeg

https://github.com/guardianproject/android-ffmpeg/commit/f08db49e613a7ea4423effb22973e3f1afefb819

look at the links. he just did a commit , including 'freetype2' submodule, in order to get around the pkg-config issue.

Related Question