Qt Application using Gstreamer works only with root privileges
-
Hello everybody, I'm encountering this issue while developing on Qt Creator an application that uses gstreamer.
basically, the application works when it runs with Sudo privileges from the terminal but when it runs from Qt creator gives the following errorFailed to create qtquick2videosink. Make sure it is installed correctly ASSERT failure in RefPointer::operator->() const: "Attempted to dereference a null pointer", file /usr/include/Qt5GStreamer/QGlib/refpointer.h, line 355
at the same time, I tried to investigate a little the gstreamer installation on my system, to see if there was a problem with qt5videosink.
When running :gst-inspect-1.0 | grep qt5videosink
it gives no output, but if I run it with root privileges:
sudo gst-inspect-1.0 | grep qt5videosink output: qt5videosink: qt5videosink: Qt video sink qt5videosink: qt5glvideosink: Qt GL video sink qt5videosink: qwidget5videosink: QWidget video sink qt5videosink: qtquick2videosink: QtQuick2 video sink
now, qt5videosink magically exists.
My first guess would be a permission problem of the component but I don't know how to get my hands on it.
If anybody has had the same issue I would be glad if you shared your experience helping me to get it to work normally from QT Creator.Thank you in advance for your help.
FR.
-
Solved: if anyone encounters the same issue there's the solution that worked for me.
delete the following file in the cache:
rm ~/.cache/gstreamer-1.0 registry.x86_64.bin
and then run:
gst-inspect-1.0
to regenerate it. now the plugins are visible and usable by all users.