GNOME Bugzilla – Bug 781816
Red artifact on visualizing rtsp stream via gstreamer and qt5
Last modified: 2017-04-27 19:55:17 UTC
I've written a c++ program that receives a RTSP stream via gstreamer and displays this video via Qt5 in a QWidget. As the gstreamer videosink, I use a Widgetqt5glvideosink. The problem is when I look at the received stream it has too much red-value in it. This only occurs when the vertical resolution exceeds +-576 pixels. (lower resolutions have no issue) When I use cpu rendering (Widgetqt5videosink) instead of openGL rendering i get a correct image. When I view the stream via gstreamer command line or via VLC it is also correct. RTP stream is also too red. So it likes to be an issue when using an openGL rendered QWidget. Info: Tested on Ubuntu16.04 and 17.04 for the viewer application. And on three different devices. Links: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html
Duplicate of bug #743716 ? There's also the qmlglsink element from gst-plugins-bad, for what it's worth.
I don't know if it's a duplicate of the other thread. Maybe for clarification a code snippet, /* Creating elements for the pipeline */ _pipeline = QGst::Pipeline::create(); _pipeline_elements.insert("src", QGst::ElementFactory::make("videotestsrc")); _pipeline_elements.insert("caps", QGst::ElementFactory::make("capsfilter")); _pipeline_elements.insert("sink", QGst::ElementFactory::make("qt5glvideosink")); // When changing this to qt5videosink, the colors are good /* Adding elements to the pipeline */ for (QMap<QString, QGst::ElementPtr>::const_iterator el_it = _pipeline_elements.constBegin(); el_it != _pipeline_elements.constEnd(); ++el_it){ assert(el_it.value()); _pipeline->add(el_it.value()); } /* Linking pipeline together */ _pipeline_elements["src"]->link(_pipeline_elements["caps"]); _pipeline_elements["caps"]->link(_pipeline_elements["sink"]); /* Configuring the pipeline elements */ QGst::CapsPtr caps = QGst::Caps::fromString("video/x-raw, width=1280, height=720, framerate=30/1"); _pipeline_elements["caps"]->setProperty("caps", caps); _pipeline_elements["sink"]->setProperty("sync", false); _pipeline_elements["sink"]->setProperty("max-buffers", 20); _pipeline_elements["sink"]->setProperty("emit-signals", true); _pipeline_elements["sink"]->setProperty("drop", true); /* Initialize the scroll views */ _central_views = new QStackedWidget(); _widget_stream_hd = new QGst::Ui::VideoWidget(); _central_views->addWidget(_widget_stream_hd); /* Creating the widgets and managing the layout of the UI */ _widget_central = new QWidget(); // Tried QOpenGLWidget too _layout_hd_and_side_buttons = new QBoxLayout(QBoxLayout::LeftToRight, _widget_central); _layout_hd_and_side_buttons->addWidget(_central_views); /* Starting the video stream */ _widget_stream_hd->setVideoSink(_pipeline_elements["sink"]); QGst::State current_state; _pipeline->getState(¤t_state, NULL, 0); if (current_state != QGst::StatePlaying) { _pipeline->setState(QGst::StatePlaying); } I hope this will help to descibe the problem.
Your comment is possibly a fix to the problem we have. But I see that this fix is not included in the latest version of qt-gstreamer. Even not in the git repo. Can I ask why this is not applied? Thanks, Toon
I was able to fix the problem. I used your patch but I had to modify another file too. See the patch for the solution.
Created attachment 350558 [details] [review] This is a patch for the red artifact problem I had to modify another file too the resolve the problem. The suggested patch was not enough.
Please could you attach it to the other bug as well? Thanks! The patches have not been merged because qt-gstreamer is unmaintained :)