Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cross-compiling librtmp for android

Tags:

android

ffmpeg

Has anybody out there successfully cross-compiled librtmp for the Android platform? I know that the rtmpdump android download has librtmp.so included, but I think I need librtmp.a also (I am trying to cross-compile ffmpeg with librtmp support).

Anybody had any luck with this? It's driving me bonkers....

Ta

Dan

like image 736
Dan Turner Avatar asked Jan 30 '13 15:01

Dan Turner


2 Answers

have a look here http://stream-recorder.com/forum/rtmpdump-build-android-t13466.html and I've put a howto on my github here https://github.com/S74ck3r/rtmpdump/blob/master/readme-howto-build.txt

hope that helps Richard

like image 119
Richard Avatar answered Nov 03 '22 22:11

Richard


I* just successfully built librtmp for Android using the Guardian Project's OpenSSL repo. I documented my steps here along with preserved build scripts.

In a nutshell, build OpenSSL per GuardianProject's directions, then run the following script in rtmpdump/librtmp:

#build_librtmp_for_android.sh
NDK=/path/to/android-ndk-r9c
SYSROOT=$NDK/platforms/android-19/arch-arm/
TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64
OPENSSL_DIR=/path/to/openssl-android/
# Note: Change the above variables for your system. Also ensure you've built openssl-android
function build_one
{
    set -e
    make clean
    ln -s ${SYSROOT}usr/lib/crtbegin_so.o
    ln -s ${SYSROOT}usr/lib/crtend_so.o
    export XLDFLAGS="$ADDI_LDFLAGS -L${OPENSSL_DIR}libs/armeabi -L${SYSROOT}usr/lib "
    export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-androideabi-
    export XCFLAGS="${ADDI_CFLAGS} -I${OPENSSL_DIR}include -isysroot ${SYSROOT}"
    export INC="-I${SYSROOT}"
    make prefix=\"${PREFIX}\" OPT= install
}
CPU=arm
PREFIX=$(pwd)/android/$CPU 
ADDI_CFLAGS="-marm"
build_one

*with the incredible help of my pal Chris.

like image 42
dbro Avatar answered Nov 04 '22 00:11

dbro