qtmultimedia

Getting video frame in provided time Qt

你。 提交于 2019-12-13 16:34:42
问题 What I want to do is to get video frame at some time (for example at 20 sec). I know I could do something like this - rewind video and pause it: QMediaPlayer* player = new QMediaPlayer; ... player->play(); player->setPosition(20000); player->pause(); But is there some more elegant solution (this seems like a hack to me since I don't need whole video but only a frame at some time)? 回答1: Below steps may help you to capture a frame from a video file. Project level QT += multimedia Code level

Qt 5.10 QGraphicsView cannot scale QGraphicsScene to fullscreen

不羁的心 提交于 2019-12-13 03:36:45
问题 I am experimenting with Qt 5.10 QMultimedia on Ubuntu 16.04 to play Gstreamer recorded videos. The meat of the application is shown below. I cannot seem to get the video to scale to the full Qt screen after I call showMaximized(). The small video shown in the middle of the screen is shown below ( I want it to scale to the entire window ): The Code: #include "mainwindow.h" #include <QVideoWidget> #include <QGraphicsView> #include <QtMultimedia> #include <QGraphicsVideoItem> #include <unistd.h>

Qt iOS: how to return QVideoFrame with type GLTextureHandle from QVideoFilterRunnable

佐手、 提交于 2019-12-12 03:55:17
问题 I'm trying to capture camera output frame and process it further in GPU pipeline. For this reason returing frame as a GPU texture is the best option. After inheriting from QVideoFilterRunnable class received by run method QVideoFrame objects has type which is not equal to QAbstractVideoBuffer::GLTextureHandle. It's equal to NoHandle and I need to do map/unmap and load texture manually by glTexImage , which is not good for performance. Is there any control options that can be used to return

QtMultimedia MP3 audio playback

和自甴很熟 提交于 2019-12-11 06:08:28
问题 I want to play an audio (MP3) file when the QmainWindow opens and have used the script from here. This is what my code looks like: app = QApplication(sys.argv) window = MainWindow() window.show() url = QUrl.fromLocalFile("./sound2.mp3") content = QMediaContent(url) player = QMediaPlayer() player.setMedia(content) player.play() player.stateChanged.connect(app.quit) app.exec_() There is no problem running the script except that when I close the app the MP3 sound file continues to play when it

Deploying Qt app with QtMultimedia on Linux

坚强是说给别人听的谎言 提交于 2019-12-11 05:29:54
问题 I tried to deploy an application Qt (5.3) on Linux (Ubuntu 14.04) which use QtMultimedia I have first deployed a simple application (Hello World) to understand. I have had no problem ro run the application on Pc without install Qt. In the same way, I have tried to desploy my whole app but I have a problem when I want execute my application : QQmlApplicationEngine failed to load component qrc:/main.qml:3 module "QtMultimedia" is not installed I have understand the problem comes to QtMultimedia

PyQt5 - Get file name from an opened file, not a file path

こ雲淡風輕ζ 提交于 2019-12-11 02:30:42
问题 Let's say I opened a file called file1.mp3 in a PyQt5 app using the file dialog and assigned it to a variable like this: song = QFileDialog.getOpenFileName(self, "Open Song", "~", "Sound Files (*.mp3 *.ogg *.wav *.m4a)") print(song[0]) url = QUrl.fromLocalFile(song[0]) self.playlist.addMedia(QMediaContent(url)) How can I get the file name instead of a file path so I can display it in a statusBar? Or even better, is there a "now playing"-like function I could use or create? 回答1: There are

QtQuick: cannot playback any video on embedded linux

此生再无相见时 提交于 2019-12-07 16:47:23
问题 I cross compiled Qt 5.2.1 for TI AM335x board using the toolchain provided by TI together with their SDK 6.00.00. Unluckily I am not able to reproduce any video in QML... The debug console tells: defaultServiceProvider::requestService(): no service found for – “org.qt-project.qt.mediaplayer” Is there something that I am missing in cross-compilation? maybe some dependencies? Can somebody help me in determining what I am missing? You can find here my cross-compilation configuration and here the

QtQuick: cannot playback any video on embedded linux

喜夏-厌秋 提交于 2019-12-05 21:28:03
I cross compiled Qt 5.2.1 for TI AM335x board using the toolchain provided by TI together with their SDK 6.00.00. Unluckily I am not able to reproduce any video in QML... The debug console tells: defaultServiceProvider::requestService(): no service found for – “org.qt-project.qt.mediaplayer” Is there something that I am missing in cross-compilation? maybe some dependencies? Can somebody help me in determining what I am missing? You can find here my cross-compilation configuration and here the full trace of messages produced by the application when setting the environment variable QT_DEBUG

Qt 5.10 QGraphicsView cannot scale QGraphicsScene to fullscreen

…衆ロ難τιáo~ 提交于 2019-12-02 07:24:36
I am experimenting with Qt 5.10 QMultimedia on Ubuntu 16.04 to play Gstreamer recorded videos. The meat of the application is shown below. I cannot seem to get the video to scale to the full Qt screen after I call showMaximized(). The small video shown in the middle of the screen is shown below ( I want it to scale to the entire window ): The Code: #include "mainwindow.h" #include <QVideoWidget> #include <QGraphicsView> #include <QtMultimedia> #include <QGraphicsVideoItem> #include <unistd.h> #include <QTimer> #include <QDebug> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {

Qt 5.2.0 The camera service is missing

99封情书 提交于 2019-12-02 04:53:32
I have a Logitech HD Webcam C270. I want to write a simple webcam application and so I tried to compile the Qt camera example (Qt\Qt5.2.0\5.2.0\msvc2010_opengl\examples\multimediawidgets\camera). My dev system is a Windows 7 x64 SP1 Virtual Machine. If the webcam is connected to this VM the example runs very well. Qt and the windows device manager detect the webcam as "USB Video device". When I try to run the compiled binary on my non-virtual system (which is also Win7 x64 SP1) the application says "the camera service is missing" (yes, I disconnected the camera from the virtual machine). On