diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php index 2be08d1b2c4..440168633df 100644 --- a/lib/private/Preview/Generator.php +++ b/lib/private/Preview/Generator.php @@ -224,6 +224,7 @@ class Generator { $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 68157f1a87f..a8d013452e2 100644 --- a/lib/private/Preview/Movie.php +++ b/lib/private/Preview/Movie.php @@ -32,6 +32,7 @@ namespace OC\Preview; use OCP\Files\File; use OCP\IImage; +use Psr\Log\LoggerInterface; class Movie extends ProviderV2 { public static $avconvBinary; @@ -79,13 +80,13 @@ class Movie extends ProviderV2 { $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 @@ class Movie extends ProviderV2 { return $image; } } + + $logger = \OC::$server->get(LoggerInterface::class); + $logger->error('Movie preview generation failed Output: {output}', ['app' => 'core', 'output' => $output]); + unlink($tmpPath); return null; }