参考:
http://jingyan.baidu.com/article/456c463b67b4310a59314468.html
http://www.cnblogs.com/dwdxdy/p/3625766.html
http://www.tuicool.com/articles/muYNfe
http://www.cnblogs.com/dwdxdy/p/3626999.html
下载:
eclipse(JDK等)
minGW(minGW+MSYS)
http://sourceforge.net/projects/mingw/files/latest/download?source=files
选择安装组件C Compiler、C++ Compiler、MSYS Basic System和 MinGW Developer Toolkit。
MinGW\bin下的文件“mingw32-make.exe”改名成“make.exe”
系统变量PATH 变量值添加D:\MinGW\bin;
eclipse下装CDT
可选安装(SDL、X264等)
编译YASM,使用msys.bat cd至yasm目录(或直接下载编译好的yasm后拷贝至相应目录)
./configure –-prefix=D:/MinGW/yasm/local/yasm make make install
重命名为yasm.exe,并将之拷贝到${MinGWDir}\msys\1.0\bin下
编译ffmpeg:
./configure –-enable-shared -–disable-static –-enable-memalign-hack
make make install
编译时遇到错误解决如下:(只为编译通过)
minGW中unistd.h修改注释
//lym //_EXTERN_C _cdecl __MINGW_NOTHROW //int __mingw_sleep( unsigned long, unsigned long );
//lym _cdecl __MINGW_NOTHROW; int nanosleep( const struct timespec *, struct timespec * );
//lym //typedef unsigned long useconds_t __MINGW_ATTRIB_DEPRECATED; //int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
//lym //unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
//lym //int _cdecl ftruncate( int, off_t );
2.建立ffmpeg工程
Eclipse-->File-->New-->Project-->C project,选择Makefile project,选择MinGW GCC。
将编译后文件复制进工程。F5刷新。在调试之前,需要把生成动态链接库文件拷贝到工程目录 ,如avcodec-54.dll,avdevice-54.dll,avfilter-53.dll,avformat-54.dll,avutil-52.dll,postproc-52.dll,swresample-0.dll。