No video thumbnail generated

Hi,

When I upload an mp4 video file to omeka-s, it fails to create a thumbnail. I’ve noticed that omeka-s renames uploaded files and doesn’t include the file extension when it loads the file to the /tmp directory. This is a problem for ImageMagick, because it can’t convert a video file without a file extension.

I am using the latest version of ImageMagick:
jth@ubuntu:~/winshare$ convert --version
Version: ImageMagick 7.0.10-6 Q16 x86_64 2020-04-17 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI OpenMP(4.0)
Delegates (built-in): fontconfig freetype jng jpeg png x xml zlib

I installed the latest omeka-s one week ago, though I can’t find a version number for it.

Here is the message in the error.log:
convert: no decode delegate for this image format ' @ error/constitute.c/ReadImage/562. convert: no images defined/tmp/omekaSkVQcK.jpg’ @ error/convert.c/ConvertImageCommand/3282.

application.log:
2020-04-16T22:43:41+00:00 ERR (3): Command “/usr/local/bin/convert ‘/tmp/omeka22PCOL[0]’ -auto-orient -background white +repage -alpha remove -thumbnail ‘800x800>’ ‘/tmp/omekaSkVQcK.jpg’” failed with status code 1.

As a test, when I use ImageMagick to create a thumbnail from a video file without an extension it fails:
jth@ubuntu:~/winshare$ /usr/local/bin/convert testmp4[0] -auto-orient -background white +repage -alpha remove -thumbnail ‘800x800>’ testmp4.jpg
convert: no decode delegate for this image format ' @ error/constitute.c/ReadImage/562. convert: no images definedtestmp4.jpg’ @ error/convert.c/ConvertImageCommand/3282.

However, when I use the same file with the extension (which is the same file that I upload to omeka-s), it succeeds:
jth@ubuntu:~/winshare$ /usr/local/bin/convert test.mp4[0] -auto-orient -background white +repage -alpha remove -thumbnail ‘800x800>’ testmp4.jpg
jth@ubuntu:~/winshare$

Do you have any suggestions? Is there a configuration setting that I am missing? Any help would be greatly appreciated.

Thanks

Interesting. I don’t think we’ve actually encountered this problem before, but it certainly makes sense that it could possibly be an issue.

This will have to be a fix to Omeka S’s code though, not something that can be done with configuration.

Thanks for your reply. Do you have any kind of timeline for when this might be fixed? Or if the fix is relatively minor, we’re happy to make changes to the code.

You can make a change to the file application/src/File/Thumbnailer/ImageMagick.php:

At or about line 83, right before the $commandArgs[] = escapeshellarg($origPath); line, you can add:

$videoTypes = ['video/mp4', 'video/mpeg', 'video/ogg', 'video/quicktime', 'video/webm', 'video/x-ms-asf', 'video/x-msvideo', 'video/x-ms-wmv'];
if (in_array($this->sourceFile->getMediaType(), $videoTypes)) {
    $origPath = 'mpeg:' . $origPath;
}

That solved the problem. Thanks so much for your help!

This is fixed in Omeka S 2.1.2.

Thanks John. We will upgrade later this year.

This topic was automatically closed 250 days after the last reply. New replies are no longer allowed.