jkkj93 / FREYA-LIVE-LIBRARY-OPTIMIZER-FOR-ANDROID

:zap:一套RTMP直播推流常用库的编译简化/优化工具(面向安卓设备),简单配置后能一键完成库文件的编译与优化(FFMPEG+X264+FDKAAC+LIBRTMP/FFMPEG NATIVE RTMP+LIBYUV),针对ARM、ARMV7-A、ARM64-V8A、X86、X86_64、MIPS、MIPS64全平台极致优化。
GNU General Public License v2.0
127 stars 77 forks source link

How to use this library in android? #1

Closed wmsgeek closed 7 years ago

wmsgeek commented 7 years ago

Hello, i have the following files how to use them in android?

FREYA-LIVE-LIBRARY-OPTIMIZER-FOR-ANDROID/freya_build_finished/armeabi/lib# ls libavcodec.a libavfilter.a libavresample.a libfdk-aac.a libpostproc.a libswresample.a libx264.a pkgconfig libavdevice.a libavformat.a libavutil.a libpolarssl.a librtmp.a libswscale.a libyuv.a

jkkj93 commented 7 years ago

These static library files are used for JNI development of Android Application. To use them,It's necessary to have a good command of JNI development. Basically you can adopt the following steps:

1.Using "#include" to import the header files in your JNI source code,After that it will be available to use the functions within the library files in your JNI source code. e.g. #include "include/libavcodec/avcodec.h"

2.You should prepare two files called Android.mk and Application.mk as configuration files. references: https://developer.android.com/ndk/guides/android_mk.html https://developer.android.com/ndk/guides/application_mk.html

3."cd" to the path which JNI source code,Android.mk and Application.mk are saved.Use "ndk-build APP_BUILD_SCRIPT=./Android.mk NDK_APPLICATION_MK=./Application.mk NDK_PROJECT_PATH=./" to build the ".so" files.Copy the ".so" files to the "jniLibs" directory of your Android Application.Then you can call the functions which have exported(using JNIEXPORT) in the ".so" files with java codes.

wmsgeek commented 7 years ago

Thanks for the info, would it be possible for you to make a sample app for newbies like me?my plan is to use it as a livestream player (full screen) that will be great :)

jkkj93 commented 7 years ago

These library files are used in another project of mine called "FREYA STREAM CASTER SDK".It's a RTMP livestream pusher sdk. Although I decided to make it private for a period of time,You could still find a forked version here: https://github.com/jkkj93/FREYA-STREAM-CASTER-SDK-FOR-ANDROID

If you want to develop a livestream player,I would like to recommend you a project: https://github.com/Bilibili/ijkplayer

wmsgeek commented 7 years ago

Ijkplayer doesnt include Librtmp AFAIK. :(

jkkj93 commented 7 years ago

To add librtmp to the ijkplayer,There are some references here: http://blog.csdn.net/mikulee/article/details/53524199 http://blog.csdn.net/lyqaizhy/article/details/49077027

I haven't tried whether these ways work.Good luck.