linuxdeployqt icon indicating copy to clipboard operation
linuxdeployqt copied to clipboard

Add GStreamer support

Open vadi2 opened this issue 7 years ago • 15 comments

Plugins loaded at runtime by GStreamer aren't included by the tool right now (as visible by strace on this app, for example). I suspect this manifests as https://github.com/mavlink/qgroundcontrol/issues/4803 as well.

GStreamer is a bit tricky as apps might not need the video plugins but audio so it would be nice to be able to specify what kind of support is included in the AppImage.

vadi2 avatar Mar 24 '17 06:03 vadi2

Would running linuxdeployqt twice and copying in the required plugins manually between the two runs be an acceptable solution? If they do not get included this may be an indication that the plugins are dlopen()ed and hence not found by ldd.

probonopd avatar Mar 24 '17 18:03 probonopd

The problem is figuring out which plugins are required... my application for example only needs audio and I can't tell between all the gstreamer which are needed. It would be nice for linuxdeployqt to handle that for me, like it handles deployment of other libraries.

I suspect patchelf will also need to be run on gstreamer to load the plugins from the new correct location.

vadi2 avatar Mar 24 '17 18:03 vadi2

Yes, the only question is if not even you (as the author) knows which plugins are really needed, how could linuxdeployqt?

probonopd avatar Mar 24 '17 19:03 probonopd

Options could be made available to ship all, video only, or sound only plugins.

On Fri, 24 Mar 2017 8:05 pm probonopd, [email protected] wrote:

Yes, the only question is if not even you (as the author) knows which plugins are really needed, how could linuxdeployqt?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/probonopd/linuxdeployqt/issues/96#issuecomment-289116622, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGxjAuMcZXx8ZCB-cZ3SsP9BRMU3nSIks5rpBPegaJpZM4MnzBu .

vadi2 avatar Mar 24 '17 19:03 vadi2

Not sure whether this should fall into the scope of linuxdeployqt since macdeployqt also doesn't do things like this. For now, needs to be done by hand.

Anyone: Feel free to reopen if you volunteer to work on this.

probonopd avatar Mar 26 '17 17:03 probonopd

For starters, whenever linuxdeployqt bundles libQt5WebKit.so.5 then some GStreamer libraries are also bundled. Among these is libgstreamer-1.0.so.0 which tries to load stuff from the base system using hardcoded paths, with is guaranteed to be a disaster when versions don't match.

me@host:~$ strings squashfs-root/usr/lib/libgstreamer-1.0.so.0 | grep /x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner
/usr/lib/x86_64-linux-gnu/gstreamer-1.0

Example: https://github.com/Subsurface-divelog/subsurface/issues/769#issuecomment-342208051

So, if we are not actually using GStreamer functionality, an easy way to shoot it down is:

 sed -i -e 's|/usr/lib/x86_64-linux-gnu|/usr/lib/x86_64-linux-xxx|g' squashfs-root/usr/lib/libgstreamer-1.0.so.0

Bingo, no more trying to load stuff from the system, and hence, no more error messages on the command line.

An actual fix, however, would of course be to make linuxdeployqt bundle to and load stuff (gst-plugin-scanner and some? all? plugins) from inside the AppDir/AppImage. Volunteers?

probonopd avatar Nov 06 '17 23:11 probonopd

Related to #123

probonopd avatar Nov 24 '17 21:11 probonopd

For GST_* environment variables, see https://github.com/AppImage/AppImageKit/wiki/Bundling-GTK3-apps

probonopd avatar Nov 24 '17 21:11 probonopd

+1

zendre4 avatar Mar 06 '18 13:03 zendre4

Also see https://github.com/ubuntu/snapcraft-desktop-helpers/issues/49 -- some environment variable(s) may need to be set, either from a launcher script or inside the Qt application's source code.

probonopd avatar May 22 '18 05:05 probonopd

Between this issue and https://github.com/probonopd/linuxdeployqt/issues/123, it's confusing as to what needs to be done to make sound in Qt applications work (because they rely on GStreamer).

I'm seeing the following errors:

GStreamer-WARNING **: 16:25:50.865: External plugin loader failed. This most likely means that the plugin loader helper binary was not found or could not be run. You might need to set the GST_PLUGIN_SCANNER environment variable if your setup is unusual. This should normally not be required though.

GStreamer-WARNING **: 16:25:50.877: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstdebug.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstdebug.so: undefined symbol: gst_make_element_message_details

GStreamer-WARNING **: 16:25:50.888: Failed to load plugin '/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstsoup.so': /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstsoup.so: undefined symbol: gst_element_message_full_with_details

What should be adjusted? It's not clear what work has been done on AppImage to aid the integration so I'm not sure where to start.

vadi2 avatar Jun 29 '19 14:06 vadi2

Please also check out our discussion(s) about making a linuxdeploy plugin for GStreamer. See https://github.com/linuxdeploy/linuxdeploy/issues/80. We'd like to find a contributor who could invest the time to make this work. We will happily support anyone who's willing to work on making such a plugin.

TheAssassin avatar Jun 29 '19 14:06 TheAssassin

That would be great. I don't have capacity to start another project myself.

vadi2 avatar Jun 29 '19 15:06 vadi2

Here is an example: FrancescoCeruti/linux-show-player#53 Also see: https://github.com/GStreamer/gstreamer/blob/master/scripts/gst-uninstalled

Would welcome pull requests.

probonopd avatar Jul 07 '19 07:07 probonopd

Basically, whenever libgstreamer-1.0.so.0 is deployed, we would need to also deploy the contents of /usr/lib/x86_64-linux-gnu/gstreamer-1.0/ to ./usr/lib/gstreamer-1.0/and use an AppRun to set the GStremer environment variables. (It would be nice if we could get around doing the latter somehow.)

probonopd avatar Jul 07 '19 08:07 probonopd