Display stream from Gstreamer to a widget
Unsolved
General and Desktop
-
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
-
Hi and welcome to devnet,
The final sink must be named: "name=qtvideosink". See the setMedia example.