【FFMEPG】windows下编译ffmpeg2.5——使用VS2013,ARMLINUX,ANDORID编译ffmpeg

原文:http://blog.csdn.net/finewind/article/details/42784557

一、准备:

1. 本机环境: win7 64bit;

2. 安装MinGW到C:\MinGW,下载地址http://www.mingw.org/;

3. 安装yasm,下载地址http://yasm.tortall.NET/;

(2,3步请参考http://blog.csdn.net/finewind/article/details/38854517)

4. 下载ffmpeg源码:我是从https://github.com/FFmpeg/FFmpeg上拉的release/2.5分支;

二、使用VS2013编译ffmpeg2.5:

VS2013已基本完整支持C99,使用VS2013,可以省去C89到C99的转换过程,并且FFMPEG2.5版本已经完整支持msvc工具链(实际FFMPEG2.3即已经支持),这使得使用VS2013编译ffmpeg变得异常简单,详细步骤可参考http://blog.csdn.net/finewind/article/details/38854517

1. 安装VS2013,假设装在D盘;

2. 编辑C:\MinGW\msys\1.0\msys.bat文件,在此文件的最前面(@echo off之后)添加一行如下内容:

[plain]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. call "D:\Program Files(x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat"  

3. 重命名 C:/MinGW/msys/1.0/bin/link.exe 为link_renamed.exe;

4. 在FFMPEG代码目录下新建文件build_msvc.sh,内容如下:

[plain]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. #!/bin/sh  
  2.   
  3. # for msvc  
  4. MSVC_PREFIX=$(pwd)/out/msvc       
  5.   
  6. function build_msvc  
  7. {  
  8. ./configure     \  
  9.     --prefix=$MSVC_PREFIX \  
  10.     --enable-static     \  
  11.     --enable-shared     \  
  12.     --enable-debug      \  
  13.     --toolchain=msvc  
  14. make clean  
  15. make          
  16. make install      
  17. }  
  18.   
  19. build_msvc  
5. 双击C:\MinGW\msys\1.0\msys.bat文件,在打开的命令行窗口下切换到ffmpeg源码目录,为build_msvc.sh添加执行权限,并执行;

6. 等待脚本执行完成。

二、使用Android NDK编译ffmpeg2.5:

1. 安装android ndk,下载地址:developer.android.com/tools/sdk/ndk/index.html,我使用的是ndk-r9d,安装目录为E:\android;

2. 在FFMPEG代码目录下新建文件build_android.sh,内容如下:

[plain]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. NDK=E:/android/android-ndk-r9d  
  2. SYSROOT=$NDK/platforms/android-19/arch-arm/  
  3. TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.8/prebuilt/windows-x86_64  
  4. PREFIX=$(pwd)/out/android  
  5.   
  6. function build_android  
  7. {  
  8. ./configure \  
  9.     --prefix=$PREFIX \  
  10.     --enable-shared \  
  11.     --disable-static \  
  12.     --disable-doc \  
  13.     --disable-ffmpeg \  
  14.     --disable-ffplay \  
  15.     --disable-ffprobe \  
  16.     --disable-ffserver \  
  17.     --disable-avdevice \  
  18.     --disable-doc \  
  19.     --disable-symver \  
  20.     --enable-cross-compile \  
  21.     --sysroot=$SYSROOT  \  
  22.     --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \  
  23.     --target-os=linux \  
  24.     --arch=arm  
  25. make clean  
  26. make  
  27. make install  
  28. }  
  29.   
  30. build_android  
3. 双击C:\MinGW\msys\1.0\msys.bat文件,在打开的命令行窗口下切换到ffmpeg源码目录,为build_android.sh添加执行权限,并执行;

4. 等待脚本执行完成。


三、使用ARM Linux工具链编译ffmpeg2.5:

1. 安装arm-none-linux-gnueabi-gcc,下载地址:http://www.veryarm.com/arm-none-linux-gnueabi-gcc,我使用的是windows安装版arm-2014.05-29-arm-none-linux-gnueabi.exe,安装路径:F:\arm-201405;

2. 在FFMPEG代码目录下新建文件build_armlinux.sh,内容如下:

[plain]  view plain  copy
  在CODE上查看代码片 派生到我的代码片
  1. TOOLROOT=F:/arm-201405  
  2. PREFIX=$(pwd)/out/armlinux  
  3.   
  4. function build_armlinux  
  5. {  
  6. ./configure \  
  7.     --prefix=$PREFIX \  
  8.     --enable-shared \  
  9.     --disable-static \  
  10.     --disable-doc \  
  11.     --disable-ffmpeg \  
  12.     --disable-ffplay \  
  13.     --disable-ffprobe \  
  14.     --disable-ffserver \  
  15.     --disable-avdevice \  
  16.     --disable-doc \  
  17.     --disable-symver \  
  18.     --enable-cross-compile \  
  19.     --sysroot=$TOOLROOT/arm-none-linux-gnueabi/libc  \  
  20.     --cross-prefix=$TOOLROOT/bin/arm-none-linux-gnueabi- \  
  21.     --target-os=linux \  
  22.     --arch=arm  
  23. make clean  
  24. make  
  25. make install  
  26. }  
  27.   
  28. build_armlinux  
3. 双击C:\MinGW\msys\1.0\msys.bat文件,在打开的命令行窗口下切换到ffmpeg源码目录,为build_armlinux.sh添加执行权限,并执行;

4. 等待脚本执行完成。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This is a FFmpeg Win64 shared build by Kyle Schwarz. Zeranoe's FFmpeg Builds Home Page: This build was compiled on: Dec 30 2014, at: 17:29:04 FFmpeg version: 2.5.2 libavutil 54. 15.100 / 54. 15.100 libavcodec 56. 13.100 / 56. 13.100 libavformat 56. 15.102 / 56. 15.102 libavdevice 56. 3.100 / 56. 3.100 libavfilter 5. 2.103 / 5. 2.103 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 This FFmpeg build was configured with: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib This build was compiled with the following external libraries: bzip2 1.0.6 Fontconfig 2.11.91 Frei0r 20130909-git-10d8360 GnuTLS 3.2.20 libiconv 1.14 libass 0.12.0 libbluray 0.6.2 libbs2b 3.1.0 libcaca 0.99.beta18 <http://caca.zoy.org
This is a FFmpeg Win64 shared build by Kyle Schwarz. Zeranoe's FFmpeg Builds Home Page: This build was compiled on: Dec 30 2014, at: 17:29:04 FFmpeg version: 2.5.2 libavutil 54. 15.100 / 54. 15.100 libavcodec 56. 13.100 / 56. 13.100 libavformat 56. 15.102 / 56. 15.102 libavdevice 56. 3.100 / 56. 3.100 libavfilter 5. 2.103 / 5. 2.103 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 3.100 / 53. 3.100 This FFmpeg build was configured with: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib This build was compiled with the following external libraries: bzip2 1.0.6 Fontconfig 2.11.91 Frei0r 20130909-git-10d8360 GnuTLS 3.2.20 libiconv 1.14 libass 0.12.0 libbluray 0.6.2 libbs2b 3.1.0 libcaca 0.99.beta18 FreeType 2.5.4 Game Music Emu 0.6.0 GSM 1.0.13-4 iLBC 20141214-git-ef04ebe Modplug-XMMS 0.8.8.5 LAME 3.99.5 OpenCORE AMR 0.1.3 OpenJPEG 1.5.2 Opus 1.1 RTMPDump 20140707-git-a1900c3 Schroedinger 1.0.11 libsoxr 0.1.1 Speex 1.2rc2 Theora 1.1.1 TwoLAME 0.3.13 vid.stab 0.98 VisualOn AAC 0.1.3 VisualOn AMR-WB 0.1.2 Vorbis 1.3.4 vpx 1.3.0 WavPack 4.70.0 WebP 0.4.2 x264 20141220-git-40bb568 x265 1.4 XAVS svn-r55 Xvid 1.3.3 XZ Utils 5.2.0 zlib 1.2.8 The source code for this FFmpeg build can be found at: This build was compiled on Debian 8.0 (64-bit): GCC 4.9.2 was used to compile this FFmpeg build: This build was compiled using the MinGW-w64 toolchain: Licenses for each library can be found in the 'licenses' folder.

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值