Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 5.11 QMediaPlayer and custom GStreamer Pipelines
Forum Updated to NodeBB v4.3 + New Features

Qt 5.11 QMediaPlayer and custom GStreamer Pipelines

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 2.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PhilBot9999P Offline
    PhilBot9999P Offline
    PhilBot9999
    wrote on last edited by
    #1

    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.
    
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Why are you using stderr rather than stdout ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • PhilBot9999P Offline
        PhilBot9999P Offline
        PhilBot9999
        wrote on last edited by
        #3

        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
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Might be a silly question but does it work properly when called on the command line ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pippo
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Does that pipeline you use work correctly on the command line ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved