转自: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的更多相关文章

  1. 手把手教你在Windows下使用MinGW编译libav(参考libx264的编入)

    转自:http://www.th7.cn/Program/cp/201407/242762.shtml 手把手教你在Windows下使用MinGW编译libav libav是在Linux下使用纯c语言 ...

  2. QT中使用MinGW 编译的protobuf库--包含库的生成和使用

    QT中使用MinGW 编译的protobuf库--包含库的生成和使用 0前言 1准备工作 2生成protobuf库文件 3在QT中测试protobuf的使用 4结语 0前言 最近要在QT中使用prot ...

  3. 在Windows下利用MinGW编译FFmpeg

    目录 [隐藏]  1 环境与软件 2 第一步:安装MinGW 3 第二步:配置编译环境 4 第三步:配置SDL 5 第四步:编译 5.1 编译faac 5.2 编译fdk-aac 5.3 编译x264 ...

  4. Windows 系统 vs2012 MinGW 编译ffmpeg 静态库

    Windows系统下 vs2012编译ffmpeg 动态库 前面已经有文章讲述,本文将讲述如果编译生成ffmpeg静态库以方便 在vs2012下调用. 准备工作:安装MinGW环境,修改ffmpeg配 ...

  5. [X264] MinGW编译x264,VC中调用libx264.dll-------------<参考转>

    1. 下载并按照MinGW,最好就缺省按照    http://sourceforge.net/projects/ ... ler/mingw-get-inst/    把C:\MinGW\bin添加 ...

  6. MinGW和MSYS区别和关系以及MinGW&MSYS在Win7中安装并编译x264

    http://blog.csdn.net/freeape/article/details/50555003

  7. Windows下使用MINGW编译ffplay

    之前考虑到需要快速配置编译ffplay,使用了比较暴力的方法,具体可以参考编译ffplay.exe简化版. 这里介绍下相对规范的做法. 前提:已经安装了Windows下GCC开发环境--MINGW+m ...

  8. 再次尝试windows下msys+MinGW编译ffmpeg

    电脑上安装太多的开源库,环境变量里面一些常用的头文件都有几种,以前使用的编译ffmpeg的方法现在常常提示错误.从config.log中看,这些错误往往都是一些头文件引用错误导致.由于项目中继续编译自 ...

  9. windows下使用mingw编译python扩展模块

    环境: 1.python2.7.2 2.mingw20120426 说明: PYTHON_HOME:不做特殊说明的话,默认代表python的安装路径. MINGW_HOME:不做特殊说明的话,默认代表 ...

随机推荐

  1. PHP FORUM

    1.index.php <html> <!--功能:php论坛标题部分--> <head><meta http-equiv="content-typ ...

  2. Android Studio-设置override及getter/setter方法

    默认是Alt+Insert,可以修改成与Eclipse保持一致,Alt+Shift+S

  3. [Asp.net Mvc]通过UrlHelper扩展为js,css静态文件添加版本号

    写在前面 在app中嵌入h5应用,最头疼的就是缓存的问题,比如你修改了一个样式,或者在js中添加了一个方法,发布之后,并没有更新,加载的仍是缓存里面的内容.这个时候就需要清理缓存才能解决.但又不想让w ...

  4. linux ls和 ll 命令

    工作中用到      ll -alrth|tail -30    命令 所以再来回顾一下 ls 命令 linux ls和 ll 命令 ll 命令列出的信息更加详细,有时间,是否可读写等信息 ll命令和 ...

  5. Entity Framework 关系约束配置

    前言 简单的说一下自己的理解,大家应该都很明白ADO.NET,也就是原生态的数据库操作,直接通过拼接SQL语句,表与表之间通过链接(inner join  left join  或者子查询),也就是在 ...

  6. MYSQL例题合集

    一.数学函数 数学函数主要用于处理数字,包括整型.浮点数等. ABS(x) 返回x的绝对值 SELECT ABS(-1) -- 返回1 CEIL(x),CEILING(x) 返回大于或等于x的最小整数 ...

  7. js矩阵菜单或3D立体预览图片效果

    js矩阵菜单或3D立体预览图片效果 下载地址: http://files.cnblogs.com/elves/js%E7%9F%A9%E9%98%B5%E8%8F%9C%E5%8D%95%E6%88% ...

  8. 破解TP-Link路由-嗅探PPPoE拨号密码

    如果你平时都使用路由器直接上网,那么你还记得你的宽带(ADSL)帐户名和密码吗?忘记密码后又该如何找回呢?别急,本文带你一同找回遗忘的ADSL密码.1.安全性较差的路由器(例如腾达的某些路由器):这里 ...

  9. 工具推荐:2016年最佳的15款Android黑客工具

    黑客技术,曾被认为是专家的专有领域,但随着技术的崛起和移动安全领域的进步,黑客技术已经变得越来越普遍.随着人们越来越依赖于智能手机和其它的便携式设备来完成他们的日常活动,我们有必要了解一些Androi ...

  10. poj1125最短路

    Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 30408   Accepted: ...