ffmpeg 在VC2010 中的环境搭建
来源:互联网 发布:java常用算法手册豆瓣 编辑:程序博客网 时间:2024/06/05 20:51
最近开始研究ffmpeg。万事开头难,大家可能都希望能够运行sample code在VC2010吧。
这里list了方法,简而言之,分为如下几步:
1)http://ffmpeg.zeranoe.com/builds/
下载share版和dev版。我下的是64bit。 所以相应VC2010 project的建立也用x64版。
如果想用32bit版就下载相应的同时VC2010建立相应的project。
2)建立VC2010 空project后。copy dev版中的include文件夹下的所有文件夹到project中。同时copy dev版中的lib到project中。
3)像OpenCV一样,在project的property中,Linker->General->Additional Library Directories 填入lib的路径
在Linker->Input->Additional Dependencies 中填入 .lib结尾的文件
4) copy share版中的dll文件到project中
5) 由于VC不支持C99,所以我们还需拷贝2个文件去替换VC的原始文件。下载inttypes.h stdint.h, 替换C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include 下同名文件。
https://code.google.com/p/ffmpeg-wrapper/source/browse/trunk/ffmpeg_build/win32/include/?r=13
6) 在main.c 文件中
extern "C"
{
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif
#include "libavutil/imgutils.h"
#include "libavutil/parseutils.h"
#include "libswscale/swscale.h"
.................
..............
};
包含libavutil\common.h,由于里面#include <inttypes.h> ,会出现找不到inttypes.h的问题,
即使把inttypes.h的路径加上去之后,也无法编译通过,反而会出现一大堆问题。
解决办法如下:
删除#include <inttypes.h>这句,加上下面一大段
//Howard 2013-03-04 , 解决包含inttypes.h以后出现的Bug//#include <inttypes.h>
//Howard 2013-03-04 +++begin+++
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__)
#define CONFIG_WIN32
#endif
#if defined(WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(EMULATE_INTTYPES)
#define EMULATE_INTTYPES
#endif
#ifndef EMULATE_INTTYPES
#include <inttypes.h>
#else
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed int int32_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
#ifdef CONFIG_WIN32
typedef signed __int64 int64_t;
typedef unsigned __int64 uint64_t;
#else /* other OS */
typedef signed long long int64_t;
typedef unsigned long long uint64_t;
#endif /* other OS */
#endif /* EMULATE_INTTYPES */
//解决UINT64_C没定义的问题
#ifndef INT64_C
#define INT64_C(c)(c##LL)
#define UINT64_C(c) (c##ULL)
#endif
- ffmpeg 在VC2010 中的环境搭建
- ffmpeg 在VC2010 中的环境搭建
- FFMpeg在Windows下搭建开发环境
- 在VS2010上搭建FFMPEG环境
- FFMPEG 在vs2010中的环境配置
- 在VS2010上搭建FFMPEG环境与SDL环境配置
- GDAL181在VC2010环境下的使用方法
- GDAL181在VC2010环境下的使用方法
- 在VC2010下编译ffmpeg.c(版本2.1.4)
- FFmpeg简介及在vc2010下编译步骤
- VS2008 + ffmpeg 环境搭建
- VS2008 + ffmpeg 环境搭建
- ffmpeg Windows环境搭建
- Ubuntu ffmpeg 环境搭建
- FFmpeg搭建开发环境
- ffmpeg源码环境搭建
- Qt FFMPEG环境搭建
- Linux搭建FFMPEG环境
- 分布式服务框架 Zookeeper -- 管理分布式环境中的数据
- 装饰者模式(decorator)完全解析
- java内存管理,GC,内存泄漏
- HDU 4155 (博弈 记忆化搜索)
- java 使用html2canvas实现屏幕截图
- ffmpeg 在VC2010 中的环境搭建
- Qt + Qcustomplot绘图插件安装和配置
- C++程序设计语言练习 10.2 一个简单的date类
- 交互式Ruby Shell irb
- 文本框只能输入数字
- Maven管理jar
- uva11300 Spreading the Wealth
- 一个STM32F0 的IAP应用问题
- CardView 在 Theme.AppCompat.NoActionBar时 一些问题