From 7011fdf9c27b7ce42cd3d77e1d2992a2b2b1e2eb Mon Sep 17 00:00:00 2001 From: Markerov Date: Wed, 7 Jan 2015 03:18:24 +0800 Subject: [PATCH] round starting time down to nearest second --- inc/lib/webm/ffmpeg.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/lib/webm/ffmpeg.php b/inc/lib/webm/ffmpeg.php index 405dbdf1..485e4702 100644 --- a/inc/lib/webm/ffmpeg.php +++ b/inc/lib/webm/ffmpeg.php @@ -63,7 +63,7 @@ function make_webm_thumbnail($filename, $thumbnail, $width, $height, $duration) $ret = 0; $ffmpeg_out = array(); - exec("$ffmpeg -strict -2 -ss " . $duration / 2 . " -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnail 2>&1", $ffmpeg_out, $ret); + exec("$ffmpeg -strict -2 -ss " . floor($duration / 2) . " -i $filename -v quiet -an -vframes 1 -f mjpeg -vf scale=$width:$height $thumbnail 2>&1", $ffmpeg_out, $ret); return $ret; }