Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How to get gstreamer inside of GUI

    General and Desktop
    2
    6
    164
    Loading More Posts
    • 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.
    • R
      rtvideo last edited by

      Hi I currently have this setup (see picture) for my GUI. But instead of the viewer popping up as its own window I wanted it to be in the "Video Widget Example" window. How would I be able to do this?

      Here is one of my functions to help:

      VideoPlayer::VideoPlayer(QWidget *parent)
          : QWidget(parent)
      {
          m_mediaPlayer = new QMediaPlayer(this, QMediaPlayer::VideoSurface);
          QVideoWidget *videoWidget = new QVideoWidget;
      
      
      
          m_playButton = new QPushButton;
          m_playButton->setEnabled(true);
          m_playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay));
      
          QAbstractButton *openButton = new QPushButton(tr("Open..."));
          connect(m_playButton, &QAbstractButton::clicked, this, &VideoPlayer::openFile);
      
          connect(m_playButton, &QAbstractButton::clicked, this, &VideoPlayer::play);
      
      
          m_errorLabel = new QLabel;
          m_errorLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
      
          QBoxLayout *controlLayout = new QHBoxLayout;
          controlLayout->setMargin(0);
          controlLayout->addWidget(openButton);
          controlLayout->addWidget(m_playButton);
          //controlLayout->addWidget(m_positionSlider);
      
          QBoxLayout *layout = new QVBoxLayout;
          layout->addWidget(videoWidget);
          layout->addLayout(controlLayout);
          layout->addWidget(m_errorLabel);
      
          setLayout(layout);
      
          m_mediaPlayer->setVideoOutput(videoWidget);
          connect(m_mediaPlayer, &QMediaPlayer::stateChanged, this, &VideoPlayer::mediaStateChanged);
         
      

      Screenshot from 2020-08-26 16-47-18.png

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Which version of Qt ?
        Is it the one provided with your distribution ?

        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 Reply Quote 0
        • R
          rtvideo last edited by

          QT Creator 4.12.4
          Based on Qt 5.14.2 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            That's the information from Qt Creator.
            I asked for the Qt version you are using to build your project.

            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 Reply Quote 0
            • R
              rtvideo last edited by

              It is 5.15.0

              1 Reply Last reply Reply Quote 0
              • SGaist
                SGaist Lifetime Qt Champion last edited by

                Can you test the version provided by your distribution ?

                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 Reply Quote 0
                • First post
                  Last post