windows下编译ffmpeg

最近因项目需要,又搞了一次ffmpeg的编译工作,其中坑爹之事特别多,在这里做个记录,方便以后使用

首先下载编译工具和所需要的源码

MinGW+MSys http://sourceforge.net/projects/mingw/files/ 

SDLhttp://www.libsdl.org/download-2.0.php

yasmhttp://yasm.tortall.net/Download.html

ffmpeg  http://www.ffmpeg.org/download.html

pthreadgc2.dll    http://www.dll-files.com/dllindex/dll-files.shtml?pthreadgc2 
faac http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/
x264 http://www.videolan.org/developers/x264.html
libmp3lame http://lame.sourceforge.net/
以上文件的版本,尽可能下载最新版本

MinGW安装注意事项:下载回
mingw-get-setup.exe后主要 选择mingw-developer-toolkit、mingw32-base、mingw32-gcc-g++、msys-base这几项进行安装

MinGW的修改:
     include/windows.h : line 93  #include<winsock.h> -----> #include <winsock2.h>
     否则会报:#error "ws2tcpip.h is not compatible with winsock.h. Include winsock2.h instead."
在SDL , yasm , x264 ,faac , libmp3lame 编译命令后追加 -perfix="生成文件的存放路径" 在安装后会到指定位置,否则默认会装在
MSYS 对应的安装目录下

编译faac库
          在编译faac-1.28时,可能会遇到如下错误
          mpeg4ip_win32.h:70: error: `_TRUNCATE' was not declared in this scope
          mpeg4ip_win32.h:70: error: `vsnprintf_s' was not declared in this scope
          mpeg4ip_win32.h:70: warning: unused variable '_TRUNCATE'
          mpeg4ip_win32.h:70: warning: unused variable 'vsnprintf_s'
          In file included from mp4common.h:32,     from 3gp.cpp:28:
          mp4util.h: In function `void Indent(FILE*, u_int8_t)':
          mp4util.h:82: error: `fprintf_s' was not declared in this scope
          mp4util.h:82: warning: unused variable 'fprintf_s'
          make[3]: *** [3gp.o] Error 1
          make[3]: Leaving directory `/d/faac-1.28/common/mp4v2'
          make[2]: *** [all-recursive] Error 1
          make[2]: Leaving directory `/d/faac-1.28/common'
          make[1]: *** [all-recursive] Error 1
          make[1]: Leaving directory `/d/faac-1.28'
          make: *** [all] Error 2
     
          这个是由于源码有bug造成的,需要下载 faac-1.28.diff
          文件并执行path -p1 < faac-1.28.diff
          然后执行
          ./bootstrap
          ./configure --with-mp4v2 --prefix=/home
          两个命令





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值