Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <ChristophWurst@users.noreply.github.com>2021-08-19 21:00:09 +0300
committerGitHub <noreply@github.com>2021-08-19 21:00:09 +0300
commitd73b378c224de8d6f5e8e61a10e90b4ed2787b23 (patch)
tree546dfab984f12027b706f08a254290c1bcfd55f3 /lib
parented2cc082de8024c7cc5a2d11742191e50a90c181 (diff)
parent40c10ab145b39db03428483a3effed661416ced8 (diff)
Merge pull request #28504 from nextcloud/fix/debug-movie-preview
Properly log errors in Movie previews generation
Diffstat (limited to 'lib')
-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;
}