Compile librtmp for Android and librtmpandroid

Source: Internet
Author: User

Compile librtmp for Android and librtmpandroid

Librtmp is a powerful open-source rtmp library. A recent Android project involves technologies such as rtmp. It was used before when ffmepg was used, at that time, it was just as a module that compiled librtmp into ffmpeg as a third-party library (ffmpeg itself also supports rtmp ).
Preparations for porting librtmp to Android:
1. Prepare the NDK and configure the environment variables.
2. Of course, the installation package of librtmp is ready.

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

The next step is to propose some ndk compilation tools, which are suitable for compiling environments on the android platform, such as arm-linux-androideabi-gcc.
/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
Set Environment Variables

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

Download polarssl-1.2.14 (mbed TLS (formerly known as PolarSSL) is best to download this version, otherwise the following will report an error when compiling librtmp. Https://tls.mbed.org/bottom right has Latest updates has this version
Before compilation#define POLARSSL_HAVEGE_COtherwise, it will appear during librtmp compilation.undefined reference toHavege_random ''error, because polarssl disables the havege module by default.

make CC=arm-linux-androideabi-gcc APPS=make install DESTDIR=/home/lide/work/lide/lide/sysroot

Compile (librtmp is a dynamic library)

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

To use the static library of librtmp, use

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

Now, you have obtained the library of librtmp for android, and you can use it for development in android. In the next section, we will first introduce the use of android jni to start a journey to android C ~~~~

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.