Important: Please read the Qt Code of Conduct -

qmediaplayer no video

  • Hi there,
    I try to playback a video with qmediaplayer but it shows only a blank window and no errors so far.
    The videofile is: ( Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360, 560 kb/s, 29.67 fps, 29.67 tbr, 11392 tbn, 59.33 tbc (default) )
    Qtmultimedia was compiled with gstreamer 1.0 support, GStreamer 1.6.3 installed. Plugins good,bad,ugly (1.0) are installed.
    The videofile itself plays fine with "gst-launch-1.0 filesrc location=~/store/tmp/out_s.mp4 ! decodebin ! autovideosink"


    #include "mainwindow.h"
    #include <QApplication>
    #include <QMediaPlayer>
    #include <QVideoWidget>
    #include <QDebug>
    int main(int argc, char *argv[])
    	QApplication a(argc, argv);
    	QMediaPlayer* player = new QMediaPlayer;
    	QVideoWidget* vw = new QVideoWidget;
    	qDebug() << player->state();
    	return a.exec();

    # Project created by QtCreator 2016-07-08T16:22:05
    QT       += core gui multimedia multimediawidgets
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    TARGET = mjpeg_test
    TEMPLATE = app
    SOURCES += main.cpp\
    HEADERS  += mainwindow.h
    FORMS    += mainwindow.ui

    Application output:

    Starting /home/paul/store/c++/build-project-QT5_6_1-Debug/project...
    libva info: VA-API version 0.39.2
    libva info: va_getDriverName() returns 0
    libva info: Trying to open /usr/lib64/va/drivers/
    libva info: Found init function __vaDriverInit_0_39
    libva info: va_openDriver() returns 0
    /home/paul/store/c++/build-project-QT5_6_1-Debug/projectexited with code 0

    gst-inspect-1.0 | grep 264 :

    libav:  avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
    libav:  avmux_ipod: libav iPod H.264 MP4 (MPEG-4 Part 14) muxer
    videoparsersbad:  h264parse: H.264 parser
    x264:  x264enc: x264enc
    vaapiparse:  vaapiparse_h264: H.264 parser
    vaapi:  vaapiencode_h264: VA-API H.264 encoder
    typefindfunctions: video/x-h264: h264, x264, 264
    rtp:  rtph264depay: RTP H264 depayloader
    rtp:  rtph264pay: RTP H264 payloader

    any ideas?

  • problem solved (so far) by uninstalling the gst-plugins-vaapi-0.7.0. Videofile plays now correctly.

  • @pauledd Hi! Please mark your threads as solved by using the "topic tools" button instead of adding [solved] or something to the title, as described here:

  • I am having exactly the same issue but I could not found any gst-plugins-vaapi.
    Please help being specific.Thanks.

  • I tried to remove gst-vaapi. Now the video plays but it is not hardware accelerated. I mean cpu usage is high now as compared to the command-line playback using gst-launch-1.0.
    I need hardware acceleration as well.

  • Don't think this is solved, uninstalling gst-plugins-vaapi is a workaround at best.

    Qt Multimedia GStreamer backend doesn't support HW-accelerated video decoding