mirror of
https://github.com/nextcloud/server.git
synced 2026-03-02 13:31:14 -05:00
Merge pull request #28523 from nextcloud/backport/28504/stable21
[stable21] Properly log errors in Movie previews generation
This commit is contained in:
commit
13772b261e
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue