用mingw-w64 编译 x64 位的ffmpeg
http://blog.sina.com.cn/s/blog_6125d067010168dt.html
工作中用到了ffmpeg x64。 发现编译出来x64的ffmpeg,很不容易。特记录下来。
原计划编译 静态库, 发现静态库,在vs2010调用过程中,总是出现莫名其妙的错误。 后来发现官网上 有编译好的 动态库。 在AAC解码过程,出现杂音。 应该是它的一个bug。 所以决定重新编译个。
一. 准备
编译X64的需要mingw-w64 + msys
1. 下载 mingw-w64
2. 下载 msys
3. 编辑 msys 下 /etc/fstab 加入 c:/mingw64 /mingw
(注:我的mingw64放在c:/)
4. 编辑 msys.bat. 在文件的开头 加入
call "D:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat"
5. 应该用到 yasm 工具。 这个记不清了。 下载yasm x64位的。 如果没有,下载32位的也行。 放到 msys/bin下。
二. 编译
1. Zlib 1.2.7
下载源代码 http://zlib.net/ 解压后:
1. cd zlib-1.2.7/
2. 修改 win32/Makefile.gcc 文件:
PREFIX = x86_64-w64-mingw32-
(注:在/mingw/bin中,最好将所有的.exe复制一份 以x86_64-w64-mingw32-开头的文件 )
3. make -f win32/Makefile.gcc
4. cp -iv zlib1.dll /mingw/bin
5. cp -iv zconf.h zlib.h /mingw/include
6. cp -iv libz.a /mingw/lib
2. libgsm 1.0.13-3
下载源代码, http://libgsm.sourcearchive.com/, 解压后:
1. cd gsm/
2 修改Makefile,
添加 PRIFIX=x86_64-w64-mingw32-
CC = ${PRIFIX}gcc -ansi -pedantic
AR = ${PRIFIX}ar
RANLIB = ${PRIFIX}ranlib
3. make
编译到一半的时候出现 fchmod 和 fchown 的编译错误,不管它,继续执行:
4. mkdir /mingw/include/gsm
5. cp inc/gsm.h /mingw/include/gsm
6. cp lib/libgsm.a /mingw/lib
下载源代码, http://sourceforge.net/projects/lame/files/lame/, 解压后:
- ./configure --prefix=/mingw --enable-expopt=full --host=x86_64-w64-mingw32 --enable-static --disable-shared
- make
- make install
下载源代码,http://xiph.org/downloads/,解压后:
- ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared
- make
- make install
5. LIBVorbis 1.3.3
下载源代码,http://xiph.org/downloads/,解压后:
1. ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared 2. make
3. make install
6. LIBSpeex 1.2rc1
下载源代码,http://xiph.org/downloads/,解压后:
- ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared
- make
- make install
7. LIBTheora 1.1.1
下载源代码,http://xiph.org/downloads/,解压后:
- ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared
- make
- make install
下载源代码,http://www.audiocoding.com/downloads.html,解压后:
首先编辑 Makefile.am 文件,将第一行改为
SUBDIRS = include libfaac
然后修改configure.in文件,找到最后一段的 AC_OUTPUT, 修改为
AC_OUTPUT(libfaac/Makefile include/Makefile Makefile)
执行:
1. ./bootstrap
2. ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared 3. make
4. make install
本文9. xvidcore 1.3.2
下载 xvidcore-mingw-w64-master ,这个是针对mingw-w64的一个版本,官网上的编译不过。解压后:
- cd xvidcore/build/generic
- ./configure --prefix=/mingw --host=x86_64-w64-mingw32 --enable-static --disable-shared
执行到这里后,搜索xvidcore/build/generic 目录下面所有文件中的
- make
- make install
- cp -iv \=build/xvidcore.dll.a /mingw/lib/libxvidcore.dll.a
10. x264 snapshot-20120830-2245
下载源代码,http://www.videolan.org/developers/x264.html,解压后:
- configure --prefix=/mingw --enable-win32thread --extra-cflags="-DX264_VERSION=20100422" --host=x86_64-w64-mingw32 --enable-static --disable-shared --cross-prefix=x86_64-w64-mingw32-
- make
- make install
- cp -iv x264.h x264_config.h /mingw/include
- cp -iv libx264.a /mingw/lib
- cp -iv x264.pc /mingw/lib/pkgconfig
编译ffmpeg 0.11.1
相信有耐心进行到这里的人,已经花了1-2个小时了,这是正常的速度。终于可以编译ffmpeg了.
下载源代码,http://ffmpeg.org,解压后首先配置,光这个自动配置过程也要十分钟左右。
- ./configure --prefix=/mingw --enable-gpl --enable-nonfree --enable-postproc --enable-avfilter --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-bzlib --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-zlib --disable-debug --enable-shared --arch=x86_64 --host-os=win64 --extra-cflags=-I/mingw/include --extra-ldflags=-L/mingw/lib
然后 make & make install 等着编译结束吧。
注意:make 时可能会碰到:
ar.exe: libavcodec/: Permission denied 或 library.mak *** 的错误,
参考:http://stackoverflow.com/questions/10847106/get-error-while-building-libav-on-windows-using-mingw-and-msys
- 删掉除了.git 所有的文件
git config --global core.autocrlf falsegit reset --hard- vim ./configure 查看编码 :set ff? 如果是 unix,即可。dos,不行。
- make
- make install

