summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-08-19 09:45:50 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2021-08-19 09:47:12 +0200
commit40c10ab145b39db03428483a3effed661416ced8 (patch)
treec0454764a97a8a196460cb393af524cd174ffff1
parenteb77a4b00884b033a15d72fb19e377ae3560b575 (diff)
downloadnextcloud-server-40c10ab145b39db03428483a3effed661416ced8.tar.gz
nextcloud-server-40c10ab145b39db03428483a3effed661416ced8.zip
Properly log errors in Movie previews generation
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r--lib/private/Preview/Generator.php1
-rw-r--r--lib/private/Preview/Movie.php9
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index 454439a6f65..6e1e0997a68 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 80f2b5eb763..e7fc7745996 100644
--- a/lib/private/Preview/Movie.php
+++ b/lib/private/Preview/Movie.php
@@ -31,6 +31,7 @@ namespace OC\Preview;
use OCP\Files\File;
use OCP\IImage;
+use Psr\Log\LoggerInterface;
class Movie extends ProviderV2 {
public static $avconvBinary;
@@ -78,13 +79,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);
@@ -99,6 +100,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;
}