更多精彩内容 |
---|
个人内容分类汇总 |
sudo apt install yasm
sudo apt -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
mkdir build
cd build
../configure --prefix=./FFmpeg --enable-shared --disable-static --disable-doc
sudo make -j4
sudo make install
bin include lib share
四个文件夹。新建Qt工程
在.pro文件中导入ffmpeg库
unix:!macx: LIBS += -L$$PWD/../../../下载/ffmpeg-4.4/build/FFmpeg/lib/ -lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswresample -lswscale
INCLUDEPATH += $$PWD/../../../下载/ffmpeg-4.4/build/FFmpeg/include
DEPENDPATH += $$PWD/../../../下载/ffmpeg-4.4/build/FFmpeg/include
使用下列代码
#include
extern "C"
{
#include
#include
#include
#include
#include
#include
#include
}
int main(int argc, char *argv[])
{
qDebug() << avcodec_configuration();
qDebug() << avcodec_version();
return 0;
}
输出结果
--prefix=./FFmpeg --enable-shared --disable-static --disable-doc
3835492