Compile FFMPEG dynamic link library in win7

Source: Internet
Author: User
1. Write it before FFMPEG Compilation

Google searches for the compilation process of FFMPEG. Is it really so difficult to compile FFMPEG? After compilation, I looked back and found that there were too many materials on the Internet, but I had a lot of detours. Even if the compilation is successful by some landlords, the compilation may fail due to the impact of the machine environment, FFMPEG version, and personal operations.

Some posts have been posted for a long time, and the software mentioned in the post has been greatly updated, as shown in the mingw I mentioned later, you can directly install the new version without manually updating some files. I wrote this article on.

System Environment:

Operating System: Windows 7 Basic Service Pack 1

FFmpeg version: ffmpeg-0.6.3, ffmpeg-0.6

Development Environment: vs2008

Note:

1) win7 users should pay special attention to, before I Reference: http://www.chinavideo.org/viewthread.php? Tid = 9129 & extra = Page % 3d1 & page = 1

In the post to compile the ffmpeg-0.6.3, can generate lib files, but in the call these lib library has encountered an inexplicable problem, and I make install also encountered a permission deny error. The problem should be that msys and mingw do not have the Administrator permission for installation.

2) about the FFMPEG version, I was able to generate the Lib file while compiling the ffmpeg-0.6.3, but it was generated when compiling the ffmpeg-0.6. DLL. A and. for files with the def suffix, the article will provide a solution later.

1.1 install mingw and compile lib with ffmpeg0.6

Download the installation process and related software is reference this post: http://zhaostudy2.blog.163.com/blog/static/13535020520110179271153/

However, there are several important details that need to be added:

1) win7 users in the installation of mingw, to select "Run as administrator", this will avoid the problem of generating the Lib file cannot be used when compiling the ffmpeg-0.6.3. Similarly, when running msys, select "Run as administrator ".

2) ffmpeg0.6 provided by the landlord on csdn I cannot generate a dynamic library (LIB) according to his configuration ), the ffmpeg0.6 downloaded on the official website still cannot automatically generate the dynamic library (LIB), which may be a problem with built-in makefile. Some users also reflected this problem in the message in this article.

3) The link page above Source Forge has been changed, and the "Tools" folder has disappeared. Fortunately, the landlord has backed up data on csdn and has to admire the foresight of the landlord.

1.1.1 after ffmpeg0.6 is compiled, the Lib file cannot be generated. Solution steps:

Take the ffmpeg0.6 \ libavcodec directory after make as an example, notice that there is a avcodec-52.def file in this directory, for this file, in vs can directly convert def file into lib file!

For details about how to convert data, refer:

Http://blog.163.com/zhucongdzkd@126/blog/static/1399971932010814111127686/

It also mentions that "the mspdb80.dll is not found, so this application cannot be started. "Re-installing the application may fix this problem ." .

Shows the command line parameters:


The generated Lib is available! Solve the problem!

2. Final compilation document

To prevent the previous articles from being accessible, I will sort out the compilation process as follows:

2.1mingw download and Installation

1) mingw: http://download.csdn.net/source/2988856

2) install mingw: Select"Run as Administrator"Run the EXE file, and use the default option to install it in the subsequent steps.

2.2 download and compile the ffmpeg0.6.3 Dynamic Link Library

Ffmpeg0.6.3 can directly compile and generate the dynamic link library and. Lib file.

Ffmpeg0.6.3 http://ffmpeg.org/releases/ffmpeg-0.6.3.tar.bz2

"Run as Administrator"Run the mingw32 \ msys. BAT file

Run the following three commands,

cd /E/ffmpeg0.6.3./configure --enable-shared --disable-static --enable-memalign-hack make


Long wait...


After executing the above three commands in e: \ ffmpeg0.6.3 \ libavcodec can find the avcodec-52.lib and avcodec-52.dll, the other several lib at the beginning of the folder also has the corresponding. lib file and. DLL file. At this point, FFMPEG has compiled the dynamic link library successfully.

2.3 download and compile the ffmpeg0.6 Dynamic Link Library

Ffmpeg0.6 official: http://ffmpeg.org/releases/ffmpeg-0.6.tar.bz2

The preceding steps are the same as when ffmpeg0.6 is compiled. However, only the DLL and Def files are generated and the Lib files are not generated.

Later, use the lib.exe tool in vs2008to convert the def file to the Lib file.

1) double-click the lib.exe file in c: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin. If "mspdb80.dll is not found, the application cannot be started. "Re-installing the application may fix this problem ."

Copy c: \ Program Files \ Microsoft Visual Studio 9.0 \ common7 \ ide \ mspdb80.dll to C: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin, and then double-click the lib.exefile, lib.exe can be started normally.


Note: To avoid problems with vs in the future, delete mspdb80.dll from the c: \ Program Files \ Microsoft Visual Studio 9.0 \ Vc \ bin directory after the Lib file is successfully generated.

2) Suppose the avcodec-52.def file is located in the C: \ test directory, execute the following command:

LIB/out: C: \ test \ avcodec. lib/machine: ix86/DEF: C: \ test \ avcodec-52.def

The LIB file can be generated.


So far, all problems have been solved successfully.

Important addition !!!

The solution is similar to mine, but for more details, I also mentioned how to modify the config. Mak file when the. Def file cannot be generated. Http://blog.csdn.net/xiajia/article/details/6533182

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.