Qt5 gstreamer render issue in graphicsview
-
I created the .ui file with different graphics view in frame. While running the application in ubuntu i am able to render the gstreamer pipeline in graphics view. Sink is autovideosink
But while running the same application on CCPiolotV1000x display, Not able to capture live stream in graphics view. Stream is opening in new window.
-
@sanket_1989 autovideosink will not work in Qt and usually will open a default window to render video.
This feature of running gstreamer pipeline in qt multimedia module is not supported in Qt6 anymore. Therefore, try to use qml sink to render video display if you prefer to use gstreamer pipeline. -
@JoeCFD Can you share me the example code which consist qmlvideosink ?
Currently i am using QT5 in which i am setting the media Qurl as Gstreamer pipeline.
Steps like below :
player = new QMediaPlayer
videoItem = new QGraphicsVideoItem
graphicsView->setScene(new QGraphicsScene(this))
graphicsView->scene()->addItem(videoItem);
player -> setVideoOutput(birdEyevideoItem);
videoItem->setSize(QSizeF(width(),height()));
graphicsView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);graphicsView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
graphicsView->installEventFilter(this);player->setMedia(QUrl("gst-pipeline: udpsrc port=5555 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG" ! rtpjpegdepay ! jpegparse ! jpegdec ! autovideosink sync=false"));
player->play();
-
@sanket_1989
try to replace autovideosink with qtvideosink from here
https://forum.qt.io/topic/110561/qtmediaplayer-and-custom-gstreamer-pipeline/6 -
@JoeCFD Yes i tried with qtvideosink. Its working fine for the below pipeline and able to render in Graphicsview.
setMedia(QUrl("gst-pipeline: videotestsrc ! qtvideosink"));
But for below pipeline i am not able to get the desired output.
setMedia(QUrl("gst-pipeline: udpsrc port=5555 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)JPEG" ! rtpjpegdepay ! jpegparse ! jpegdec ! qtvideosink sync=false"));
getting below error in CCpilotV1000x device.
-
@sanket_1989 you are running under root because /opt is a root dir?
-
@sanket_1989 does your pipeline work from command line?
-
@sanket_1989 said in Qt5 gstreamer render issue in graphicsview:
qtvideosink
Check here out.
https://github.com/GStreamer/qt-gstreamer/blob/master/elements/gstqtvideosink/gstqtvideosink.cpp
You may need to install qt gstreamer in order to have qtvideosink available. Be aware that this package is very old, has some bugs and no more update.
Therefore, it is not right to use qt multimedia to run a gstreamer pipeline because you do not have any control over it and qt multimedia may not work properly for your pipeline. Better to use qml sink directly.Note that I do not use qt multimedia.