summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-11-22 04:27:34 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2013-11-22 04:27:34 -0800
commitc05177b25bf1656fbc1ed8bcb82a121e551754df (patch)
treea50cc45046140b385f2eb8c275c0b4f19a307284
parentc503588827450421777b70c173d68639197c9c9f (diff)
parent14e707503052de95aa091d02d8cc229a05d77e95 (diff)
downloadnextcloud-server-c05177b25bf1656fbc1ed8bcb82a121e551754df.tar.gz
nextcloud-server-c05177b25bf1656fbc1ed8bcb82a121e551754df.zip
Merge pull request #5882 from owncloud/preview-movie-5s
Movie preview - use frame after 5 seconds
-rw-r--r--lib/private/preview/movies.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/preview/movies.php b/lib/private/preview/movies.php
index 28f130f7506..ac771deb413 100644
--- a/lib/private/preview/movies.php
+++ b/lib/private/preview/movies.php
@@ -46,17 +46,19 @@ if (!\OC_Util::runningOnWindows()) {
$handle = $fileview->fopen($path, 'rb');
- $firstmb = stream_get_contents($handle, 1048576); //1024 * 1024 = 1048576
+ // we better use 5MB (1024 * 1024 * 5 = 5242880) instead of 1MB.
+ // in some cases 1MB was no enough to generate thumbnail
+ $firstmb = stream_get_contents($handle, 5242880);
file_put_contents($absPath, $firstmb);
if (self::$avconvBinary) {
- $cmd = self::$avconvBinary . ' -an -y -ss 1'.
+ $cmd = self::$avconvBinary . ' -an -y -ss 5'.
' -i ' . escapeshellarg($absPath) .
- ' -f mjpeg -vframes 1 ' . escapeshellarg($tmpPath) .
+ ' -f mjpeg -vframes 1 -vsync 1 ' . escapeshellarg($tmpPath) .
' > /dev/null 2>&1';
}
else {
- $cmd = self::$ffmpegBinary . ' -y -ss 1' .
+ $cmd = self::$ffmpegBinary . ' -y -ss 5' .
' -i ' . escapeshellarg($absPath) .
' -f mjpeg -vframes 1' .
' -s ' . escapeshellarg($maxX) . 'x' . escapeshellarg($maxY) .