博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How to build x264/libx264.dll in Windows
阅读量:2353 次
发布时间:2019-05-10

本文共 2577 字,大约阅读时间需要 8 分钟。

最近用到了windows 下x264,发现需要生成windows lib,所以就找到了这篇文章。

文章链接:

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  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  Download the mingw-get-inst-20111118.exe (591.9 kB) install it and during the installation steps, select all the check boxes. 

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 

MinGW bash 
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

 MinGW bash2 

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

 MinGW bash4 

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

 MinGW bash3 

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

 MinGW bash5 


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


 MinGW bash6 

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.

 window 

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 

visual studio command prompt 

And your libx264.lib would be generated.

转载地址:http://ktrvb.baihongyu.com/

你可能感兴趣的文章
crontab使用手册
查看>>
虚继承与虚基类的本质
查看>>
函数式编程
查看>>
GitHub上整理的一些工具
查看>>
python range 与xrange的区别
查看>>
算法-最长递增子序列
查看>>
最大子序列、最长递增子序列、最长公共子串、最长公共子序列、字符串编辑距离
查看>>
回文字符序列
查看>>
inline函数必须在头文件中定义吗?
查看>>
内存泄漏检查工具valgrind使用方法
查看>>
Solution of Codility
查看>>
java解析XML的四种方式及比较
查看>>
单例模式(java)详细
查看>>
策略模式(java)
查看>>
java线程中信号量Semaphore类的应用
查看>>
如何设置CentOS为中文显示
查看>>
Nginx配置
查看>>
php-fpm配置
查看>>
Centos 系统时间与当前时间相差和时区解决办法
查看>>
Linux下如何进行FTP设置
查看>>