Qt中FFMPEG环境的搭建

目录

一:准备工作

二:在.pro中进行配置

三:环境搭建测试


一:准备工作

二:在.pro中进行配置

INCLUDEPATH += $$PWD/ffmpeg/include \

LIBS    += $$PWD/ffmpeg/lib/avcodec.lib \
            $$PWD/ffmpeg/lib/avdevice.lib \
            $$PWD/ffmpeg/lib/avfilter.lib \
            $$PWD/ffmpeg/lib/avformat.lib \
            $$PWD/ffmpeg/lib/avutil.lib \
            $$PWD/ffmpeg/lib/postproc.lib \
            $$PWD/ffmpeg/lib/swresample.lib \
            $$PWD/ffmpeg/lib/swscale.lib \

DESTDIR=bin

包括有:相关的接口文件,使用到的相关库,可执行程序默认生成位置的设置

注意点:由于已经在Qt中已经有了数据库环境的搭建,因此就需要在bin文件中加入sqlite3.dll依赖,才可以在Qt中成功运行程序。

三:环境搭建测试

    qDebug("------------------------------------------------------------------------");
    qDebug("%s", avcodec_configuration());
    qDebug("version: %d", avcodec_version());
    qDebug("------------------------------------------------------------------------");
//当前C++兼容C语言
extern "C"
{
//avcodec:编解码(最重要的库)
#include <libavcodec/avcodec.h>
//avformat:封装格式处理
#include <libavformat/avformat.h>
//swscale:视频像素数据格式转换
#include <libswscale/swscale.h>
//avdevice:各种设备的输入输出
#include <libavdevice/avdevice.h>
//avutil:工具库(大部分库都需要这个库的支持)
#include <libavutil/avutil.h>
}

检测环境是否成功搭建: 

猜你喜欢

转载自blog.csdn.net/m0_56051805/article/details/124976958