Qt5 QMediaPlayer + gstreamer issue: "QWidget::paintEngine: Should no longer be called"
-
Hi,
I'm trying to get a video playing in my Qt5.5.1 app. I'm using a Freescale i.MX6 board (VAR-SOM-MX6) with Yocto Jethro and X11 graphics, with a few additional things in my local.conf to get gstreamer working:
PACKAGECONFIG_append = " packagegroup-fsl-gstreamer" PACKAGECONFIG_append_pn-qtmultimedia = " gstreamer" IMAGE_INSTALL_append = " libnl libnl-genl qtbase-plugins qtmultimedia-plugins qtimageformats-plugins gstreamer gst-meta-video gst-plugins-base-app gst-plugins-base gst-plugins-good gst-plugins-good-video4linux2"
In my Qt app, I created a QVideoWidget (called video_widget) and loaded the video using the following code:
QMediaPlayer * player = new QMediaPlayer(this); player->setMedia(QUrl::fromLocalFile("/home/root/test.ogg")); player->setVideoOutput(ui->video_widget); player->play();
What happens is that the video loads and the first frame or so is displayed. (Hooray! Took me a while to get that far.) But playback stops almost immediately and I get a slew of warnings:
QWidget::paintEngine: Should no longer be called QWidget::paintEngine: Should no longer be called QWidget::paintEngine: Should no longer be called QWidget::paintEngine: Should no longer be called QWidget::paintEngine: Should no longer be called QWidget::paintEngine: Should no longer be called
I have tried this with a couple different codecs and a couple different videos with the same result each time.
Any help?
UPDATE: I added these packages to IMAGE_INSTALL_append:
imx-vpu imx-test firmware-imx-vpu-imx6d
and switched to testing exclusively h264-encoded videos in .m4v containers, since that seemed to yield the best result.
I'm able to get videos to play, however the performance is very bad (<5 FPS) compared to just directly using gst-launch-1.0. I continue to receive
QWidget::paintEngine: Should no longer be called
warnings, along with the occasional
Warning: "A lot of buffers are being dropped."
As a comparison:
https://vimeo.com/183730687 -- this is the video being played using QtMultimedia.
https://vimeo.com/183731187 -- this is the same video played by running
gst-launch-1.0 playbin uri=file:/home/root/test.m4v