summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-01-18 22:14:22 +0100
committerGitHub <noreply@github.com>2023-01-18 22:14:22 +0100
commit752f3a39f9e4745a241063ff7f3322b753fa7bbb (patch)
tree78407bc0c162602cf2d056ccc7f70076954599ca
parent444f11b857ffb63382409df3c572e49d4ca2bf4d (diff)
parentfa12219629fb0bb18c5caef2e48e5b5d45296406 (diff)
downloadnextcloud-server-752f3a39f9e4745a241063ff7f3322b753fa7bbb.tar.gz
nextcloud-server-752f3a39f9e4745a241063ff7f3322b753fa7bbb.zip
Merge pull request #36225 from Jachhj-sc/patch-1
Add check config.php for ffmpeg_path in PreviewManager.php. fix for snap no video preview
-rw-r--r--config/config.sample.php9
-rw-r--r--lib/private/PreviewManager.php8
2 files changed, 14 insertions, 3 deletions
diff --git a/config/config.sample.php b/config/config.sample.php
index 0267ae51c91..d529661b81d 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -1190,7 +1190,14 @@ $CONFIG = [
'preview_office_cl_parameters' =>
' --headless --nologo --nofirststartwizard --invisible --norestore '.
'--convert-to png --outdir ',
-
+
+/**
+ * custom path for ffmpeg binary
+ *
+ * Defaults to ``null`` and falls back to searching ``avconv`` and ``ffmpeg`` in the configured ``PATH`` environment
+ */
+'preview_ffmpeg_path' => '/usr/bin/ffmpeg',
+
/**
* Set the URL of the Imaginary service to send image previews to.
* Also requires the ``OC\Preview\Imaginary`` provider to be enabled.
diff --git a/lib/private/PreviewManager.php b/lib/private/PreviewManager.php
index 87e709e9bcc..367f0c1c057 100644
--- a/lib/private/PreviewManager.php
+++ b/lib/private/PreviewManager.php
@@ -417,11 +417,15 @@ class PreviewManager implements IPreview {
// Video requires avconv or ffmpeg
if (in_array(Preview\Movie::class, $this->getEnabledDefaultProvider())) {
- $movieBinary = $this->binaryFinder->findBinaryPath('avconv');
+ $movieBinary = $this->config->getSystemValue('preview_ffmpeg_path', null);
if (!is_string($movieBinary)) {
- $movieBinary = $this->binaryFinder->findBinaryPath('ffmpeg');
+ $movieBinary = $this->binaryFinder->findBinaryPath('avconv');
+ if (!is_string($movieBinary)) {
+ $movieBinary = $this->binaryFinder->findBinaryPath('ffmpeg');
+ }
}
+
if (is_string($movieBinary)) {
$this->registerCoreProvider(Preview\Movie::class, '/video\/.*/', ["movieBinary" => $movieBinary]);
}