diff --git a/config/media-library.php b/config/media-library.php index c100c807f..33d558a2b 100644 --- a/config/media-library.php +++ b/config/media-library.php @@ -192,6 +192,18 @@ 'ffmpeg_path' => env('FFMPEG_PATH', '/usr/bin/ffmpeg'), 'ffprobe_path' => env('FFPROBE_PATH', '/usr/bin/ffprobe'), + /* + * The timeout (in seconds) that will be used when generating video + * thumbnails via FFMPEG. + */ + 'ffmpeg_timeout' => env('FFMPEG_TIMEOUT', 900), + + /* + * The number of threads that FFMPEG should use. 0 means that FFMPEG + * may decide itself. + */ + 'ffmpeg_threads' => env('FFMPEG_THREADS', 0), + /* * Here you can override the class names of the jobs used by this package. Make sure * your custom jobs extend the ones provided by the package. diff --git a/src/Conversions/ImageGenerators/Video.php b/src/Conversions/ImageGenerators/Video.php index 47d7c76c2..c0feb7802 100644 --- a/src/Conversions/ImageGenerators/Video.php +++ b/src/Conversions/ImageGenerators/Video.php @@ -15,6 +15,8 @@ public function convert(string $file, ?Conversion $conversion = null): ?string $ffmpeg = FFMpeg::create([ 'ffmpeg.binaries' => config('media-library.ffmpeg_path'), 'ffprobe.binaries' => config('media-library.ffprobe_path'), + 'timeout' => config('media-library.ffmpeg_timeout', 900), + 'ffmpeg.threads' => config('media-library.ffmpeg_threads', 0), ]); $video = $ffmpeg->open($file);