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
pull/36237/head
Simon L 1 year ago committed by GitHub
commit 752f3a39f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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.

@ -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]);
}

Loading…
Cancel
Save