AnsweredAssumed Answered

Poor video playback on i.MX6 using QtMultimedia 5.5.1

Question asked by Jason Wright on Sep 21, 2016
Latest reply on Sep 22, 2016 by Jason Wright

I'm trying to get a video playing in my Qt5.5.1 app. I'm using an i.MX6D 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-gooimx-vpu imx-test firmware-imx-vpu-imx6d"

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.m4v"));
player->setVideoOutput(ui->video_widget);
player->play();

The video plays, but performance is very bad (<5 FPS) compared to just directly using gstreamer. I also get a slew of warnings each time, along the lines of: 

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
Warning: "A lot of buffers are being dropped."

I have tried this with a couple different codecs and a couple different videos, but am primarily using h264-encoded videos in .m4v containers, since that seemed to yield the best result. Changing the video dimensions and bitrate didn't seem to have any effect.

As a comparison:

https://vimeo.com/183730687 -- this is a 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

Does anyone have any experience with this... or any suggestions?

Outcomes