mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Properly log errors in Movie previews generation
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
eb77a4b008
commit
40c10ab145
2 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue