Golang direct call to FFmpeg Precompiled Class Library (Windows)

Source: Internet
Author: User
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

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.