diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index 2be08d1b2c457..440168633df63 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 68157f1a87ff5..a8d013452e264 100644 --- a/lib/private/Preview/Movie.php +++ b/lib/private/Preview/Movie.php @@ -32,6 +32,7 @@ use OCP\Files\File; use OCP\IImage; +use Psr\Log\LoggerInterface; class Movie extends ProviderV2 { public static $avconvBinary; @@ -79,13 +80,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); @@ -100,6 +101,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; }