build ffmpeg for armv7 and armv7s

Here is my working Configure for cross-compiling FFmpeg on iOS 6 the arch is ARMv7

NOTE: You must have to have gas-preprocessor.pl inside /usr/local/bin/ please do not continue until you have gas-preprocessor.pl on your bin directory

  • Download FFmpeg 1.0 "Angel" from here

  • Unzip it and place it somewhere i.e. your Desktop folder

  • Open terminal and browse to unzipped FFmpeg folder

  • Copy and paste the following command, (be patient will take a while)

./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7' --extra-ldflags='-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm

  • Now type the following command on terminal make (wait a little more)

  • Once it has finished now type on terminal sudo make install (wait again)

  • Go to /usr/local/lib to find your freshly baked armv7 libs

  • Enjoy!


    Added Support for armv7s

    This armv7s configure is totally untested and i dont really know if this would work, i don't own an iPhone 5 so we need someone to test the final armv7s libs

    ./configure --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffserver --enable-cross-compile --arch=arm --target-os=darwin --cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc --as='gas-preprocessor/gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk --cpu=cortex-a8 --extra-cflags='-arch armv7s' --extra-ldflags='-arch armv7s -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk' --enable-pic --enable-decoder=rawvideo --disable-asm


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是编译FFmpeg ARMv7-A版本的步骤: 1. 首先,你需要下载NDK工具包并解压。你可以从这里下载最新版本:https://developer.android.com/ndk/downloads/ 2. 接着,你需要下载FFmpeg源代码。你可以从这里下载最新版本:https://ffmpeg.org/download.html 3. 解压FFmpeg源代码并进入解压后的目录。 4. 执行以下命令以配置FFmpeg: ``` ./configure \ --disable-shared \ --enable-static \ --arch=arm \ --target-os=android \ --enable-cross-compile \ --cross-prefix=$NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi21- \ --sysroot=$NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/sysroot \ --extra-cflags="-march=armv7-a -mfloat-abi=softfp -mfpu=neon" \ --extra-ldflags="-L$NDK_HOME/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a -lc++_static" ``` 其中,$NDK_HOME是你解压NDK工具包的路径。上述命令的作用是配置FFmpeg,禁用共享库,启用静态库,指定编译目标为ARMv7-A架构,指定编译目标操作系统为Android,启用交叉编译,指定交叉编译工具链前缀,指定系统根目录,设置编译器选项和链接器选项。 5. 执行以下命令以编译FFmpeg: ``` make -j4 ``` 其中,-j4表示使用4个线程进行编译,你可以根据自己的情况进行调整。 6. 编译完成后,你可以在当前目录下的lib目录中找到编译好的静态库文件libavcodec.a、libavformat.a、libavutil.a等。 7. 最后,你可以将这些静态库文件打包成一个共享库文件,以便在Android应用中使用。你可以使用Android Studio或者手动编写Android.mk文件进行打包。 以上就是编译FFmpeg ARMv7-A版本的步骤,希望能对你有所帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值