How to Use vc6 to compile FFMPEG and perform one-step debugging.

Source: Internet
Author: User
How to Use vc6 to compile FFMPEG and perform one-step debugging.

The latest official FFMPEG version is 0.9. Let's take this as an example:

1. download the latest git version of the source code (http://ffmpeg.zeranoe.com/builds/, this example download is version)
2. Put the configuration in the msys environment and generate the config. h file. Mingw GCC can smoothly compile the entire project and generate the latest FFMPEG version.
3. Create a vc6 project and add the relevant code to the project. Because the OBJ generated by VC is in a directory, You need to modify the file name so that it does not have to be renamed.
4. Install the Intel compiler 11's compiler, extract the icl.exeand the related release directory, replace cl.exe with the vc6, and add/qstd = c99 to the project settings to support the c99 syntax.
5. Install the Intel compiler 10 compiler and extract the lib directory separately, because the structure of the debug library of this version can perfectly support debugging information of vc6.
6. Set the include/EXE/lib search directory in vc6 options to point to the intel compiler.
7. modify the code and add the Linux header file c99 to support vc6, (unistd. H, stdint. H, inttypes. H, getopt. h)
8. Added implementation code for c99 and Linux. FFMPEG needs to be used: getopt_long, strtoll, gettimeofday, atoll, usleep, etc.
9. Modify the compatible code of windows, getwindowlongptr-> getwindowlong, gwlp_userdata
10. Remove hardware-accelerated libavcodec code and dependent library code. Select the required modules and modify the relevant allcodec. C, alldevices. C, allfilters. C, allformats. c
11. Add the Link Library, SDL. Lib, winmm. Lib, dxguid. Lib, and wsock32.lib.
12. In OS _support.c, move <winsock2.h> to the front of the file.
13. If it is FFMPEG, it can be compiled smoothly. For ffplay, you also need to compile static SDL and link it.
14. Wait. Is the audio running incorrect? Snowflake sound? Because <math. h> in all files must be replaced with <mathimf. h>, the default RINT and other mathematical functions are not compatible with GCC.
15. OK. The success is that the pure C version runs perfectly.
16. because ffmpeg0.9 adds some MMX syntaxes not supported by Intel compiler in the C file, a small part of the MMX/SSE accelerated version is compiled. the C file must be compiled into a. ofile by using the mingw gcc, and converted to lib by using the lib.exe tool of vc6to link the vc6 file. Of course, we need to add a lot of compilation OBJ compiled by yasm.
17. If you are interested, you can continue to compile the x264 library using this method. The latest official code MMX can also be passed smoothly.

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.