qmediaplayer

PyQt video frame update signal (Trigger function after each video frame)

五迷三道 提交于 2021-02-10 14:44:33
问题 I am creating a video player and I need to draw some polygons on top of it. I am using a QGraphicsScene to create this and I need to update the polygons on screen after each frame. I am currently using the QMediaPlayer paired up with a QGraphicsVideoItem to create this. The problem I am having is that the QMediaPlayer doesn't have a signal that activates on each frame. It has positionChanged(), but this only seems to trigger once every second. I tried using QMovie since it does send updates

Force QMediaPlayer to update position accurately for video scrubbing application?

∥☆過路亽.° 提交于 2021-02-07 22:48:19
问题 I am writing an application which will allow the user to scrub through an open video. Developing on Windows 7/8 with Qt 5.3, I have been using QMediaPlayer and QVideoWidget following the qvideowidget example project. The result has been pretty good, except that the QVideoWidget seems only to update during idle time. Still, it's a good start and it's usable. However, when I build on Mac OS 10.10 (again with Qt 5.3), scrubbing behaves as though there were only one frame per second in the video.

Force QMediaPlayer to update position accurately for video scrubbing application?

Deadly 提交于 2021-02-07 22:48:19
问题 I am writing an application which will allow the user to scrub through an open video. Developing on Windows 7/8 with Qt 5.3, I have been using QMediaPlayer and QVideoWidget following the qvideowidget example project. The result has been pretty good, except that the QVideoWidget seems only to update during idle time. Still, it's a good start and it's usable. However, when I build on Mac OS 10.10 (again with Qt 5.3), scrubbing behaves as though there were only one frame per second in the video.

How to play multiple clips of a video one after another

ぐ巨炮叔叔 提交于 2021-02-07 16:47:25
问题 I have a video, from which I am getting some clips by time interval, and I want to do the following: Make the clips play one after another - so first clip plays, then after it is done, then second plays, and so on... But currently, it's good, but it just plays the part in between the time intervals of the two clips, which I don't want it to do. How would I go about doing that? I tried using e.g. pause , stop , etc... simply everything, but none of them worked. My version of python: 3.6.0 And

How to play multiple clips of a video one after another

末鹿安然 提交于 2021-02-07 16:45:46
问题 I have a video, from which I am getting some clips by time interval, and I want to do the following: Make the clips play one after another - so first clip plays, then after it is done, then second plays, and so on... But currently, it's good, but it just plays the part in between the time intervals of the two clips, which I don't want it to do. How would I go about doing that? I tried using e.g. pause , stop , etc... simply everything, but none of them worked. My version of python: 3.6.0 And

How to play multiple clips of a video one after another

雨燕双飞 提交于 2021-02-07 16:42:15
问题 I have a video, from which I am getting some clips by time interval, and I want to do the following: Make the clips play one after another - so first clip plays, then after it is done, then second plays, and so on... But currently, it's good, but it just plays the part in between the time intervals of the two clips, which I don't want it to do. How would I go about doing that? I tried using e.g. pause , stop , etc... simply everything, but none of them worked. My version of python: 3.6.0 And

How to play multiple clips of a video one after another

吃可爱长大的小学妹 提交于 2021-02-07 16:41:56
问题 I have a video, from which I am getting some clips by time interval, and I want to do the following: Make the clips play one after another - so first clip plays, then after it is done, then second plays, and so on... But currently, it's good, but it just plays the part in between the time intervals of the two clips, which I don't want it to do. How would I go about doing that? I tried using e.g. pause , stop , etc... simply everything, but none of them worked. My version of python: 3.6.0 And

Qt QGraphicsView not playing any video

。_饼干妹妹 提交于 2021-02-05 07:01:28
问题 I have a very simple QT 5.11.0 application with a graphicsview that i would like to play a video in. Here is my code, it compiles, loads and displays a blank graphicsview. #include "Demo_TeleLink.h" Demo_TeleLink::Demo_TeleLink(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); scene = new QGraphicsScene; player = new QMediaPlayer(); videoItem = new QGraphicsVideoItem; newString = "C://Users//Chris//Desktop//Sample1.mp4"; ui.graphicsView->setScene(scene); player->setVideoOutput

PyQt5 : QMediaPlayer can't replay audio from QBuffer

别等时光非礼了梦想. 提交于 2021-01-28 06:40:35
问题 I have a QBuffer in RAM with a temporary wav file, and I want to let the user listen it from any point as many times as (s)he want. But, it only allows playing it once, and doesn't allow replaying it. If I play the audio from a file ( QUrl.fromLocalFile ), it can replay it. What's the difference? How to fix it? 1) To play the wav file from RAM I use the following code: data = b"" with open(fname, "rb") as file: data = file.read() buf = QBuffer() buf.setData(data) #For debugging. Real buffer

Modifing and displaying QVideoFrames obtained in QAbstractVideoSurface

泪湿孤枕 提交于 2020-06-03 16:03:46
问题 I have very a simply application written in QT in which I want to display a movie by using QMediaPlayer , but before I will display any frame I would like to detect on it some objects and mark them by drawing a rectangle over it. I've read in http://doc.qt.io/qt-5/videooverview.html that I can access each frame by subclassing QAbstractVideoSurface and so I dit it. class VideoSurface : public QAbstractVideoSurface { Q_OBJECT bool present(const QVideoFrame &frame) override { if (surfaceFormat()