Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Gstreamer with Qtwidgets
Qt 6.12 LTS is out! See what's new in the release blog

Gstreamer with Qtwidgets

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.6k 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.
  • H Offline
    H Offline
    himanshu.d
    wrote on last edited by himanshu.d
    #1

    Hi Team,

    I am trying to achieve rendering of video on qtwidget using gstreamer pipeline. After searching I came across qt5videosink gstreamer plugin.

    Below is the pipeline I am using.

    gst-launch-1.0 videotestsrc ! qt5videosink

    Pipeline is running but no out widget is opening.

    Logs:

    User-2:~$  gst-launch-1.0 -v videotestsrc ! qt5videosink
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)BGRA, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    /GstPipeline:pipeline0/GstQtVideoSink_qt5:qtvideosink_qt5-0.GstPad:sink: caps = video/x-raw, format=(string)BGRA, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:05.508780834
    Setting pipeline to NULL ...
    Freeing pipeline ...
    

    Could you please help me here. How to actually use qt5videosink plugin in gstreamer pipeline?

    Thanks,

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

      Hi and welcome to devnet,

      AFAIK, this plugin is to be used within a Qt application through a custom pipeline. It won't create a widget out of nothing 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

      H 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        AFAIK, this plugin is to be used within a Qt application through a custom pipeline. It won't create a widget out of nothing on the command line.

        H Offline
        H Offline
        himanshu.d
        wrote on last edited by himanshu.d
        #3

        @SGaist ,

        Qt Version

        QMake version 3.1
        Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu
        
        

        Below is the example I have used using Qt Application. Still it opens up two windows.

        I am running this application on my ubuntu machine.

        I have took reference from QVideoWidget.

        Below is the code:

        #include <QApplication>
        #include <QMainWindow>
        #include <QVideoWidget>
        #include <QMediaPlayer>
        #include <QMediaPlaylist>
        
        int main(int argc, char * argv[])
        {
            QApplication testApp(argc, argv);
            QMainWindow w;
        
            QVideoWidget videoWidget(&w);
            w.setCentralWidget(&videoWidget);
        
            QMediaPlayer *player = new QMediaPlayer(&w);
        
            player->setMedia(QUrl("gst-pipeline: videotestsrc ! xvimagesink name=\"qtvideosink\""));
            player->setVideoOutput(&videoWidget);
            
            w.show();
        
            player->play();
        
            return testApp.exec();
        }
        
        

        O/P Screen Shot

        As you can see in the below screenshot it is opening two windows.

        5d9989fc-fb76-4cdc-9c46-4b821fa84d3c-image.png

        Below is the error in console while I run the application

        ** (application:168481): CRITICAL **: 14:30:01.955: gst_vaapi_window_x11_new_with_xid: assertion 'xid != None' failed
        

        Appreciate your help here!

        Thanks

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

          What happens if you use qtvideosink directly ?

          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
          • N Offline
            N Offline
            Numerator
            wrote on last edited by
            #5
            void GstPlayer::setVideoOutput(QWidget *widget)
            {
                _hwndVideo = widget->winId();
            }
            
                gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(customData.pipeline), _player->hwndVideo());
            
            
            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
            • Unsolved