Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Display stream from Gstreamer to a widget



  • 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


  • Lifetime Qt Champion

    Hi and welcome to devnet,

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



  • This post is deleted!

Log in to reply