From 45923f408fcbb10f469c6cd654c696d1b7da70a1 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 30 Dec 2017 23:24:24 -0800 Subject: provide warning if ffmpeg not found and video thumbnail is requested --- Zotlabs/Thumbs/Video.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Thumbs/Video.php b/Zotlabs/Thumbs/Video.php index d0f72bcdd..05127355e 100644 --- a/Zotlabs/Thumbs/Video.php +++ b/Zotlabs/Thumbs/Video.php @@ -38,6 +38,12 @@ class Video { * for the web server user, errors may be reported in the web server logs. */ + + $ffmpeg = trim(shell_exec('which ffmpeg')); + if($ffmpeg) { + logger('ffmpeg not found in path. Video thumbnails may fail.'); + } + $imagick_path = get_config('system','imagick_convert_path'); if($imagick_path && @file_exists($imagick_path)) { $cmd = $imagick_path . ' ' . escapeshellarg(PROJECT_BASE . '/' . $tmpfile . '[0]') . ' -thumbnail ' . $width . 'x' . $height . ' ' . escapeshellarg(PROJECT_BASE . '/' . $outfile); @@ -52,7 +58,7 @@ class Video { @rename($outfile,$file . '.thumb'); } } - + @unlink($tmpfile); } } -- cgit v1.2.3