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. Display stream from Gstreamer to a widget
Forum Updated to NodeBB v4.3 + New Features

Display stream from Gstreamer to a widget

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 1.8k Views 2 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.
  • I Offline
    I Offline
    Ido-Cons
    wrote on last edited by
    #1

    Hello,

    I'm trying to display a Gstreamer pipeline to a Frame widget, I create everything fine, and using a test pipeline for it.
    The issue is that the pipeline is showing on another window beside my mainwindow, I want it to be displayed within it's intended frame.

    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    
         QMediaPlayer* player = new QMediaPlayer;
         QVideoWidget* vw = new QVideoWidget;
         QVBoxLayout *vbox = new QVBoxLayout(ui->frame);
         vbox->addWidget(vw);
         ui->frame->setLayout(vbox);
         player->setVideoOutput(vw);
         vw->show();
         player->setMedia(QUrl("gst-pipeline: videotestsrc ! autovideosink"));
         player->play();
    }
    

    Using an actual file does shows in it's supposed place (player->setMedia(QUrl::fromLocalFile("/home/ido/gstest3/example.mp4"));

    Any idea what makes it pop to another window?

    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,

      The final sink must be named: "name=qtvideosink". See the setMedia example.

      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
      2
      • I Offline
        I Offline
        Ido-Cons
        wrote on last edited by Ido-Cons
        #3
        This post is deleted!
        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