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

Thumbnails creation fails for MP4 video #1841

Closed
jajm opened this issue May 11, 2022 · 5 comments
Closed

Thumbnails creation fails for MP4 video #1841

jajm opened this issue May 11, 2022 · 5 comments

Comments

@jajm
Copy link
Contributor

jajm commented May 11, 2022

If I try to upload an MP4 video file, the thumbnails are not created.

These errors appear in log file:

2022-05-11T10:12:34+00:00 ERR (3): convert: unable to open image `mpeg:/tmp/omekaZZcxkR[0]': No such file or directory @ error/blob.c/OpenBlob/2924.
convert: no decode delegate for this image format `' @ error/constitute.c/ReadImage/575.
convert: no images defined `/tmp/omekaZdePvT.jpg' @ error/convert.c/ConvertImageCommand/3229.

Here is a short video for testing: https://user-images.githubusercontent.com/306836/167829151-008771ae-adaa-400f-a170-387f8a47a83b.mp4

If I change mpeg: to mp4: in application/src/File/Thumbnailer/ImageMagick.php and re-upload the file, then the thumbnail creation works.

Of course changing the "prefix" in thumbnailer code is not a practical solution. But maybe if the temporary file kept the extension of the original file, there will be no need for the prefix at all ?

@zerocrates
Copy link
Member

Can you share what version of ImageMagick you're using? It would be good to know if this is something that's version-specific.

@jajm
Copy link
Contributor Author

jajm commented May 29, 2022

I'm using the debian package for bullseye (https://packages.debian.org/bullseye/imagemagick, 8:6.9.11.60+dfsg-1.3)

convert --version says:

Version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
Copyright: (C) 1999-2021 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP(4.5) 
Delegates (built-in): bzlib djvu fftw fontconfig freetype heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr pangocairo png tiff webp wmf x xml zlib

@zerocrates
Copy link
Member

OK, thanks.

It looks like where other versions I'm familiar with have listed "mpeg" as the name of the generic video support, this Debian one has "video." From some poking around, it looks like this is something they changed in ImageMagick 6.9.11-31.

Does setting the "prefix" to video also work for you? I think it should.

Using "mp4" or something similar is probably the best approach for the time being... it looks like it should work fine for both versions, we'll just have to do some testing to confirm on the older ones where "mpeg" is currently working.

@jajm
Copy link
Contributor Author

jajm commented Jun 1, 2022

Does setting the "prefix" to video also work for you? I think it should.

Yes it does

@zerocrates
Copy link
Member

I'll do some more investigation but I believe the root of this issue is just that there's actually a bug with the "mpeg" format specifically in your newer version, such that using "mp4" where we previously used "mpeg" is actually a viable solution here.

Including the extension with the temp filename is an option as well but would require more in the way of changes.

jajm pushed a commit to biblibre/omeka-s that referenced this issue Jun 20, 2022
We used to use "mpeg" which was the name of the ImageMagick coder being
used, but they've changed it to "video." "mp4" is supported by both old
and new versions.

(fix omeka#1841)
zerocrates added a commit that referenced this issue Jun 30, 2022
We used to use "mpeg" which was the name of the ImageMagick coder being
used, but they've changed it to "video." "mp4" is supported by both old
and new versions.

(fix #1841)

(cherry picked from commit dc9fe51)
ThibaudGLT pushed a commit to biblibre/omeka-s that referenced this issue Jan 3, 2023
We used to use "mpeg" which was the name of the ImageMagick coder being
used, but they've changed it to "video." "mp4" is supported by both old
and new versions.

(fix omeka#1841)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants