After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 781816 - Red artifact on visualizing rtsp stream via gstreamer and qt5
Red artifact on visualizing rtsp stream via gstreamer and qt5
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: qt-gstreamer
1.x
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-04-27 07:40 UTC by toonheyrman
Modified: 2017-04-27 19:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
This is a patch for the red artifact problem (2.33 KB, patch)
2017-04-27 15:13 UTC, toonheyrman
none Details | Review

Description toonheyrman 2017-04-27 07:40:14 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
Comment 1 Tim-Philipp Müller 2017-04-27 07:59:23 UTC
Duplicate of bug #743716 ?

There's also the qmlglsink element from gst-plugins-bad, for what it's worth.
Comment 2 toonheyrman 2017-04-27 08:34:44 UTC
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(&current_state, NULL, 0);
if (current_state != QGst::StatePlaying) {
    _pipeline->setState(QGst::StatePlaying);
}


I hope this will help to descibe the problem.
Comment 3 toonheyrman 2017-04-27 13:24:27 UTC
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
Comment 4 toonheyrman 2017-04-27 15:12:16 UTC
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.
Comment 5 toonheyrman 2017-04-27 15:13:34 UTC
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.
Comment 6 Tim-Philipp Müller 2017-04-27 15:32:31 UTC
Please could you attach it to the other bug as well? Thanks!

The patches have not been merged because qt-gstreamer is unmaintained :)