Compiling librtmp for Android

Source: Internet
Author: User

Librtmp is a powerful rtmp open Source Library, a recent Android project involving RTMP and other technologies, before using FFMEPG used it, At that time it was just as a module to compile librtmp as a third-party library into FFmpeg (FFmpeg itself also supports rtmp).
What you need to do to get librtmp ported to Android:
1. Prepare the NDK and configure the environment variables
2. Of course it's ready for LIBRTMP's installation package.

    clone git://git.ffmpeg.org/rtmpdump

The next step is to propose some of the NDK's compilation tools for the build environment under the Android platform, such as ARM-LINUX-ANDROIDEABI-GCC, etc.
/home/android-ndk-r10e/build/tools/make-standalone-toolchain.sh --toolchain=arm-linux-androideabi-4.8 --platform=android-14 --install-dir=/home/lide/work/lide/lide
Setting environment variables

PATH=/home/lide/work/lide/lide/bin:$PATH
source /etc/profile

Download polarssl-1.2.14 (mbed TLS (formerly known as POLARSSL)) it is best to download this version, or the bottom of the compilation librtmp when the error. There's latest updates in the lower right corner of the https://tls.mbed.org/version.
The comments in the include/polarssl/config.h are #define POLARSSL_HAVEGE_C removed before compiling, otherwise the Havege_random ' error occurs when compiling the librtmp undefined reference to , because the Havege module is closed by default for Polarssl.

CCAPPSDESTDIR=/home/lide/work/lide/lide/sysroot

Compile (librtmp as a dynamic library)

make SYS=android CROSS_COMPILE=arm-linux-androideabi- INC="-I/home/lide/work/lide/lide/sysroot/include" CRYPTO=POLARSSL

If you want to use Librtmp's static library, use the

make SYS=android CROSS_COMPILE=arm-linux-androideabi- INC="-I/home/lide/work/lide/lide/sysroot/include" CRYPTO=POLARSSL SHARED=

At this point, you've got Librtmp's Android repository, and then you can do it under Android. The next section introduces the use of the JNI for Android, start the Android C Tour ~ ~ ~ ~

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Compiling librtmp for Android

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.