Xpra: Ticket #393: Prefer newer libwebp shared library

Running on Ubuntu 12.04.2 LTS.

Default libwebp library was libwebp.so.2.0.0 on my system. With version 0.10 (r3878) of the xpra server, this result in undefined symbols:

alex@net-mobile:~/xpra-src/Xpra/trunk/src$ xpra
cannot load webp encoder: EncodeRGB missing from xpra.codecs.webm.encode: /usr/lib/i386-linux-gnu/libwebp.so.2: undefined symbol: WebPEncodeLosslessRGB
cannot load webp encoder: EncodeRGBA missing from xpra.codecs.webm.encode: /usr/lib/i386-linux-gnu/libwebp.so.2: undefined symbol: WebPEncodeLosslessRGB
cannot load webp encoder: EncodeBGR missing from xpra.codecs.webm.encode: /usr/lib/i386-linux-gnu/libwebp.so.2: undefined symbol: WebPEncodeLosslessRGB
cannot load webp encoder: EncodeBGRA missing from xpra.codecs.webm.encode: /usr/lib/i386-linux-gnu/libwebp.so.2: undefined symbol: WebPEncodeLosslessRGB
<snip..>

After updating to libwebp.so.4.0.3, libwebp.so.2.0.0 was still used, since "xpra/codecs/webm/init.py" tries to load .2 first, then .4:

_LIBRARY_NAMES = ["libwebp.so.2", "libwebp.so.4"]

Short of checking for this specifically, I would suggest favoring newer versions first in cases where multiple versions of the library is installed (patch attached)



Fri, 19 Jul 2013 04:34:15 GMT - netmk: attachment set


Fri, 19 Jul 2013 05:08:32 GMT - Antoine Martin: priority, status, description changed; milestone set

Thanks, applied in r3879

We'll need more changes before the release though, because as it is libwebp.so.2 prevents the whole module from loading because of the missing lossless functions.

We need to fail more gracefully since we already handle the case where they are not available python side (but maybe also improve how we detect if they are missing too).


Fri, 19 Jul 2013 05:21:49 GMT - Antoine Martin: attachment set

with this patch we should be able to run


Fri, 19 Jul 2013 05:23:56 GMT - Antoine Martin: owner, status changed

Can you please try the patch attached and let me know if it works ok for you? Preferably testing both before and after reverting libwebp.patch so we can ensure that 0.10.x works with libwebp.so.2 as well as before (that is, without lossless compression).

Since I only have libwebp.so.4, I've tested by adding this:

try:
    #make it fail:
    _LIBRARY.SURELYDOESNOTEXIST = None
...

Thanks!


PS: as of r3879, you can check which encodings support lossless mode with:

$ xpra info | grep -i 'encodings'
client.encodings=x264,vpx,webp,png,png/P,png/L,rgb,jpeg
client.encodings.core=rgb24,vpx,x264,webp,png,png/L,png/P,jpeg,rgb32
encodings=vpx,x264,webp,png,png/L,png/P,jpeg,rgb
encodings.core=('rgb24', 'rgb32', 'vpx', 'x264', 'webp', 'png', 'png/L', 'png/P', 'jpeg')
encodings.lossless=('rgb24', 'rgb32', 'png', 'png/L', 'png/P', 'webp')
encodings.with_lossless_mode=('webp',)
encodings.with_quality=('x264', 'webp', 'jpeg')
encodings.with_speed=('x264', 'png', 'png/L', 'png/P', 'jpeg', 'rgb')

Fri, 19 Jul 2013 06:55:31 GMT - Antoine Martin: status changed; resolution set

applied in r3884 - feel free to re-open this ticket if you still have problems


Fri, 19 Jul 2013 14:12:53 GMT - netmk:

Confirmed tested before and after changeset (r3879), using libwebp.so.2.0.0


Sat, 23 Jan 2021 04:54:05 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/393