安装到libtheora-1.1.1时出错,找不到ogg……
这个应该是找不到ogg.pc,创建个链接就行了,貌似是ln -s……
之后安装到ffmpeg又出错了……不好弄啊
用mingw-w64 编译 x64 位的ffmpeg的更多相关文章
- windows 7 + vs2010 sp1编译 x64位版qt4
由于qt官方没有发布预编译的64位版qt4,要使用64位版qt4,只能自己编译,编译过程如下: 1,下载源码并解压到D:\qt-src\qt-everywhere-opensource-src-4.8 ...
- 9.下载ffmpeg、使QT支持同时编译32位和64位
1.FFMPEG下载 进入http://ffmpeg.org/download.html,如果下载源码,则在右下方: 如果在linux中,直接输入git clone https://git.ffmpe ...
- Win7 64位 VS2015及MinGW环境编译FFMPEG-20160326
因为又要弄MinGW了,所以顺便把FFMPEG编译了,文章主要参考这篇,防抽所以复制一遍,顺便加些自己的内容 http://blog.csdn.net/finewind/article/details ...
- resx文件在X64位编译,提示“未能加载文件或程序集”的问题?
原文:resx文件在X64位编译,提示"未能加载文件或程序集"的问题? resx文件在X64位编译,提示"未能加载文件或程序集"的问题? 解答: 错误现象如下 ...
- windows 下编译64位ffmpeg
window下如何编译ffmpeg 前文已有介绍,前面介绍的都是如何编译32位的库,本文主要介绍window 下如何编译64位ffmpeg库. 一.搭建编译环境 1.下载 windows下编译64位F ...
- windows 7下mingw+msys编译ffmpeg
windows 7下mingw+msys编译ffmpeg 1-->下载安装MingW,mingw-get-inst-20120426.exe http://sourceforge.ne ...
- mingw w64的下载地址
mingw w64的下载地址,官网下载看得太晕.直接记下下载链接. https://sourceforge.net/projects/mingw-w64/ i686纯32位版供32位win系统使用.x ...
- VS 2013编译64位版本QT 4.8.6及使用cmake为依赖QT生成VS项目时Could NOT find Qt4
对于一些已经解决的问题,本博客不再讨论.只将本人遇到的问题做简单的说明. 一.VS 2013编译64位版本QT 4.8.6 QT项目官网中,对于QT4,其只提供了windows X86的版本,并且支持 ...
- VS2015下编译64位GDAL总结
使用VS2015编译最新的64位GDAL(最新gdal2.11),确实有一些问题,看来双方还是太新了,有点不兼容,特总结如下. 以前经常用的通过VisualStudio IDE进行编译的方式现在似乎不 ...
随机推荐
- IE使用多彩文档上传数据库报错
使用多彩文档,用IE浏览器提交表单,双引号里面包含单引号,导致数据库插入不了,而用chrome浏览器不会报错,自动过滤单引号, 解决:content.replace("'", &q ...
- 解决.NET Core MVC 视图中的中文被html编码的问题
在 .net core mvc 视图输出 变量的时候 默认使用的是 UnicodeRanges.BasicLatin 进行的编码 所以 输出中文后在查看源码的时候是进过编码了的 . 解决方案 在 ...
- Oracle 11g客户端
资源 下载资源,直接解压进行配置 Oracle官方资源:http://www.oracle.com/technetwork/database/features/instant-client/index ...
- Direct2D教程(二)来看D2D世界中的Hello,World
引子 任何一门语言的第一个教程几乎都是Hello,world.我们也不例外,但是这里不是教大家打印Hello,world,而是编写一个简单的D2D绘制程序,让大家对Direct2D的程序结构及编程方法 ...
- 利用VideoView播放视频
package com.qianhua.ui; 002 003 import android.app.Activity; 004 import android.content.Intent; 00 ...
- 小胖说事20--------GCD笔记
1.系统提供的dispatch方法 为了方便的使用GCD.苹果提供了一些方法方便我们将BLOCK放在主线程或者后台程序运行.或者延后运行. //后台运行: dispatch_async(dispatc ...
- Codeforces Round #267 (Div. 2) B. Fedor and New Game
After you had helped George and Alex to move in the dorm, they went to help their friend Fedor play ...
- python--多种程序分析(2)
1.文件操作有哪些模式?请简述各模式的作用 r模式只读 w模式只写 a模式只添加 r+可读可写 w+可写可读 a+可读可添加 rb 二进制只读 wb 二进制只写 ab 二进制添加 ...
- qt-mingw530-opencv-开发配置
1.安装好Qt和Qtcreator 2.解压OpenCV源码到一个目录下.路径不能带空格和中文. 3.把E:\Qt\qtcreator-2.1.0\mingw\bin添加到系统环境变量中. 4.安装C ...
- [框架安装趟雷指南]Ubuntu+1060+cuda+cudnn+Keras+TH+TF+MXnet
[框架安装趟雷指南]Ubuntu+1060+cuda+cudnn+Keras+TH+TF+MXnet https://zhuanlan.zhihu.com/p/23480983 天清 9 个月前 写这 ...