Build an FFMPEG environment in Windows

Source: Internet
Author: User
Tags exit in c hello world

In Windows, FFMPEG can be compiled using cygwin or msys + mingw. I personally prefer msys + mingw, because it is possible to build a Unix-like operating system in windows, configuration is easier than cygwin, so this is to describe how to build the msys + mingw environment.

Build an FFMPEG compiling environment in windows on the InternetArticleA lot, the most detailed possible is this article: http://ffmpeg.arrozcru.org/wiki/index.php? Title = main_page. However, due to version issues, the above description is not acceptable.

  1. Go to http://sourceforge.net/projects/mingw/files/download the latest version of mingwinstallationProgramMy name is mingw-5.1.6.exe.
  2. To begin
  3. To http://prdownloads.sourceforge.net/mingw/coreutils-5.97-MSYS-1.0.11-snapshot.tar.bz2? Downloaddownload coreutils-5.97-msys-1.0.11-snapshot.tar.bz2
  4. Run mingw-5.1.6.exe. Install g ++ and make and specify the installation directory to C: \ msys \ mingw. This program will automatically download and install the mingw system, note that the GCC version is 3.4.5.
  5. Run msys-1.0.11.exe to install msys to the C: \ msys directory.
  6. Decompress and copy coreutils-5.97-msys-1.0.11-snapshot.tar.bz2 to the C: \ msys directory, select the merge directory, and retain two copies when a file conflict occurs.
  7. At this time, the basic system should have been built, and a test. c Hello World program should be compiled and run properly.
  8. Install tool software:
    1. Wget.exe: copy to the C: \ msys \ bin directory.
    2. To begin
    3. To begin
  9. Install msysgit to the C: \ Software Directory
  10. Download the x264 program:/C/software/git/bin/git clone git: // git.videolan.org/x264.git
  11. Compile the x264 program:./configure -- prefix =/home/Yantao/CIC/static, and then run make and make install
  12. Download AMR support: http://sourceforge.net/projects/opencore-amr/files/opencore-amr/0.1.2/opencore-amr-0.1.2.tar.gz/download
  13. Compile:./configue -- prefix =/home/Yantao/CIC/static -- enable-static, and then make and make install
  14. Download SDL: http://www.libsdl.org/download-1.2.php
  15. Compile:./configure -- prefix =/home/Yantao/CIC/static -- enable-static -- disable-shared
  16. This proves that the current GCC 3.4.5 environment configuration is basically correct, but FFMPEG must be compiled above GCC 4 to solve the DLL file connection and abnormal exit in VC and other bugs, therefore, you need to upgrade GCC to the latest system to SourceForge.
    1. Upgrade msys Bash: from the slave
    2. Upgrade msys coreutil: From slave
    3. Upgrade mingw binutils
    4. Upgrade mingw runtime Dev
    5. Update mingw runtime DLL
    6. Upgrade mingw Win32 API
    7. Upgrade GCC: Download all GCC-related download items, especially DLL items, and decompress and copy them to the C: \ msys \ mingw directory.
    8. Download libgmp-5.0.1-1-mingw32-dll-10.tar.tar from the mingw proposeddirectory of http://sourceforge.net/projects/mingw/files/and install
    9. Download libmpc-0.8.1-1-mingw32-dll-2.tar from the mingw proposeddirectory of http://sourceforge.net/projects/mingw/files/and install
    10. Download libmp fr-2.4.1-1-mingw32-dll-1.tar from the mingw proposeddirectory of http://sourceforge.net/projects/mingw/files/and install
    11. Download pthreadssupports libpthread-2.8.0-3-mingw32-dll-2.tar.tar
  17. To verify the correctness of the upgrade, first determine that test. C can be correctly compiled, and then re-compile x264, opencore-Amr, SDL
  18. Copy the compiled External library to the C: \ msys \ mingw \ include and c: \ msys \ mingw \ Lib directories, and modify the directories in each pkconfig file, copy the SDL-config in the build4_5_0/bin directory to the mingw/bin directory, and change the path to/mingw.
  19. slave
  20. Compile FFMPEG: first create the FFMPEG directory, and then use tortoisesvn to download the latest from SVN: // SVN. mplayerhq. hu/FFMPEG/trunk.Code, Run. /configure -- prefix =/home/Yantao/CIC/static -- enable-static -- disable-shared -- enable-GPL -- enable-libx264 -- enable-pthreads -- enable-nonfree -- enable-opencore- amrnb -- enable-opencore-amrwb -- enable-version3 -- enable-memalign-hack
  21. Modify row 1699 of libavformat/RTSP. C, change etime to etimedout, modify mingw/include/errno. h file, and add # define etimedout 60 Definition
  22. Add typedef long pid_t before row 152 of mingw/include/sched. h;
  23. Run make and make install
  24. Test ffplay.exe using a 3gpfile with amr-nb.
  25. Test video capture

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.