diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index 454439a6f653a..6e1e0997a68f3 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -224,6 +224,7 @@ private function getMaxPreview(ISimpleFolder $previewFolder, File $file, $mimeTy $previewProviders = $this->previewManager->getProviders(); foreach ($previewProviders as $supportedMimeType => $providers) { + // Filter out providers that does not support this mime if (!preg_match($supportedMimeType, $mimeType)) { continue; } diff --git a/lib/private/Preview/Movie.php b/lib/private/Preview/Movie.php index 80f2b5eb76366..e7fc7745996ec 100644 --- a/lib/private/Preview/Movie.php +++ b/lib/private/Preview/Movie.php @@ -31,6 +31,7 @@ use OCP\Files\File; use OCP\IImage; +use Psr\Log\LoggerInterface; class Movie extends ProviderV2 { public static $avconvBinary; @@ -78,13 +79,13 @@ private function generateThumbNail($maxX, $maxY, $absPath, $second): ?IImage { $cmd = self::$avconvBinary . ' -y -ss ' . escapeshellarg($second) . ' -i ' . escapeshellarg($absPath) . ' -an -f mjpeg -vframes 1 -vsync 1 ' . escapeshellarg($tmpPath) . - ' > /dev/null 2>&1'; + ' 2>&1'; } else { $cmd = self::$ffmpegBinary . ' -y -ss ' . escapeshellarg($second) . ' -i ' . escapeshellarg($absPath) . ' -f mjpeg -vframes 1' . ' ' . escapeshellarg($tmpPath) . - ' > /dev/null 2>&1'; + ' 2>&1'; } exec($cmd, $output, $returnCode); @@ -99,6 +100,10 @@ private function generateThumbNail($maxX, $maxY, $absPath, $second): ?IImage { return $image; } } + + $logger = \OC::$server->get(LoggerInterface::class); + $logger->error('Movie preview generation failed Output: {output}', ['app' => 'core', 'output' => $output]); + unlink($tmpPath); return null; }