Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The video-thumbnail function causes a php error with certain videos:
PHP Fatal error: Call to a member function toGDImage() on a non-object in ****/www/sites/all/modules/video/transcoders/TranscoderAbstractionFactoryFfmpeg.inc on line 229
The function-call that fails is getFrame();
$frame = $movie->getFrame(min($frames, (int) $seek * $fps));
The calculated frame number seems to cause the error. Replacing the formular with a fixed value fixes the issue temporarily.
Temporary fix:
$frame = $movie->getFrame(min($frames, (int) $seek * $fps));
if( $frame==false || empty($frame) ){ // getFrame failed...
$frame = $movie->getFrame(10); // grab frame number 10 instead
}
Comment | File | Size | Author |
---|---|---|---|
#4 | remove-ffmpegmovie-thumbgeneration-2051129.patch | 7.27 KB | FreeAndEasy |
Comments
Comment #0.0
FreeAndEasy CreditAttribution: FreeAndEasy commentedtypo
Comment #0.1
FreeAndEasy CreditAttribution: FreeAndEasy commentedtypo
Comment #1
Jorrit CreditAttribution: Jorrit commentedThe code you're referring to is only run when the PHP module ffmpeg_movie is installed and the code should have been removed a long time ago. Can you remove this module (if possible for you) and try again?
Comment #1.0
Jorrit CreditAttribution: Jorrit commentedtypo
Comment #2
hubobbb CreditAttribution: hubobbb commentedthank you ,it works .
Comment #3
FreeAndEasy CreditAttribution: FreeAndEasy commentedI can't remove the module, but I can confirm that when I remove the code it works again!
Comment #4
FreeAndEasy CreditAttribution: FreeAndEasy commentedComment #5
joegl CreditAttribution: joegl commentedI just want to confirm that I had this issue (with an older version of the module). All I did was change the following lines of code (224-247 in my version):
Notice the comments.
Comment #6
heshanlk