Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken ffmpeg delegate in AppImage #6890

Open
NuckChorris opened this issue Nov 26, 2023 · 6 comments
Open

Broken ffmpeg delegate in AppImage #6890

NuckChorris opened this issue Nov 26, 2023 · 6 comments

Comments

@NuckChorris
Copy link

ImageMagick version

AppImage (7.1.1-19)

Operating system

Linux

Operating system, version and so on

Ubuntu 22.04.3 LTS

Description

FFmpeg is not included in the AppImage. When I install FFmpeg in the host system, there are issues with gobject which don't appear when calling ffmpeg normally (though I don't know precisely what call is being made to ffmpeg, and setting MAGICK_DEBUG=all does not appear to log that)

Perhaps of note, I have /lib/x86_64-linux-gnu/libgobject-2.0.so.0 installed, and it does contain the symbol mentioned:

$ nm -gD /lib/x86_64-linux-gnu/libgobject-2.0.so.0 | grep uri
00000000000187e0 T g_uri_get_type
                 U g_uri_ref
                 U g_uri_unref

Steps to Reproduce

  1. Start with a fresh Ubuntu system (I have tried both 22.04 LTS and Ubuntu 23.10)
  2. Copy the sample APNG file to animated.png
  3. curl -O https://imagemagick.org/archive/binaries/magick
  4. chmod +x ./magick
  5. ./magick identify apng:animated.png
    • sh: 1: ffmpeg: not found
  6. apt install ffmpeg
  7. ./magick identify apng:animated.png
    • ffmpeg: symbol lookup error: /lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_uri_ref

Images

6

@urban-warrior
Copy link
Member

That looks like an issue with the ffmpeg install. Type ffmpeg on the comamnd-line. Do you get the same exception? If so, the issue is exclusive to ffmpeg, not ImageMagick.

@wups
Copy link

wups commented Nov 26, 2023

I encountered the same problem on Kubuntu 23.10 using the ImageMagick AppImage.
My installed ffmpeg version is 6.0-6ubuntu1.
@urban-warrior ffmpeg is able to process the video file if used on its own.

@urban-warrior
Copy link
Member

That suggests an issue with the APPImage environment since all it does is call the ffmpeg utility from the command line. Try

export LD_PRELOAD=/lib/x86_64-linux-gnu/libgobject-2.0.so.0
./magick identify apng:animated.png

If that fails, unfortunately we cannot help further.

@NuckChorris
Copy link
Author

NuckChorris commented Nov 26, 2023

Setting LD_PRELOAD just adds two more errors without fixing the g_uri_ref issue:

$ export LD_PRELOAD=/lib/x86_64-linux-gnu/libgobject-2.0.so.0
$ ./magick identify apng:6.png
basename: symbol lookup error: /lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_uri_ref
/tmp/.mount_magickU9H0yN/AppRun: line 25: /tmp/.mount_magickU9H0yN/usr/bin/: Is a directory
/tmp/.mount_magickU9H0yN/AppRun: line 25: exec: /tmp/.mount_magickU9H0yN/usr/bin/: cannot execute: Is a directory

Is it possible to see the exact command that ImageMagick is calling ffmpeg with, so I can try to reproduce and make a test case to send upstream to ffmpeg (or more likely, Ubuntu's packagers)?

Edit: actually it changed the error message for g_uri_ref which is now listed as coming from basename 🤔

@urban-warrior
Copy link
Member

Try this command:

magick convert -verbose apng:6.png null:

@NuckChorris
Copy link
Author

Thanks, that gives me the command! Definitely looks like an AppImage issue, the same command works perfectly outside of it:

$ ./magick convert -verbose apng:6.png null:
'ffmpeg' -nostdin -loglevel error -i '/tmp/magick-36xwVmHSL4qRZxVpOJuUnzCJjVkTOmu3' -an -f rawvideo -y  -pix_fmt rgba -vcodec webp -lossless 1 '/tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0'
ffmpeg: symbol lookup error: /lib/x86_64-linux-gnu/libgobject-2.0.so.0: undefined symbol: g_uri_ref
convert: no images defined `null:' @ error/convert.c/ConvertImageCommand/3359.
$ file /tmp/magick-36xwVmHSL4qRZxVpOJuUnzCJjVkTOmu3
/tmp/magick-36xwVmHSL4qRZxVpOJuUnzCJjVkTOmu3: symbolic link to /root/6.png
$ file /tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0
/tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0: cannot open `/tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0' (No such file or directory)
$ 'ffmpeg' -nostdin -loglevel error -i '/tmp/magick-36xwVmHSL4qRZxVpOJuUnzCJjVkTOmu3' -an -f rawvideo -y  -pix_fmt rgba -vcodec webp -lossless 1 '/tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0'
$ file /tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0
/tmp/magick-rZNHb2geLUvvprDv_PvgKs3SV_ZKQfT0: RIFF (little-endian) data, Web/P image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants