本文共 1613 字,大约阅读时间需要 5 分钟。
#include <QVideoProbe>qmake: QT += multimediaInherits: QObject
Public Functions QVideoProbe(QObject *parent = Q_NULLPTR) ~QVideoProbe()bool isActive() constbool setSource(QMediaObject *source)bool setSource(QMediaRecorder *mediaRecorder)
void flush()void videoFrameProbed(const QVideoFrame &frame)
QMediaPlayer *player = new QMediaPlayer();QVideoProbe *probe = new QVideoProbe;connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)), this, SLOT(processFrame(QVideoFrame)));probe->setSource(player); // Returns true, hopefully.player->setVideoOutput(myVideoSurface);player->setMedia(QUrl::fromLocalFile("observation.mp4"));player->play(); // Start receiving frames as they get presented to myVideoSurface
_camera = qvariant_cast<QCamera*>(_qmlCamera->property("mediaObject"));
转载地址:http://zrsxx.baihongyu.com/