在QT中使用FFmpeg库的部分报错问题
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lavutil
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lavformat
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lswresample
win32: LIBS += -L$$PWD/../ffmpeg-win32-dev/lib/ -lswscale
INCLUDEPATH += $$PWD/../ffmpeg-win32-dev/include
DEPENDPATH += $$PWD/../ffmpeg-win32-dev/include
#include <libavutil/channel_layout.h> //用户音频声道布局操作 #include <libavutil/opt.h> //设置操作选项操作
#include <libavutil/mathematics.h> //用于数学相关操作
#include <libavutil/timestamp.h> //用于时间戳操作
#include <libavformat/avformat.h> //用于封装与解封装操作
#include <libswscale/swscale.h> //用于缩放、转换颜色格式操作
#include <libswresample/swresample.h> //用于进行音频采样率操作
使用遇到错误:D:\ffmpeg\dev\include\libavutil\common.h:210: error: ‘UINT64_C’ was not declared in this scope
if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (int32_t)((a>>63) ^ 0x7FFFFFFF);
解决方法:
在common.h文件中加入
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif
使用遇到错误D:\ffmpeg\dev\include\libavutil\common.h:32: error: #error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
#error missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROS
解决办法:
记住要加到error missing -D__STDC_CONSTANT_MACROS 的前面不然还是找不到
#if defined __cplusplus
#define __STDC_CONSTANT_MACROS
#endif
注:以上类似#error missing -D__STDC_CONSTANT_MACROS 的错误都可以这样处理。
建议都在common.h文件里声明,如下
/////新增////////////
#ifndef INT64_C
#define INT64_C(c) (c ## LL)
#define UINT64_C(c) (c ## ULL)
#endif #if defined __cplusplus
#define __STDC_CONSTANT_MACROS //common.h中的错误
#define __STDC_FORMAT_MACROS //timestamp.h中的错误
#endif /////////////////////
参考:https://blog.csdn.net/qq_36088602/article/details/77885023
undefined reference to `av_register_all' 问题解决
解决方法:
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
引入头文件因为实在cpp的环境下引入的,需要
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
切记 exterm后面一定要跟{}。
这样写
extern "C"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
是没有用的 这种是错误的。一定要带{},否则还是回报同样的错误。
参考:https://blog.csdn.net/qq_18144521/article/details/79608355
在QT中使用FFmpeg库的部分报错问题的更多相关文章
- Qt编译目录下exe文件执行报错问题的解决办法
使用Qt5.9.3+vs2017环境,编译项目生成Debug目录,运行其中的exe文件,出现以下错误(qt creator调试状态下或出安装包后是可以运行的): 经过查阅资料,发现是我重新配置Qt开发 ...
- 引用AForge.video.ffmpeg,打开时会报错:找不到指定的模块,需要把发行包第三方文件externals\ffmpeg\bin里的dll文件拷到windows的system32文件夹下。
引用AForge.video.ffmpeg,打开时会报错:找不到指定的模块,需要把发行包第三方文件externals\ffmpeg\bin里的dll文件拷到windows的system32文件夹下. ...
- IntelliJ IDEA中Mapper接口通过@Autowired注入报错的正确解决方式
转载请注明来源:四个空格 » IntelliJ IDEA中Mapper接口通过@Autowired注入报错的正确解决方式: 环境 ideaIU-2018.3.4.win: 错误提示: Could no ...
- postgresql 删除库的时候报错database "temp_test_yang" is being accessed by other users
删除库的时候报错 ERROR: database "temp_test_yang" is being accessed by other usersDETAIL: There ar ...
- 【转载】访问IIS中网站出现 403.14 - Forbidden报错信息
将网站发布后部署到IIS后,配置完应用程序池以及相关设置项后,在浏览器中访问设置好的网站,出现403.14 - Forbidden的错误信息,从错误信息的提示来看,应该是IIS服务器此网站目录的内容被 ...
- 【maven】【IDEA】idea中使用maven编译项目,报错java: 错误: 找不到符号 【2】
=================================================================================== idea中使用maven编译项目 ...
- eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context was:(...”
eclipse 中离线安装activiti插件,报错“An error occurred while collecting items to be installed session context ...
- ubuntu16.04安装库、插件报错:
安装一些插件.库,遇到报错 Could not fetch URL https://pypi.org/simple/pytest-pycodestyle/: There was a problem c ...
- QT中使用Glut库
用Qt中的QGLWidget窗体类中是不包括glut工具库的,难怪在myGLWidget(在我的程序中是QGLWidget的派生类)中绘制实心球体是说“glutSolidSphere”: 找不到标识符 ...
随机推荐
- 【JavaWeb】FreeMarker快速入门
FreeMarker Freemarker是免费开源的模板引擎技术: Freemarker脚本为Freemarker Template Language: Freemarker提供了大量内建函数来简化 ...
- 码云 git 常用命令
git 常用命令: git init 创建一个本地文件 ①git add . 当前文件夹下的所有内容 添加到暂存区 git add test.txt 指定文件夹添加 可以添压缩文件 ②git comm ...
- redis删除策略
redis 设置过期时间 Redis 中有个设置时间过期的功能,即对存储在 redis 数据库中的值可以设置一个过期时间.作为一个缓存数据库,这是非常实用的.如我们一般项目中的 token 或者一些登 ...
- [视频教程] ubuntu系统下安装最新版的MySQL
视频地址: https://www.bilibili.com/video/av69256331/ 官网文档https://dev.mysql.com/doc/mysql-apt-repo-quick- ...
- Flask Rest接口
Flask适用于简单的接口请求 安装 pip install Flask pip install Flask-RESTful 仅简单请求url,然后出发处理程序,返回处理结果 app.py代码如下 f ...
- /usr/lib/python2.7/subprocess.py", line 1239, in _execute_child
Traceback (most recent call last):File "/home/eping/bin/repo", line 685, in main(sys.argv[ ...
- leetcode 分类
https://www.douban.com/note/330562764/ https://blog.csdn.net/Irving_zhang/article/details/78835035 h ...
- Paper | Toward Convolutional Blind Denoising of Real Photographs
目录 故事背景 建模现实噪声 CBDNet 非对称损失 数据库 实验 发表在2019 CVPR. 摘要 While deep convolutional neural networks (CNNs) ...
- QList去掉重复项 .toSet()报错???
我们知道QList::toSet()函数可以将QList转成QSet.可我却遇到报错: QList<QVariant> datas = it.value().values(); QSet& ...
- Azure DevOps Server(TFS) 客户端分析
Azure DevOps Server(TFS) 是微软公司的软件协作开发管理平台产品,为软件研发.测试.实施提供全流程的服务.作为一款应用服务器产品,他的客户端是什么,在哪里下载客户端?我们在项目实 ...