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. How to get gstreamer inside of GUI
Forum Updated to NodeBB v4.3 + New Features

How to get gstreamer inside of GUI

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 479 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.
  • R Offline
    R Offline
    rtvideo
    wrote on last edited by
    #1

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

      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
      0
      • R Offline
        R Offline
        rtvideo
        wrote on last edited by
        #3

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

          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
          0
          • R Offline
            R Offline
            rtvideo
            wrote on last edited by
            #5

            It is 5.15.0

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

              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
              0

              • Login

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