Windows7 system compiled and installed X264

Source: Internet
Author: User

1. Download and installation of MinGW

Download URL: https://sourceforge.net/projects/mingw/files/

Click the link in the rectangle to download the installation bootloader Mingw-get-setup.exe.

It is a good idea to install the default installation path and settings. Select all the package, click Installation,apply All changes, click Apply in the Popup dialog box, and wait for the installation to complete. (approximately 10 minutes, depending on the speed)

Finally, add the installation c:/mingw/bin into the system environment variable. (Computer-Properties-Advanced system settings-environment variables-edit, add C:\MinGW\bin. )

2. Download and compile x264

Download URL: http://www.videolan.org/developers/x264.html

Unzip the downloaded last_x264.tar.bz2 to the D-packing directory.

Enter the C:\MinGW\msys\1.0 directory and double-click Open Msys.bat to enter the shell compilation environment.

Enter the command in the compiled configuration directory of x264:

CD d:/last_x264

Use the dir command to view the folders and files in the current directory.

then enter the x264-snapshot-20170608-2245.

Enter the command to configure x264:

./configure--enable-shared

Tip No assembler is found, and you are prompted to re-enter the configuration command using the--DISABLE-ASM command.

./configure--enable-shared--disable-asm

It is then compiled and installed.

 Make  Make Install

Under normal circumstances, the local folder is automatically created under C:\MinGW\msys\1.0\, and subfolders such as Bin,include,lib are under the folder.

Where the Bin folder has the dynamic link library Libx264-150.dll and executable files X264.exe,include folder is X264.h, X264_config.h and other header files.

Use the Export tool Pexports to export the static library.

Copy both Pexports.exe and Libx264-150.dll to the VS directory (C:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin).

Use the Windows Self-command-line tool to enter C:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin.

10.0\vc\bin

The required lib file can be generated by executing the following command.

Pexports libx264-. dll > libx264-/machine:x86/def:libx264-.def

If the prompt cannot find mspdb100.dll, download it online and put it in this directory.

The build file looks like this.

Now the x264 corresponding. dll,.lib,.h files have been generated, the following x264 test work.

3. Test whether the compilation generated x264 is correct.

Create a new Win32 project TestX264, copy the x264 corresponding. Dll,.lib,.h and other files to the TestX264 project.

The test program demo is as follows:

#include"stdafx.h"#include<iostream>#include<string>#include"stdint.h"  #pragmaComment (lib, "Libx264-150.lib")extern "C"{#include"x264.h"#include"x264_config.h"};using namespacestd;intMainintargcChar**argv)    {x264_param_t param; X264_param_default (&param); cout<<"hello,x264"<<Endl; return 0;}

Windows7 system compiled and installed X264

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.