在Windows中使用MinGW编译X264
转自:http://www.cnblogs.com/xiongjiaji/archive/2012/06/08/2541265.html
参考:http://ayobamiadewole.com/Blog/Others/x264compilation.aspx
注意:安装完MinGW后,要把“安装路径\MinGW\bin”加到PATH环境变量中。否则在./configure的时候会“No working C compiler found”。
具体步骤如下:
For someone coming from a windows background, where you do virtually everything, using GUI probably with Visual studio or an equivalent IDE, compiling a program from the command line can be a daunting task.
This blog post will guide you through compiling and building the popular open source video encoding library on windows using the MinGW(Minimalist GNU on Windows).
First you need to download the x264 source code from http://x264.nl/ Or if you know how to use git, you can git clone the x264 from git://git.videolan.org/x264.git.
Then you should download MinGW from http://sourceforge.net/projects/mingw/files Download the mingw-get-inst-20111118.exe (591.9 kB) install it and during the installation steps, select all the check boxes. (直接到这里下载就可以了:http://sourceforge.net/projects/mingw/)
After the installation is completed(然后还要把环境变量加上), then from Start button , click All program, then click MinGW and then Click on MinGW shell, this brings up the following window
From the msys shell change your directory to the location where your x264 source code is, in my own case the x264 code is in the c: drive so I will simply Type cd c:\x264

Then type ./configure and press enter, this screen waits for some seconds and the bring

Then you can now type make and press enter, this will bring up the window below, showing the progress of the compilation process.

After the compilation is finished, if you look into your x264 directory you will find x264.exe file there.

Now compiling the x264 into a dynamic link library that can be used in Visual studio takes another process entirely. Open the MinGW bash once again and change the directory to the location of your x264 source code, just like you did previously.
Then type
./configure --disable-cli --enable-shared --extra-ldflags=-Wl,--output-def=libx264-120.def
or just
./configure --disable-cli --enable-shared --extra-ldflags=-Wl,--output-def=libx264.def

Now in libx264-120.def “120” is the version of the x264 you are using, you can find the version of the x264 you are using by opening the x264.h file in your x264 source folder you will see something like this #define X264_BUILD 120 depending on your version.
You can now type the make command and press enter and you will find the libx264-120.dll in your x264 source folder. Then rename libx264-120.dll to libx264.dll and you have you dynamic link library to work with.

If you wish to generate the Visual Studio .lib file to work with then open a Visual Studio command prompt, and change the directory to the location of the x264 source .
Then run this command
LIB /DEF:libx264.def
Then press enter

