虚拟机版本:VMware 14
Linux版本:Ubuntu 16.04
QT版本:QT-5.12
1 编译FFmpeg
FFmpeg版本:4.2.1
2 安装qt-5.12.10
https://blog.csdn.net/lzp_k2/article/details/82662112
下载地址:https://download.qt.io/archive/qt/
下载地址:https://download.qt.io/archive/qt/5.12/5.12.10/
如果报错
ubuntu安装qt5 Could not load the Qt platform plugin "xcb" in "" even though it was found.
https://blog.csdn.net/u012768805/article/details/98756925
需要安装:
sudo apt install --reinstall libxcb-xinerama0
Ubuntu16.04打开Qt显示/home/user/.config/QtProject/qtcreator/qtversion.xml :Permission denied
权限不够所导致,执⾏命令 sudo chown -R user:user ~/.config/ 即可解决。
默认需要使⽤sudo权限启动
不是sudo权限也能启动则需要修改权限
语法:
sudo chown -R username:username ~/.config/
⽐如我的ubuntu:
pro⽂件写法
main.c
sudo chown -R lqf:lqf ~/.config/
3 QT使⽤FFmpeg
linux_1-ffmpeg
TEMPLATE = app
CONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += \
main.c
INCLUDEPATH += /home/lqf/ffmpeg_build/include
LIBS += /home/lqf/ffmpeg_build/lib/libavcodec.a \
/home/lqf/ffmpeg_build/lib/libavdevice.a \
/home/lqf/ffmpeg_build/lib/libavfilter.a \
/home/lqf/ffmpeg_build/lib/libavformat.a \
/home/lqf/ffmpeg_build/lib/libavutil.a \
/home/lqf/ffmpeg_build/lib/libswresample.a \
/home/lqf/ffmpeg_build/lib/libswscale.a
#include <stdio.h>
// 包含ffmpeg头⽂件
#include "libavutil/avutil.h"
int main()
{
printf("Hello FFMPEG, version is %s\n", av_version_info());
return 0;
}
linux_2-sdl
下载地址:https://www.libsdl.org/download-2.0.php
- 下载SDL源码库,SDL2-2.0.10.tar.gz
- 解压,然后依次执⾏命令
./autogen.sh
./configure --prefix=/home/lqf/ffmpeg_build --bindir=/home/lqf/bin
make
sudo make install
linux_2-sdl-basic项⽬
linux_2-sdl-yuv
linux_3-ffmpeg-extract-aac
重点看
⼯程的pro⽂件
网友评论