当前位置:网站首页>Qt+ffmpeg environment construction
Qt+ffmpeg environment construction
2022-07-28 22:38:00 【Passing bears~】
download FFmpeg library
FFmpeg The library can be compiled using the source code or downloaded from the Internet , Here we use the compiled library file downloaded from the Internet .
1. From the website :https://ffmpeg.zeranoe.com/builds/ Download compiled FFmpeg library . I choose to download 64 Bit Library .
2. Download the compiled library address https://github.com/BtbN/FFmpeg-Builds/releases
Static,Share,Dev Download all three , The three downloaded files are :
Download compiled ffmpeg library 
add to FFmpeg Library to Qt project
Use QtCreator Create a Qt gui project , After creating the project :
Create... In the project root directory ffmpeg Folder , stay ffmpeg Create in folder include and lib Folder
- decompression ffmpeg-3.4-win64-dev.zip Compressed files
- After unzipping ffmpeg-3.4-win64-dev Under the folder include Copy all header files in the directory to the newly created ffmpeg In the catalog include Folder in
- After unzipping ffmpeg-3.4-win64-dev Under the folder lib All in catalog dll.a Copy the ending file to ffmpeg Of lib In the folder
- After unzipping ffmpeg-3.4-win64-shared Under the folder bin All in catalog dll Copy the ending file to ffmpeg Of bin In the folder


Modification item pro file , stay pro Add the following to the file :
INCLUDEPATH += ../ffmpeg/include
LIBS += -L../ffmpeg/lib \
-lavcodec \
-lavfilter \
-lavformat \
-lavutil \
-lswscale
LIBS += -L../ffmpeg/bin \
-lavcodec \
-lavfilter \
-lavformat \
-lavutil \
-lswscale
test FFmpeg Whether the library can be used normally
- In the project FFmpegLibTestFrm.cpp Add... To the file FFmpeg The header file
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#include <libavdevice/avdevice.h>
#include <libavformat/version.h>
#include <libavutil/time.h>
#include <libavutil/mathematics.h>
}
- stay FFmpegLibTestFrm Add the following code to the constructor
FFmpegLibTestFrm::FFmpegLibTestFrm(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::FFmpegLibTestFrm)
{
ui->setupUi(this);
qDebug("------------------------------------------------------------------");
qDebug("%s", avcodec_configuration());
qDebug("version: %d", avcodec_version());
qDebug("------------------------------------------------------------------");
}
- Compile run program , Compile successfully

The effect is as follows

边栏推荐
- When can I sign up for the 2022 class I constructor examination?
- If you want to grow rapidly, you must first experience a major blow!
- What does GPRS network mean
- Command line agent: proxychains configuration
- [leetcode] maximum depth of binary tree
- Using nodejs to operate MySQL
- 微信小程序里button点击的时候会边框有黑线
- Less than a year after its establishment! MIT derivative quantum computing company completed financing of US $9million
- [CS231N]Lecture_ 2:Image Classification pipelin
- Summary of common error types in JS
猜你喜欢

2022年一级建造师考试什么时候才能报名?

php二维数组如何删除去除第一行元素

Sword finger offer II 055. Binary search tree iterator (medium binary search tree iterator)

Soft exam network engineer

MySQL installation and configuration (super detailed, simple and practical)
![[Ruiji takeout project]day4 - dish management](/img/2a/2d9deb7a583aa37b38a67ef2c74ee7.png)
[Ruiji takeout project]day4 - dish management

Imx6q GPIO multiplexing

(翻译)图技术简明历史

6K6w5LiA5qyh5pS75Ye75YiG5p6Q

MySQL built-in functions
随机推荐
Idea generate class diagram plug-in UML (super detailed)
Why doesn't the icon on the elment plus icon input display
Detection and tracking evaluation index
imx6q gpio复用
(翻译)图技术简明历史
Sword finger offer II 067. maximum XOR (medium prefix tree bit operation array)
Which is the file transfer command in the basic services of the Internet
Sword finger offer II 057. the difference between the value and the subscript is within the given range (medium array bucket sort sliding window TreeSet)
PaddleNLP基于ERNIR3.0文本分类以CAIL2018-SMALL数据集罪名预测任务为例【多标签】
npm ERR code ETIMEDOUT npm ERR syscall connect npm ERR errno ETIMEDOUT npm ERR network reques...
AWK空行过滤
[CVPR 2021] cylinder3d: cylindrical asymmetric 3D convolution network for LIDAR point cloud segmentation
[binary tree] pseudo palindrome path in binary tree
Excel-vba quick start (XIII. Common usage of date)
Sword finger offer II 054. Sum of all values greater than or equal to nodes (medium binary search tree DFS)
SSH password free login
Ultra detailed visual studio 2019 running littlevgl (lvgl) simulator
ssh免密登陆
redis相关
32. Longest valid bracket (difficult stack string)