And your libx264.lib would be generated.
在Windows中使用MinGW编译X264的更多相关文章
- 手把手教你在Windows下使用MinGW编译libav(参考libx264的编入)
转自:http://www.th7.cn/Program/cp/201407/242762.shtml 手把手教你在Windows下使用MinGW编译libav libav是在Linux下使用纯c语言 ...
- QT中使用MinGW 编译的protobuf库--包含库的生成和使用
QT中使用MinGW 编译的protobuf库--包含库的生成和使用 0前言 1准备工作 2生成protobuf库文件 3在QT中测试protobuf的使用 4结语 0前言 最近要在QT中使用prot ...
- 在Windows下利用MinGW编译FFmpeg
目录 [隐藏] 1 环境与软件 2 第一步:安装MinGW 3 第二步:配置编译环境 4 第三步:配置SDL 5 第四步:编译 5.1 编译faac 5.2 编译fdk-aac 5.3 编译x264 ...
- Windows 系统 vs2012 MinGW 编译ffmpeg 静态库
Windows系统下 vs2012编译ffmpeg 动态库 前面已经有文章讲述,本文将讲述如果编译生成ffmpeg静态库以方便 在vs2012下调用. 准备工作:安装MinGW环境,修改ffmpeg配 ...
- [X264] MinGW编译x264,VC中调用libx264.dll-------------<参考转>
1. 下载并按照MinGW,最好就缺省按照 http://sourceforge.net/projects/ ... ler/mingw-get-inst/ 把C:\MinGW\bin添加 ...
- MinGW和MSYS区别和关系以及MinGW&MSYS在Win7中安装并编译x264
http://blog.csdn.net/freeape/article/details/50555003
- Windows下使用MINGW编译ffplay
之前考虑到需要快速配置编译ffplay,使用了比较暴力的方法,具体可以参考编译ffplay.exe简化版. 这里介绍下相对规范的做法. 前提:已经安装了Windows下GCC开发环境--MINGW+m ...
- 再次尝试windows下msys+MinGW编译ffmpeg
电脑上安装太多的开源库,环境变量里面一些常用的头文件都有几种,以前使用的编译ffmpeg的方法现在常常提示错误.从config.log中看,这些错误往往都是一些头文件引用错误导致.由于项目中继续编译自 ...
- windows下使用mingw编译python扩展模块
环境: 1.python2.7.2 2.mingw20120426 说明: PYTHON_HOME:不做特殊说明的话,默认代表python的安装路径. MINGW_HOME:不做特殊说明的话,默认代表 ...
随机推荐
- shell的内建命令和外部命令
shell的内建命令和外部命令 Shell执行的命令可以分为内建命令(built-in)和外部命令(external),前者是构建在shell内部:后者是一个独立的文件(可以是二进制文件,也可以是一个 ...
- Visual Studio Online Integrations-Sync and migration
原文:http://www.visualstudio.com/zh-cn/explore/vso-integrations-directory-vs
- android TP驱动移植调试笔记(转)
1. 添加I2C 设备 TP 一般采用的是I2C 作为数据和命令接口,所以TP 驱动也可以归类为I2C 驱动.TP驱动的主要逻辑不在这里,但是了解了Linux 的I2C 体系架构,就可以对整个驱动流程 ...
- Linux下远程cp命令scp
2014-2.19 PS1.在用此命令cpLinux与Linux之间的数据时发现有些服务器上默认没有安装scp但用yum -y install scp提示么有这样的包 后来发现原来scp工具的安装包 ...
- 通用js类库
/* 其它通用函数 */$(function() { // var General = function() { var _self = this; /* 写 cookie 操作 */ _self.S ...
- 最近为毛喜欢上C/C++语言了
旁观者李四说:此人大笨也!我用鼠标随便拖几个控件, 就是一个xxx管理系统了,你用C语言怕是一年也写不出来吧! 好吧,我要承认,讲这话的都已经是mS的奴才了,别的我不了解, MFC本身就是一个封闭的架 ...
- 再谈对协变和逆变的理解(Updated)
去年写过一篇博客谈了下我自己对协变和逆变的理解,现在回头看发现当时还是太过“肤浅”,根本没理解.不久前还写过一篇“黑”Java泛型的博客,猛一回头又是“肤浅”,今天学习Java泛型的时候又看到了协变和 ...
- WhatsApp值160亿美元,腾讯推大众点评微信支付!
腾讯前脚刚入股大众点评,FB后脚就将斥资160亿美元收购WhatsApp(40亿美元现金和120亿美元股票). 为什么WhatsApp值160亿美元?这是什么东东呢?WhatsApp这款服务可以帮助用 ...
- 修改php.ini以达到 屏蔽错误信息
那是因为php.ini中关闭了错误显示,将错误写成了文件,这是人为设置的结果,display_errors =on就好了. 不过不显示错误倒安全点,建议调试时打开,然后提供服务时关闭. 提供一点资料给 ...
- 作为一名职高生学习Linux的心酸经历
当你点进这篇文章的时候,一定会好奇我为什么要用“心酸”这个词,这个词已经太久没被人提起,也许心酸这种感情只能存在于一个人在追中梦想过程中内心角落吧.从小我们总是会被问这样一个问题“你的梦想是什么?”每 ...