FFMpeg中的实例output_example.c的编译
来源:互联网 发布:防弹少年团amas知乎 编辑:程序博客网 时间:2024/05/22 06:19
FFMpeg中的实例output_example.c的编译
关于ffmpeg在windows上的编译,在www.ffmpeg.com.cn上有详细的讲解,在成功编译好ffmpeg后,便在MSVC中编译ffmpeg自带的实例output_example.c。
首先自己在MSVC下建立一个空的控制台的应用程序,将output_example.c加入到工程中。由于在MSVC中是使用编译ffmpeg时生产的.lib和.dll文件,所以我们需要连接它们。在这里我们需要avcodec-51.lib、avformat-51.lib和avutil-49.lib这三个静态库,故在我们编译工程之前就将它们加到工程中。
编译会发现提示: Cannot open include file: 'inttypes.h': No such file or directory 的出错信息,可通过如下方法解决:
1、找到include目录中的ffmpeg/common.h
2、在“#define COMMON_H”之后加入如下代码,同时删除“#include <inttypes.h>” 然后保存:
1、找到include目录中的ffmpeg/common.h
2、在“#define COMMON_H”之后加入如下代码,同时删除“#include <inttypes.h>” 然后保存:
再次编译出现错误
error C2054: 在“inline”之后应输入“(”
这样一系列错误,我们只要在“#define COMMON_H”之后加入如下代码
#if defined(WIN32) && !defined(__cplusplus)
#define inline __inline
#endif
#define inline __inline
#endif
再次编译发现出现error LNK2019: 无法解析的外部符号_snprintf,该符号在函数_main 中被引用
这个连接错误(注意要是没有将开头说的那三个库先加入,这儿出现的连接错误更多)。
分析后知道错误是由第470行
snprintf(oc->filename, sizeof(oc->filename), "%s", filename);
引起的,解决方案如下:
MSVC 2005:
修改为_snprintf_s(oc->filename, _countof(oc->filename), 1024, "%s", filename);
MSVC 6.0
修改为_snprintf(oc->filename, sizeof(oc->filename), "%s", filename)。
- FFMpeg中的实例output_example.c的编译
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- [转]FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg的output_example.c例子分析
- FFMpeg output_example.c 分析
- vs2010配置FFMPEG SDK并编译output_example.c遇到的问题
- FFmpeg SDK使用实例output_example的分析之一
- FFmpeg SDK使用实例output_example的分析之二
- ffmpeg output_example.c 例程分析
- FFMpeg的output_example.c例子分析 (解码流程)
- ffmpeg基础与编译_在VS2008下调试output_example.c(详细步骤)
- 使用ffmpeg sdk v3.2和vc6.0编译output_example.c
- tomcat5配置 常见数据库连接池的例子
- Visual Basic, Java, Python, PHP, MySql and C# Books
- 无泪天使 №.1
- DLL返回字符给主程序
- Effective C++学习笔记:写operator new和operator delete时要遵循常规
- FFMpeg中的实例output_example.c的编译
- 中国最完整的sysctl.conf优化方案
- LOD地形设计(四)
- Java数据库编程中的几个常用技巧
- 关于DELPHI架构开发系列---数据篇
- 开源,明智与无奈的抉择
- SQL Server数据库备份与还原处理
- IT圈最名副其实的十大80后
- HibernateTemplate中HibernateCallback的事务