使用ffmpeg和QT开发播放器(4)—完整环境配置

1.首先先创建一个vs qt项目

ok ,能跑起来

2.需要自己定义一些文件,并且将ffmpeg的源码放进去,即配置好ffmpeg环境,这个前面有讲过的。

3.一些路径的设置

在运行时成功的

把控制台调出来

我们进入到我们设置的bin目录下 直接执行该项目生成的.exe文件, 错

这就涉及打包发布了,以后再详解。

这个地方只配置了64位debug版本,其他版本可自己配置,教程再前面。


main.cpp源码:

#include “xplay.h”

#include <QtWidgets/QApplication>

#include <iostream>

using namespace std;

// 引用c语言的头文件

extern”C” {

#include <libavcodec/avcodec.h>

}

//预处理指令导入库

#pragma comment(lib,”avcodec.lib”😉

int main(int argc, char *argv[])

{

//显示配置的信息

cout << “test ffmpeg” << endl;

#ifdef _WIN64 //64位 win

cout << “windows x64” << endl;

#endif

#ifdef WIN32 //32位 win

cout << “windows x86” << endl;

#endif

#ifdef _WIN32 //64位和32位 win

#else

cout << “linux” << endl;

#endif;

cout << avcodec_configuration() << endl;

QApplication a(argc, argv);

Xplay w;

w.show();

return a.exec();

}

声明:本站部分文章内容及图片转载于互联 、内容不代表本站观点,如有内容涉及侵权,请您立即联系本站处理,非常感谢!

(0)
上一篇 2019年3月2日
下一篇 2019年3月2日

相关推荐