aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--transcoders/video_ffmpeg_php.inc13
1 files changed, 8 insertions, 5 deletions
diff --git a/transcoders/video_ffmpeg_php.inc b/transcoders/video_ffmpeg_php.inc
index 478c333..41e0558 100644
--- a/transcoders/video_ffmpeg_php.inc
+++ b/transcoders/video_ffmpeg_php.inc
@@ -43,7 +43,7 @@ class video_ffmpeg_php extends video_ffmpeg implements transcoder_interface {
//get the playtime from the current transcoder
$duration = $this->get_playtime($videopath);
- $files = NULL;
+ $files = array();
for ($i = 1; $i <= $total_thumbs; $i++) {
$seek = ($duration / $total_thumbs) * $i - 1; //adding minus one to prevent seek times equaling the last second of the video
$filename = file_munge_filename("video-thumb-" . $video['fid'] . "-$i.jpg", '', TRUE);
@@ -63,12 +63,15 @@ class video_ffmpeg_php extends video_ffmpeg implements transcoder_interface {
// Get the frame and create thumb file
$frame = $movie->getFrame($framenumber);
- $thumb = $frame->toGDImage();
- imagejpeg($thumb, drupal_realpath($thumbfile));
+
+ if ($frame) {
+ $thumb = $frame->toGDImage();
+ imagejpeg($thumb, drupal_realpath($thumbfile));
+ }
if (!file_exists(drupal_realpath($thumbfile))) {
- $error_param = array('%file' => $thumbfile, '%cmd' => $command, '%out' => $command_output);
- $error_msg = t("Error generating thumbnail for video: generated file %file does not exist.<br />Command Executed:<br />%cmd<br />Command Output:<br />%out", $error_param);
+ $error_param = array('%file' => $thumbfile);
+ $error_msg = t("Error generating thumbnail for video: generated file %file does not exist.", $error_param);
// Log the error message.
watchdog('transcoder', $error_msg, array(), WATCHDOG_ERROR);
continue;