qmediaplayer no video
-
wrote on 13 Jul 2016, 06:41 last edited by pauledd
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"main.cpp:
#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; player->setVideoOutput(vw); player->QMediaPlayer::setMedia(QUrl::fromLocalFile("/home/paul/store/tmp/out_s.mp4")); vw->show(); player->play(); 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\ mainwindow.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/i965_drv_video.so libva info: Found init function __vaDriverInit_0_39 libva info: va_openDriver() returns 0 QMediaPlayer::PlayingState /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?
-
wrote on 13 Jul 2016, 06:47 last edited by
problem solved (so far) by uninstalling the gst-plugins-vaapi-0.7.0. Videofile plays now correctly.
-
problem solved (so far) by uninstalling the gst-plugins-vaapi-0.7.0. Videofile plays now correctly.
wrote on 13 Jul 2016, 10:27 last edited by@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: http://forum.qt.io/topic/62700/hitchhiker-s-visual-guide-to-the-qt-forum.
Cheers! -
wrote on 28 Sept 2016, 13:18 last edited by
I am having exactly the same issue but I could not found any gst-plugins-vaapi.
Please help being specific.Thanks. -
wrote on 29 Sept 2016, 07:14 last edited by
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. -
wrote on 25 Jan 2017, 20:21 last edited by chris_m
Don't think this is solved, uninstalling gst-plugins-vaapi is a workaround at best.
Bug:
Qt Multimedia GStreamer backend doesn't support HW-accelerated video decoding
https://bugreports.qt.io/browse/QTBUG-23761