I've been tryin' to compile x264 for Android with Thread Support...But with no success...
I've managed to compile the same without thread support...The configure command is as follows :
./configure --prefix=$PREFIX \
--enable-pic \
--host=arm-linux \
--disable-cli \
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \
--sysroot=$PLATFORM
where PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86 and
PLATFORM=$NDK/platforms/android-14/arch-arm
I've also tried with and without the option --enable-static and extra-ldflags="-lpthread", but when attempted make it ends with errors.
Is there any way to accomplish the above said...?
The error that seemed to appear in config.log in context to thread support was cannot find lpthread...
That got resolved by manually removing the -lpthread from the configure file.
But then the configuration started failing at the test that included the struct cpu_set_t and CPU_COUNT()...
Seems that certain libc functions and definitions are not included in the code provided with Android NDK (R8D)...In the above case CPU_COUNT() and the definition for struct cpu_set_t...
The workaround for the above was to patch sched.h with the latest version...
There are a few bug reports in the Android Issue List describing the same problem which would hopefully be addressed in the next NDK release...
Also x264 could be compiled to include the " ARM Support Feature " by including the option --extra-cflags="-mfloat-abi=softfp"...
Related
I am trying for over one week to compile OpenCV 3.1.0 for Android with NDK r18 on Ubuntu 18.04.
I have used the following command:
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DANDROID_NDK="/home/qamaruddin/Downloads/android-ndk-r18-linux-x86_64/android-ndk-r18/" \
-DCMAKE_TOOLCHAIN_FILE="/home/qamaruddin/Downloads/android-ndk-r18-linux-x86_64/android-ndk-r18/build/cmake/android.toolchain.cmake" \
-DANDROID_NATIVE_API_LEVEL=19 \
-DANDROID_ABI="armeabi-v7a" \
-DWITH_CUDA=OFF \
-DWITH_MATLAB=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DOPENCV_EXTRA_MODULES_PATH="/opt/opencv_contrib/modules/" \
-DCMAKE_INSTALL_PREFIX:PATH="/home/mig-ocv/ocv-android-310/" \
-DEXECUTABLE_OUTPUT_PATH:PATH="/home/mig-ocv/ocv-android-310/" \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH="/home/mig-ocv/ocv-android-310/" \
-DCMAKE_BUILD_TYPE=Release \
/opt/opencv
Follwed by make & make install/strip.
I have tried different versions of OpenCV 3 such as 3.1.0, 3.4.3, and 3.4.0. I have also tried NDKr15c, NDKr17c, and NDKr18c.
I have tried the following variations:
Change NDK version
Change OpenCV 3 version
Install using python script located at opencv/platforms/androind/setup.py
Build using CMAKE
Use Ninja for CMAKE, but this gives the error: "ninja: error: loading 'build/build.global.ninja': No such file or directory"
Install without Ninja with CMAKE
At the moment, using the above-posted command for CMAKE builds successfully, but I can't change the target install dir since it always builds into /usr/local/ and when I inspect the target directory it does not have the familiar OpenCV for Android structure which is:
1- etc
2- java
3- native --> jni --> include
I wonder what is wrong in my process that makes it so difficult to build OpenCV 3 from source for Android with OpenCV Contrib.
Note that $ANDROID_HOME is set to the android SDKs directory on my system and $ANDROID_NDK is also set.
I have seen all duplicate questions on StackOverflow and other forums, but none seems to work in my case.
When I try to build with Ninja with this command:
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DANDROID_NDK="$HOME/Downloads/android-ndk-r17b/" \
-DCMAKE_TOOLCHAIN_FILE="$HOME/Downloads/android-ndk-r17b/build/cmake/android.toolchain.cmake" \
-DANDROID_NATIVE_API_LEVEL=21 \
-DANDROID_ABI="armeabi-v7a" \
-DWITH_CUDA=OFF \
-DWITH_MATLAB=OFF \
-DBUILD_ANDROID_EXAMPLES=OFF \
-DBUILD_DOCS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_TESTS=OFF \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++ \
-DCMAKE_C_COMPILER=/usr/bin/clang \
-DOPENCV_EXTRA_MODULES_PATH="$HOME/ocv/opencv_contrib/modules/" \
-DCMAKE_INSTALL_PREFIX:PATH="$HOME/agusta/ocv-android-310/" \
-DEXECUTABLE_OUTPUT_PATH:PATH="$HOME/agusta/ocv-android-310/" \
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH="$HOME/agusta/ocv-android-310/" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \
$HOME/ocv/opencv
I get:
CMake Deprecation Warning at CMakeLists.txt:72 (cmake_policy):
The OLD behavior for policy CMP0022 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:77 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
CMake Deprecation Warning at CMakeLists.txt:82 (cmake_policy):
The OLD behavior for policy CMP0042 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Check for working CXX compiler: /home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
CMake Error: Generator: execution of make failed. Make command was: "/usr/bin/ninja" "cmTC_c4cee/fast"
-- Check for working CXX compiler: /home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -- broken
CMake Error at /usr/local/share/cmake-3.12/Modules/CMakeTestCXXCompiler.cmake:45 (message):
The C++ compiler
"/home/qamaruddin/Downloads/android-ndk-r17b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /home/qamaruddin/agusta/temp/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/ninja" "cmTC_c4cee/fast"
No such file or directory
Generator: execution of make failed. Make command was: "/usr/bin/ninja" "cmTC_c4cee/fast"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:93 (project)
-- Configuring incomplete, errors occurred!
See also "/home/qamaruddin/agusta/temp/CMakeFiles/CMakeOutput.log".
See also "/home/qamaruddin/agusta/temp/CMakeFiles/CMakeError.log".
You have changed variables that require your cache to be deleted.
Configure will be re-run and you may have to reset some variables.
The following variables have changed:
CMAKE_CXX_COMPILER= /usr/bin/clang++
CMAKE_C_COMPILER= /usr/bin/clang
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
BUILD_ANDROID_EXAMPLES
BUILD_DOCS
BUILD_PERF_TESTS
BUILD_TESTS
EXECUTABLE_OUTPUT_PATH
OPENCV_EXTRA_MODULES_PATH
WITH_CUDA
WITH_MATLAB
-- Build files have been written to: /home/qamaruddin/agusta/temp
I have managed to get it to work, basically, OCV didn't support NDKr18, and I also had to install ninja from source. I have also used python3 instead of python2 to run the opencv/platforms/android/build_sdk.py . One more thing is that I use Eclipse Android ADT which Google has for no reason deprecated ;(, but I find it super fast compared to the heavy Android Studio.
# export ANDROID_ABI=armeabi-v7a
# export ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.8
# export ANDROID_NDK=$HOME/Downloads/android-ndk-r17c-linux-x86_64/android-ndk-r17c/
# export ANDROID_SDK=$HOME/android-sdks/
./../opencv/platforms/android/build_sdk.py --extra_modules_path=/opt/opencv_contrib/modules --config ../opencv/platforms/android/ndk-17.config.py
I'm in the process of updating my applications FFmpeg version from 2.8.6 to 3.4.2. I've managed to get FFmpeg built, but when I build my native library I'm getting a linker error:
/usr/local/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /shared/dev/libs/ffmpeg/3.4.2/lib/android-x86/libswresample.so:1:1: invalid character
/usr/local/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /shared/dev/libs/ffmpeg/3.4.2/lib/android-x86/libavcodec.so:1:1: invalid character
/usr/local/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /shared/dev/libs/ffmpeg/3.4.2/lib/android-x86/libavfilter.so:1:1: invalid character
/usr/local/android-sdk/ndk-bundle/toolchains/x86-4.9/prebuilt/darwin-x86_64/lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: /shared/dev/libs/ffmpeg/3.4.2/lib/android-x86/libavutil.so:1:1: invalid character
The libraries are correct, but I don't understand where the :1:1: is coming from (assuming the trailing : is probably a delineator between the command and the error message). The path to the library is correct, but the filename definitely does not have a :1:1 in it.
I'm building on a Mac, so the first thing I do is:
sed -i ".orig" "s/SHFLAGS='-shared -Wl,-soname,\$(SLIBNAME)'/SHFLAGS='-shared -Wl,-install_name,\$(SLIBNAME)'/g" configure
so that ld uses the -install_name flag, rather than -soname. I used to have to do some other configure manipulation to strip the library naming out, but that doesn't seem to be necessary anymore (even if I do it I still get the same error).
FFmpeg was built using the following options:
./configure --prefix=output --enable-shared --disable-everything
--disable-iconv --disable-zlib --disable-bzlib
--enable-encoder=aac --enable-decoder=aac --enable-encoder=pcm_alaw
--enable-decoder=pcm_alaw --enable-encoder=pcm_mulaw
--enable-decoder=pcm_mulaw --enable-encoder=adpcm_g726
--enable-decoder=adpcm_g726 --enable-encoder=adpcm_ima_wav
--enable-decoder=adpcm_ima_wav --enable-encoder=mjpeg
--enable-decoder=mjpeg --enable-encoder=wmav1
--enable-decoder=wmav1 --enable-encoder=wmav2
--enable-decoder=wmav2 --enable-encoder=wmv1 --enable-decoder=wmv1
--enable-encoder=wmv2 --enable-decoder=wmv2
--enable-encoder=h264_vaapi --enable-encoder=hevc_vaapi
--enable-encoder=h264_nvenc --enable-encoder=hevc_nvenc
--enable-encoder=h264_omx --enable-encoder=h264_qsv
--enable-encoder=hevc_qsv --enable-decoder=aac_fixed
--enable-decoder=aac_latm --enable-decoder=adpcm_g726le
--enable-decoder=h263 --enable-decoder=h264 --enable-decoder=hevc
--enable-decoder=mjpegb --enable-decoder=mpeg4
--enable-decoder=h264_qsv --enable-decoder=h264_vdpau
--enable-decoder=hevc_qsv --enable-decoder=hevc_qsv
--enable-filter=scale --enable-filter=scale_vaapi
--enable-filter=scale_cuda --enable-filter=scale_npp
--enable-filter=scale_qsv --enable-parser=aac --enable-parser=h263
--enable-parser=h264 --enable-parser=hevc --enable-parser=mjpeg
--enable-muxer=asf --enable-demuxer=asf --enable-muxer=avi
--enable-demuxer=avi --enable-muxer=h263 --enable-demuxer=h263
--enable-muxer=h264 --enable-demuxer=h264 --enable-muxer=hevc
--enable-demuxer=hevc --enable-muxer=mjpeg --enable-demuxer=mjpeg
--enable-muxer=pcm_alaw --enable-demuxer=pcm_alaw
--enable-muxer=pcm_mulaw --enable-demuxer=pcm_mulaw --enable-muxer=wav
--enable-demuxer=wav --enable-demuxer=aac --enable-hwaccel=h264_d3d11va
--enable-hwaccel=hevc_d3d11va --enable-hwaccel=h264_d3d11va2
--enable-hwaccel=hevc_d3d11va2 --enable-hwaccel=h264_dxva2
--enable-hwaccel=hevc_dxva2 --enable-hwaccel=h264_vaapi
--enable-hwaccel=hevc_vaapi --enable-hwaccel=h264_vdpau
--enable-hwaccel=hevc_vdpau --enable-hwaccel=h264_nvenc
--enable-hwaccel=hevc_nvenc --enable-hwaccel=h264_qsv
--enable-hwaccel=hevc_qsv --enable-hwaccel=h264_vdpau
--enable-hwaccel=hevc_vdpau --disable-programs --enable-cross-compile
--cross-prefix=/shared/dev/toolchain/android/darwin-x86_64/ndk-r16/android-19/arm/bin/arm-linux-androideabi-
--arch=arm --target-os=android --disable-asm --disable-stripping
--disable-static --cc=clang --enable-pic
NDK toolchain is a standalone x86 toolchain built using NDK r16's make_standalone_toolchain.py tool.
The native project is built using CMake and using the clang android toolchain.
I've also got an arm version that gives the same linker error.
I'm not sure where exactly to start looking. Did this come from the build config options? I had to do quite a bit of tweaking to get it to build using NDK r16, but it was mostly stuff like adding --disable-stripping and changing --target-os from linux to android. Is it something with the NDK r16 toolchain?
Does anyone have any idea what the problem might be, or where I might start looking?
Ok, I figured this out.
It turns out that passing --cc=clang will configure the makefiles to use the system clang, not the clang available in the provided --cross-prefix. This was resulting in a binary built for the Darwin-x86_64 architecture, and NOT the Android x86 or Android ARM architectures.
Fix was to pass the complete path to the clang compiler with the --cc configure option.
I've made my build script available on GitHub for anyone else having trouble building FFmpeg for Android using NDK r16b:
android-ffmpeg-buildscript
I have followed lots of tutorials for buildinf ffmpeg.so file like
http://enoent.fr/blog/2014/06/20/compile-ffmpeg-for-android/
http://www.roman10.net/how-to-build-ffmpeg-with-ndk-r9/
and many more tutorials but at last i have stuck to this error every time i dont know how to resolve it please any one knows how to solve it then help me
my build.sh file look like this
NDK=C:/Users/Benzatine/Downloads/android-ndk-r10e
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains//arm-linux-androideabi-4.8/prebuilt/windows-x86_64
function build_one
{
./configure \
--prefix=$PREFIX \
--enable-shared \
--disable-static \
--disable-doc \
--disable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-avdevice \
--disable-doc \
--disable-symver \
--cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--target-os=linux \
--arch=arm \
--enable-cross-compile \
--sysroot=$SYSROOT \
--extra-cflags="-Os -fpic $ADDI_CFLAGS" \
--extra-ldflags="$ADDI_LDFLAGS" \
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU
ADDI_CFLAGS="-marm"
build_one
But when it executes make command it gives following error
LD libswscale/libswscale-3.so
c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error: libavutil/libavutil.so:1:1: syntax error, unexpected '!', expecting $end
c:/users/benzatine/downloads/android-ndk-r10e/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld.exe: error: libavutil/libavutil.so: not an object or archive
collect2.exe: error: ld returned 1 exit status
library.mak:111: recipe for target 'libswscale/libswscale-3.so' failed
make: *** [libswscale/libswscale-3.so] Error 1
every time i try to build ffmpeg this error occure how to resolve it please someone help me
I am going to assume that you are building it on Windows system based on the error message.
I just found this post on Facebook group so I am not going to take any credit for it.Bascially he just use other project and tweak it to make it work forcefully.It use Android 'Love' version and compile it in Windows system.
FFMpeg (https://www.ffmpeg.org), one of the most used libary written in C programming language for multimedia related task.
It has a lot of feature to add multimedia support for your application but the trouble being a 'C' library we have
port it into other language if you don't want to create your application in C/C++. Trust me porting it into
different language is a lot of work which are filled with error. Luckily you can find tutorial and easy build
script in the internet but unfountenly , they are only written by assumption that you are porting it
into nix based OS and the few tutorial on porting it on Windows OS does not work (atleast for me. :) )
But the main reason I am using ffmpeg is to add a multimedia feature to the android which are not
provided by standard Android API. I found some pre-made android project on an internet
which use FFMpeg 'Love' version. Here is the project.
In case you are wondering how to use it in your Android project , here are the step
1) Add a native support to the Android Project by right-clicking the Android Tools>Add Native Support...
2) Copy 'armeabi' folder to 'libs' folder of your project
3) Replace 'obj' folder with the 'obj' of ffmpeg project in the attached file
4) Add 'ffmpeg' folder to the 'jni' folder
5) Replace 'Androd.mk' folder with the 'Android.mk' of the ffmpeg project in the attached file
6) Write your code in C/C++ and enjoy
As always if you have any trouble or question you can comment them and I will answer them as soon as possible
Attached file:http://robot-mitya.googlecode.com/files/MyFfmpegTest.zip
Source:http://dmitrydzz-hobby.blogspot.com/2012/04/how-to-build-ffmpeg-and-use-it-in.html
I've been trying to compile FFMPEG so I can use it with my Android application with commands. The result should be 1 static file, "ffmpeg", that is not package dependent. No .so files.
I managed to compile it with guardianProject and everything is working but the source was too old and lacks options I need.
I'm using the latest Ubuntu on VirtualBox, all essentials are installed and updated (gawk, yasm, aptitude, etc...).
There are multiple examples around the web. Here are the issues I've experienced with each of the options I tried. I'd appreciate help with either one of the following errors:
Guardian project - I managed to compile it and get the ffmpeg file but it uses an old version of ffmpeg that doesn't include the "-movFlags faststart" option. I tried throwing the new ffmpeg (2.3.3) in there but it just throws error. (I ran git submodule init and update)
JayH5 - A more generic build file that basically should work with every ffmpeg. I updated the build script to work with the latest NDK and it seems to be working but than it fails on /home/dor/Desktop/ndk/android-ndk-r10/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/arm-linux-androideabi-pkg-config not found, library detection may fail.
I read about this and it seems to require a hack, which I don't understand how to implement.
Trovao - this is a very nice project and the build script even downloads the latest ffmpeg and x264 sources, and I even succeeded in compiling it to FFMPEG and X264 files but when I use it, I get this error: could not load library "libx264.so.142 which is weird, as x264 is there and the whole idea of this project is to cancel the need of .so files.
I'd appreciate help with figuring out how to solve any of the issues. I prefer using the JayH5 build script as it seems the most straight forward out there...
JayH5 build file:
#!/bin/bash
# set the base path to your Android NDK (or export NDK to environment)
if [[ "x$NDK_BASE" == "x" ]]; then
NDK_BASE=/opt/android-ndk
echo "No NDK_BASE set, using $NDK_BASE"
fi
NDK_PLATFORM_VERSION=14
NDK_ABI=arm
NDK_COMPILER_VERSION=4.8
NDK_SYSROOT=$NDK_BASE/platforms/android-$NDK_PLATFORM_VERSION/arch-$NDK_ABI
NDK_UNAME=`uname -s | tr '[A-Z]' '[a-z]'` # Convert Linux -> linux
HOST=$NDK_ABI-linux-androideabi
NDK_TOOLCHAIN_BASE=$NDK_BASE/toolchains/$HOST-$NDK_COMPILER_VERSION/prebuilt/$NDK_UNAME-x86
CC="$NDK_TOOLCHAIN_BASE/bin/$HOST-gcc --sysroot=$NDK_SYSROOT"
LD=$NDK_TOOLCHAIN_BASE/bin/$HOST-ld
BUILD_PATH=build/ffmpeg
./configure \
$DEBUG_FLAG \
--arch=arm \
--target-os=linux \
--enable-runtime-cpudetect \
--enable-pic \
--disable-shared \
--enable-static \
--cross-prefix=$NDK_TOOLCHAIN_BASE/bin/$NDK_ABI-linux-androideabi- \
--sysroot="$NDK_SYSROOT" \
--extra-cflags="-march=armv7-a -mfloat-abi=softfp -fPIC -DANDROID" \
--extra-ldflags="" \
--enable-ffmpeg \
--disable-ffplay \
--disable-ffprobe \
--disable-ffserver \
--disable-network \
After 2 days of compiling FFMPEG files that just didn't work, I finally succeeded!
In the above build.sh file, just add these 4 lines and the bottom to avoid the prebuilt/linux-x86/bin/arm-linux-androideabi-pkg-config not found, library detection may fail error.
Add to file:
$ADDITIONAL_CONFIGURE_FLAG
make clean
make
make install
Don't forget to chmod 775 ffmpeg file after the process is finished.
Really hope this will help others!
If you want FFMPEG with libX264 support, use this project - just perfect.
https://github.com/hiteshsondhi88/ffmpeg-android/
I'm trying to build all-in-one static binary of FFMPEG with NDK r7b and everything works fine untill i try to build it with RTMP support.
I'm usind sources from https://github.com/guardianproject/android-ffmpeg with librtmp2.4 and custom config like this
.configure \
--target-os=linux \
--cross-prefix=arm-linux-androideabi- \
--arch=arm \
--sysroot=/home/andrey/android-ndk-r7b/platforms/android-3/arch-arm \
--enable-static \
--disable-shared \
--disable-symver \
--enable-small \
--disable-devices \
--disable-avdevice \
--enable-gpl \
--enable-librtmp \
--prefix=../build/ffmpeg/armeabi \
--extra-cflags=-I../rtmpdump/librtmp \
--extra-ldflags=-L../rtmpdump/librtmp \
and rtmpdump directory lays on the same level as ffmpeg.
As i understand last two strings in my config says where compiler may find sources of librtmp.
But all i get is ERROR: librtmp not found
I'm not expereienced with NDK and obviosly i missing some important part but i can't find it by myself.
This is challenging, but I think I have a solution. The problem at configure-time is that FFmpeg wants to detect a proper librtmp installation via the pkg-config management system.
I'm assuming your have successfully cross-compiled librtmp in the directory referenced by ../rtmpdump. Edit the FFmpeg configure script and search for the line:
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
Comment that out (put a '#' at the front of the line). Now, re-run configure, only with these modifications:
--extra-cflags="-I/full/path/to/rtmpdump"
It may help to have an absolute path here. Also, omit /librtmp/ at the end since the #include directives already prefix the header files with librtmp/. Next:
--extra-ldflags="-L/full/path/to/rtmpdump -lrtmp"
Again, absolute path, and specify the library to link against since we commented out that logic via configure.
Now, configure should succeed and the cross-compilation should also be happy. The final ffmpeg binary should report the family of RTMP modules under protocols:
ffmpeg -protocols
[...]
rtmp
rtmpe
rtmps
rtmpt
rtmpte
Note that I don't have an NDK dev environment to test this on. But I tested on my desktop Ubuntu system by compiling librtmp (without the package being installed via pkg-config) and then performing the above steps.