diff options
-rw-r--r-- | config/config.sample.php | 9 | ||||
-rw-r--r-- | lib/private/PreviewManager.php | 8 |
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]); } |