I´m quite new to Qt development and I´m using Qt5 Beta1 on MacOSX.
For the last two days I´ve been reading the docs and looking for information about the different possibilities that I have in order to implement a widget that displays the frame of a video which corresponds to a concrete moment in time. A good old preview, in short. First I thought that, since I did not need anything fancy, Phonon would be the right choice, as it´s called to be "on a higher level (than QTMultimedia) and in many cases more suitable for application developers." I read its documentation and even found some discussions that could help me starting, like this; http://www.qtcentre.org/threads/13221-QT-4-4-Phonon-Video-Rendering-a-single-frame. But then, when I tried to make something on my own, I realized that I did not have the Phonon library. Surprised from it, I research about Phonon and Qt5. And that´s when all the trouble began.
I started reading conversation such as this one: http://comments.gmane.org/gmane.comp.lib.qt.user/1581 or this one: http://comments.gmane.org/gmane.comp.lib.qt.devel/3905 or this other link: https://bugreports.qt.io/browse/QTBUG-26471. And I got really confused, without knowing if it was a good idea to download the Phonon library or it was not going to be supported on Qt5 after some time. So I decided to go a step back and think again about using QTMultimedia instead of Phonon. I looked at their VideoWidget example http://doc.qt.io/qt-4.8/qt-multimedia-videowidget-example.html and when I tried to run it, it threw several errors (I´m posting just the beginning of the output):
In file included from ../VideoExample/videoplayer.cpp:43:
In file included from ../VideoExample/videowidget.h:44:
../VideoExample/videowidgetsurface.h:57:11: warning: 'VideoWidgetSurface::isFormatSupported' hides overloaded virtual function [-Woverloaded-virtual]
bool isFormatSupported(const QVideoSurfaceFormat &format, QVideoSurfaceFormat *similar) const;
^
../../Downloads/qt-everywhere-opensource-src-5.0.0-beta1/qtbase/include/QtMultimedia/../../../qtmultimedia/src/multimedia/video/qabstractvideosurface.h:78:18: note: hidden overloaded virtual function 'QAbstractVideoSurface::isFormatSupported' declared here
virtual bool isFormatSupported(const QVideoSurfaceFormat &format) const;
^
../VideoExample/videoplayer.cpp:61:40: error: expected a type
QAbstractButton *openButton = new QPushButton(tr("Open..."));
^
../VideoExample/videoplayer.cpp:62:6: error: no matching member function for call to 'connect'
connect(openButton, SIGNAL(clicked()), this, SLOT(openFile()));
^~~~~~~
../../Downloads/qt-everywhere-opensource-src-5.0.0-beta1/qtbase/include/QtCore/../../src/corelib/kernel/qobject.h:211:36: note: candidate function not viable: cannot convert argument of incomplete type 'QAbstractButton *' to 'const QObject *'
static QMetaObject::Connection connect(const QObject *sender, const char *signal,
And this is the moment when I felt I was completely lost and wrote here :/
So my actual questions are:
In general, thoughts about this topic would be greatly appreciated.
The Phonon framework seems not to be included at Qt 5 (Qt and Key Technologies).
The example you tested seems to work only with Qt 4.7, not Qt 5. The Qt 5.0 version can be found here. The Qt 5.1 version can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With