1 Star 0 Fork 0

拉风的道长/FFmpeg-Android

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

FFmpeg-Android

Herein lies scripts and instructions for compiling FFmpeg for Android with RTMP support. Much thanks to Chris Ballinger and Liu Feipeng.

Instructions

Optional RTMP support dependencies

If you'd like to build FFmpeg with --enable-librtmp, first download and build OpenSSL and librtmp:

OpenSSL

  1. The GuardianProject have a great project that makes building as simple as invoking ndk-build.

librtmp

  1. Clone RTMPDump, and copy build_librtmp_for_android.sh into the ./librtmp subdirectory.

     $ git clone git://git.ffmpeg.org/rtmpdump
     $ cp /path/to/build_librtmp_for_android.sh ./rtmpdump/librtmp
     $ ./rtmpdump/librtmp/build_librtmp_for_android.sh
    
  2. Modify the header variables in build_librtmp_for_android.sh as appropriate:

     #build_librtmp_for_android.sh
     NDK=/path/to/your/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/your/openssl-android/
     ...
    

Building FFmpeg

  1. Download the FFmpeg source you desire (This process is tested with 2.1.3)

  2. Modify configure ever so slightly to conform to the Android NDK build system:

     # ffmpegX.X.X/configure
     ...
     # Replace the following lines:
     
     #SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
     #LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
     #SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
     #SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
     
     # With: 
     
     SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
     LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
     SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
     SLIB_INSTALL_LINKS='$(SLIBNAME)'
    

If building with RTMP support: Also modify the following line of configure:

    # Replace this:
    enabled librtmp    && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
    # With this:
    enabled librtmp    && require librtmp librtmp/rtmp.h RTMP_Socket -L/path/to/rtmpdump/librtmp/android/arm/lib -lrtmp
  1. Copy build_ffmpeg_for_android.sh or build_ffmpeg_with_librtmp_for_android.sh to ffmpegX.X.X/ and run! a. Make sure the script is executable:

    	$ sudo chmod +x build_ffmpeg_for_android.sh    
    

    b. Make any desired changes to build_ffmpeg_for_android.sh per your build target. c. Run!

    	$ ./build_ffmpeg_for_android.sh	
    	# or to build with debugging symbols:
    	$ ./build_ffmpeg_debug_for_android.sh
    

The result will be a collection of static libraries and headers at ffmpegX.X.X/android/

Note on Building with Debugging Symbols

We had to pass the -gdwarf-2 flag to gcc to properly generate debugging symbols for the ffmpeg libraries. A lot was going on, and perhaps instead something yet unexplained happened at a sub-atomic level.

空文件

简介

包含了如何编译rtmp的sh https://github.com/OnlyInAmerica/FFmpeg-Android.git 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Android
1
https://gitee.com/huyistudio/FFmpeg-Android.git
git@gitee.com:huyistudio/FFmpeg-Android.git
huyistudio
FFmpeg-Android
FFmpeg-Android
master

搜索帮助