qtmultimedia

QMediaPlayer::error() is never emitted even though video fails to play

喜你入骨 提交于 2020-01-06 14:10:49
问题 I'm connecting the QMediaPlayer::error() signal and trying to play a video file: QMediaPlayer *player = new QMediaPlayer; QMediaPlaylist *playlist = new QMediaPlaylist(player); playlist->addMedia(QUrl::fromLocalFile("/path/to/file.mp4")); QVideoWidget *videoWidget = new QVideoWidget; player->setVideoOutput(videoWidget); videoWidget->resize(640, 340); videoWidget->show(); ErrorPrinter *errorPrinter = new ErrorPrinter(player); QObject::connect(player, SIGNAL(error(QMediaPlayer::Error)),

Qt 5.5: module “QtAudioEngine” is not installed

亡梦爱人 提交于 2020-01-05 15:36:52
问题 I'm running the official Qt 5.5 SDK on Ubuntu 15.10 and trying to play 3D sounds in QML: import QtAudioEngine 1.0 The project file: qt += multimedia The import statement results in qrc:///Main.qml:1:1: module "QtAudioEngine" is not installed . I'm a bit confused as I can see that the needed libs are in the SDK. What might be wrong here? 回答1: It's a bug in the official Qt SDK : https://bugreports.qt.io/browse/QTBUG-51567 来源: https://stackoverflow.com/questions/35640341/qt-5-5-module

[Windows, Qt5, QMediaPlayer, QMediaPlaylist]: Tiny duration black screen when the current video source changed

佐手、 提交于 2019-12-25 12:52:25
问题 I'm writing a Video Player with Qt5::QMediaPlayer to play randomly some videos for a randomly duration as this: int main(int argc, char *argv[]) { QApplication a(argc, argv); QMediaPlaylist* playlist = new QMediaPlaylist(&a); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/A-060405V4651.WMV")); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/E-102604.WMV")); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/C-102304.WMV")); QMediaPlayer*

[Windows, Qt5, QMediaPlayer, QMediaPlaylist]: Tiny duration black screen when the current video source changed

∥☆過路亽.° 提交于 2019-12-25 12:52:10
问题 I'm writing a Video Player with Qt5::QMediaPlayer to play randomly some videos for a randomly duration as this: int main(int argc, char *argv[]) { QApplication a(argc, argv); QMediaPlaylist* playlist = new QMediaPlaylist(&a); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/A-060405V4651.WMV")); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/E-102604.WMV")); playlist->addMedia(QUrl::fromLocalFile("./Resources/fractal-files/C-102304.WMV")); QMediaPlayer*

QMediaPlaylist::addMedia() returns true for nonexistent files

怎甘沉沦 提交于 2019-12-24 16:08:05
问题 The docs say that QMediaPlaylist::addMedia returns false if it fails: bool QMediaPlaylist::addMedia(const QMediaContent & content) Append the media content to the playlist. Returns true if the operation is successful, otherwise return false. But this code will print true even though the file doesn't exist: QMediaPlayer *player = new QMediaPlayer; QMediaPlaylist *playlist = new QMediaPlaylist(player); qDebug() << playlist->addMedia(QUrl("this file doesn't exist.mp4")); If the file doesn't

How to get length of a song using Qt 5.1?

感情迁移 提交于 2019-12-24 00:52:33
问题 How can I get the length of a song in Qt 5.1 API? I think I can read it using Length metadata but I'm not sure if this metadata will be available for all audio files. 回答1: You seem to be looking for the duration property. This would be the QML solution: duration : int This property holds the duration of the media in milliseconds. If the media doesn't have a fixed duration (a live stream for example) this will be 0. This would be the C++ solution: qint64 QAudioBuffer::duration() const Returns

Qt 5.10 QGraphicsView cannot scale QGraphicsScene to fullscreen

本秂侑毒 提交于 2019-12-20 05:15:13
问题 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 5.2.0 The camera service is missing

别来无恙 提交于 2019-12-20 05:05:40
问题 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

Qt 5.2.0 The camera service is missing

老子叫甜甜 提交于 2019-12-20 05:04:12
问题 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

QMediaplayer streaming from a custom QIODevice with encryption on Mac OS (10.9)

爷,独闯天下 提交于 2019-12-19 10:32:26
问题 i'm currently porting an application from Qt4(.8.4) to Qt5(.2.0). I'm nearly done with all the known changes like deprecated toAscii()-function, missing QtGui and so on. Now we had a music player using the phonon framework which is not supported any more and got replaced by the QtMultimedia module including the QMediaPlayer and a bunch of Audio-Handling classes. Our implementation of the player takes a custom QIODevice. This device provides an interface to encrypted audiofiles on the disk.