This is a creation in Article, where the information may have evolved or changed.
MinGW Introduction
MINGW (minimalist GNU on Windows) is an emulated Linux compilation environment that compiles Linux programs under Windows, and provides Linux C, C + + header files, system libraries, and a collection of compilation tools under Linux, such as GCC , g++, and make tools. Allows the compiled binary to run on Windows. (The previous Cygwin, though also a GNU Windows transplant, was Cygwin copyrighted, not GNU)
MinGW download
"MinGW"
http://sourceforge.NET/projects/mingw/
"MinGW environment variable Configuration"
Http://jingyan.baidu.com/article/6b97984da0bd8a1ca2b0bf90.html
Download the latest MinGW, which will be downloaded separately depending on the set of tools you actually choose to install, such as GCC, G++sort of. Run MinGW.EXE: default installation to the C:\MinGW directoryin general, the following three sets of Toolsets are sufficient:MinGW Base Tools //Basic GCC compilerg++ compiler //g++compilerMINGGW Make //make Toolsis the test installation successful? enter GCC on the command line --version or GCC --if the correct version information appears, then the PATH the path is OK.
FFmpeg pre-compiled library download
From the http://ffmpeg.zeranoe.com/builds/website
1.下载Dev版本,里面包含了ffmpeg的xxx.h头文件以及xxx.lib库文件。2.下载Shared版本,里面包含了ffmpeg的dll文件。3.解压之后, * 把dev版本文件夹中的Include和lib目录整个儿复制合并到C:\MinGW目录下。 * 将share版本文件夹中bin目录下对应的所有dll复制合并到C:\MinGW项目路径下
Golang Program
package main/* #cgo ldflags:-llibavformat-llibavcodec -llibavutil-llibavdevice-llibavfilter-llibswresample-llibswscale #include < Libavformat/avformat.h> #include <libavcodec/avcodec.h> #include <libavutil/avutil.h> #include <libavutil /opt.h> #include <libavdevice/avdevice.h> static const avstream *go_av_streams_get (const AVStream * * streams,unsigned int n) {return streams[n];} */import "C" Import ( "FMT" ) Func main () {FMT. Println (C.avdevice_version ())}
Refer to the FFmpeg encapsulation class for extended
Https://github.com/imkira/go-libav
Https://github.com/giorgisio/goav