ffmpeg+x264 Windows MSVC Static compilation

Source: Internet
Author: User

Try Ubuntu and win under MinGW compiled version, but all in Vistual Studio link because of dependency libgcc.a, LIBMINGW.A, LIBMINGWEX.A will have a symbolic conflict with MSCRT.

Finally, it's all compiled with MSVC.

1. x264

According to the official document description:

The following example command would configure libx264:

Cc=cl./configure--enable-static--prefix=<prefix>--extra-cflags= "-dno_prefix" make

the No_prefix Flag may is necessary to make linkable libraries.

Execution mode:

-Requirements vs. sp2+

-First Execute C:\Program Files (x86) \microsoft Visual Studio 12.0\common7\tools\vsdevcmd.bat

-In the cut to bash, [CC=CL] uses the MSVC compiler, the other is exactly the same as in the LINUX/MAC compilation

Generate Libx264.lib

2. FFmpeg

Using the latest version 3.0, the compilation using the Msvc tool chain has been supported

In accordance with the official document set up the environment, it will be able to compile smoothly, but not to generate. lib instead. A,virtual Studio is also supported

#!/bin/Bashset-Xprefix=$(pwd)/win32/InstallExport Pkg_config_path="$prefix/lib/pkgconfig" mkdir-P win32/InstallCD FFmpegif[[!-f Config.mak]]; Then  ./Configure--toolchain=msvc--enable-GPL--enable-nonfree--enable-Version3--arch=x86--target-os=Mingw32--Pkg-config=Pkg-config       --disable-Stripping--disable-everything--enable-Static--disable-shared--disable-Doc--enable-Avresample--enable-demuxer=RTSP--enable-muxer=RTSP--disable-Ffplay--disable-Ffserver--enable-FFmpeg--disable-Ffprobe--enable-libx264--enable-encoder=libx264--enable-decoder=H264--enable-protocol=RTP--enable-Hwaccels--enable-zlib--disable-Devices--disable-Avdevice--extra-cflags="-I$PREFIX/INCLUDE-MT"        --extra-ldflags=-l$prefix/Lib--prefix= $prefix/FFmpegfi Make Install

Https://trac.ffmpeg.org/wiki/CompilationGuide/MSVC

ffmpeg+x264 Windows MSVC Static compilation

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.