一、工具
QMedaPlayer播放视频,底层依赖于第三方解码器。windows平台为directShow,linux平台为GStream。window平台可以安装K-Lite,linux平台一般各发行版都会默认安装GSteam。播放RTSP视频时,可以使用VLC播放器搭建一个视频推流服务器,用于拉流的客户端的调试。
1、解码器
K-Lite(window);GStream(Linux)
一般的linux发行版会内置GStream,可以通过如下命令确认是否安装。
gst-inspect-1.0 --version
如果未安装可以使用如下命令,在线安装
sudo apt-get update
sudo apt-get install gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gtk-doc-tools -y
2、VLC播放器
vlc-3.0.21-win64
二、代码demo
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QMediaPlayer>
#include <QVideoWidget>
#include

最低0.47元/天 解锁文章
2487

被折叠的 条评论
为什么被折叠?



