Compiling x64 bits with MINGW-W64 ffmpeg

Source: Internet
Author: User

This article from: http://blog.sina.com.cn/s/blog_6125d067010168dt.html

FFmpeg x64 was used in the work. It is not easy to find FFmpeg compiled out of x64. The special record.
The original plan compiles the static library, discovers the static library, in the VS2010 call process, always appears the inexplicable error. Later found that the official network has compiled a dynamic library. During the AAC decoding process, there is a murmur. Should be one of its bugs. So I decided to recompile the one.

I. Preparation
Required Mingw-w64 + Msys for compiling X64
1. Download Mingw-w64
2. Download Msys
3. Edit Msys under/etc/fstab join C:/MINGW64/MINGW
(Note: My mingw64 is placed in c:/)
4. Edit Msys.bat. Add at the beginning of the file
Call "D:\Program Files (x86) \microsoft Visual Studio 10.0\vc\bin\amd64\vcvars64.bat"
5. The Yasm tool should be used. This is not a clear memory. Download the yasm x64 bit. If not, download the 32-bit also line. Put it under the Msys/bin.


Two. Compiling

1. Zlib 1.2.7

Download source code http://zlib.net/after decompression:

1. CD zlib-1.2.7/

2. Modify the WIN32/MAKEFILE.GCC file:

PREFIX = x86_64-w64-mingw32-

(Note: In/mingw/bin, it's a good idea to copy all of the. exe to a file starting with x86_64-w64-mingw32-)

3. Make-f WIN32/MAKEFILE.GCC

4. Cp-iv Zlib1.dll/mingw/bin

5. Cp-iv zconf.h Zlib.h/mingw/include

6. Cp-iv Libz.a/mingw/lib

2. libgsm 1.0.13-3

Download source code, http://libgsm.sourcearchive.com/, after decompression:

1. CD gsm/
2 Modify Makefile,

Add prifix=x86_64-w64-mingw32-

CC = ${prifix}gcc-ansi-pedantic

AR = ${prifix}ar

Ranlib = ${prifix}ranlib

3. Make

Compile to half of the time, Fchmod and Fchown compile errors, regardless of it, continue to execute:

4. mkdir/mingw/include/gsm

5. CP inc/gsm.h/mingw/include/gsm

6. CP Lib/libgsm.a/mingw/lib

3. LAME 3.99.5

Download source code, http://sourceforge.net/projects/lame/files/lame/, after decompression:

    1. ./configure--prefix=/mingw--enable-expopt=full--host=x86_64-w64-mingw32--enable-static--disable-shared
    2. Make
    3. Make install
4. LIB OGG 1.3.0

Download source code, http://xiph.org/downloads/, after decompression:

    1. ./configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared
    2. Make
    3. Make install

5. Libvorbis 1.3.3

Download source code, http://xiph.org/downloads/, after decompression:

1../configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared 2. Make

3. Make install

6. Libspeex 1.2rc1

Download source code, http://xiph.org/downloads/, after decompression:

    1. ./configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared
    2. Make
    3. Make install

7. Libtheora 1.1.1

Download source code, http://xiph.org/downloads/, after decompression:

    1. ./configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared
    2. Make
    3. Make install

Download source code, http://www.audiocoding.com/downloads.html, after decompression:

First edit the makefile.am file and change the first line to

Subdirs = include LIBFAAC

Then modify the configure.in file, find the last paragraph of the ac_output, revise to

Ac_output (libfaac/makefile include/makefile Makefile)

Perform:

1../bootstrap
2../configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared 3. Make

4. Make install

This article 9. Xvidcore 1.3.2

Download Xvidcore-mingw-w64-master, this is for a version of MINGW-W64, official website compiled but. After decompression:

    1. CD Xvidcore/build/generic
    2. ./configure--prefix=/mingw--host=x86_64-w64-mingw32--enable-static--disable-shared


After executing here, search all the files in the xvidcore/build/generic directory below

-mno-cygwinThis option, this option has not been supported by GCC and has been removed after all to continue.
    1. Make
    2. Make install
    3. Cp-iv \=BUILD/XVIDCORE.DLL.A/MINGW/LIB/LIBXVIDCORE.DLL.A

Ten. x264 snapshot-20120830-2245

Download source code, http://www.videolan.org/developers/x264.html, after decompression:

    1. Configure--prefix=/mingw--enable-win32thread--extra-cflags= "-dx264_version=20100422"--host=x86_64-w64-mingw32- -enable-static--disable-shared--cross-prefix=x86_64-w64-mingw32-
    2. Make
    3. Make install
    4. Cp-iv x264.h X264_config.h/mingw/include
    5. Cp-iv Libx264.a/mingw/lib
    6. Cp-iv X264.pc/mingw/lib/pkgconfig
compiling ffmpeg 0.11.1

It is normal speed to believe that people who have had the patience to come here have spent more than 1-2 hours. Can finally compile the ffmpeg.

Download the source code, http://ffmpeg.org, the first configuration after decompression, light this automatic configuration process will also be about 10 minutes.
    1. ./configure--prefix=/mingw--ENABLE-GPL--enable-nonfree--enable-postproc--enable-avfilter--enable-w32threads-- Enable-runtime-cpudetect--enable-memalign-hack--enable-bzlib--ENABLE-LIBFAAC--enable-libgsm--enable-libmp3lame --enable-libspeex--enable-libtheora--enable-libvorbis--enable-libx264--enable-libxvid--enable-zlib-- Disable-debug--enable-shared--arch=x86_64--host-os=win64--extra-cflags=-i/mingw/include--extra-ldflags=-L/ Mingw/lib
Then make & make install and wait for the compilation to finish.
Note: Make may encounter:
ar.exe:libavcodec/: Permission denied or Library.mak * * * error,
Reference: Http://stackoverflow.com/questions/10847106/get-error-while-building-libav-on-windows-using-mingw-and-msys
      1. Erase all files except. git
      2. git config --global core.autocrlf false
      3. git reset --hard
      4. Vim./configure View Code: set FF? If it's Unix, you can. DOS, No.
      5. Make
      6. Make install

Compiling x64 bits with MINGW-W64 ffmpeg

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.