Qt 5.11 QMediaPlayer and custom GStreamer Pipelines
-
I am trying to supply a custom gstreamer pipeline to a QMediaPlayer.
The following referenced topic details how one person was able to make it work:
Re: Displaying video stream using Qt Multimedia and GStreamer process
I tried their code exactly on Ubuntu 18.04 with GStreamer 1.14 and Qt 5.11. It fails with the following error:
Error: "Could not determine type of stream." appsrc: push buffer wrong state appsrc: push buffer wrong state appsrc: push buffer wrong state
The entire code is:
#include <QApplication> #include <QMediaPlayer> #include <QWidget> #include <QVideoWidget> #include <QBoxLayout> #include <QProcess> #include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget *window = new QWidget; QVideoWidget *videoWidget = new QVideoWidget; QBoxLayout *layout = new QVBoxLayout; QMediaPlayer *player = new QMediaPlayer; QProcess *process = new QProcess; layout->addWidget(videoWidget); window->setLayout(layout); window->show(); player->setVideoOutput(videoWidget); QString program = "gst-launch-1.0"; QStringList arguments; arguments << "videotestsrc" << "!" << "video/x-raw,width=1280,height=720" << "!" << "x264enc" << "!" << "filesink" << "location=/dev/stderr"; process->start(program, arguments); process->waitForReadyRead(); player->setMedia(QMediaContent(), process); player->play(); return a.exec(); } How can I get this to work? Thanks.
-
Hi,
Why are you using
stderr
rather thanstdout
? -
I have tried STDOUT, but I get the same kind of error, the following is printed constantly:
Error: "Could not determine type of stream." appsrc: push buffer wrong state appsrc: push buffer wrong state appsrc: push buffer wrong state appsrc: push buffer wrong state appsrc: push buffer wrong state appsrc: push buffer wrong state
-
Might be a silly question but does it work properly when called on the command line ?
-
in my Qt application on console QT application is it continuously printed
0:30:24:279| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:283| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:291| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:297| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:302| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:310| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:315| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:321| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:329| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:333| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:341| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:347| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:352| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:360| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:365| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:371| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:378| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:383| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:389| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:397| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:401| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:411| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:416| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:420| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:426| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:431| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:436| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:445| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:454| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:463| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:468| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:477| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:483| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:490| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:498| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:503| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:512| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:517| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:526| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:532| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:538| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:545| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:550| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:557| Warning | Error: "Could not determine type of stream."
30/01/2019 10:30:24:564| Warning | Error: "Could not determine type of stream."Does someone know the reason and how can be solved?
Thanks for attention.
Best regards. -
Does that pipeline you use work correctly on the command line ?