From c117899c45060f3e691da0b57e0204a7702d6168 Mon Sep 17 00:00:00 2001 From: Pascal Baljet Date: Thu, 12 May 2022 20:29:04 +0200 Subject: [PATCH] Separate temporary disk for processing HLS exports (#400) --- .github/workflows/run-tests.yml | 9 +++++++++ CHANGELOG.md | 8 ++++++++ config/config.php | 2 ++ src/Exporters/EncryptsHLSSegments.php | 4 +++- 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ada01cf..c48d2dc 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -51,5 +51,14 @@ jobs: - name: Execute tests run: vendor/bin/phpunit --stop-on-error --stop-on-failure --order-by random + if: matrix.os == 'ubuntu-20.04' env: FFMPEG_TEMPORARY_FILES_ROOT: ${{ github.workspace }} + FFMPEG_TEMPORARY_ENCRYPTED_HLS: /dev/shm + + - name: Execute tests + run: vendor/bin/phpunit --stop-on-error --stop-on-failure --order-by random + if: matrix.os == 'windows-2019' + env: + FFMPEG_TEMPORARY_FILES_ROOT: ${{ github.workspace }} + FFMPEG_TEMPORARY_ENCRYPTED_HLS: ${{ github.workspace }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 092fa3d..49f7bf9 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ All Notable changes to `pbmedia/laravel-ffmpeg` will be documented in this file +## 8.1.0 - 2022-05-12 + +- You may now specify a separate temporary disk for processing HLS exports. + +## 8.0.2 - 2022-05-12 + +- Fix for getting the previous exception while it doesn't exist. + ## 8.0.1 - 2022-02-22 - The configured temporary directory is now passed to the underlying driver. diff --git a/config/config.php b/config/config.php index a680319..25b8913 100755 --- a/config/config.php +++ b/config/config.php @@ -16,4 +16,6 @@ 'log_channel' => env('LOG_CHANNEL', 'stack'), // set to false to completely disable logging 'temporary_files_root' => env('FFMPEG_TEMPORARY_FILES_ROOT', sys_get_temp_dir()), + + 'temporary_files_encrypted_hls' => env('FFMPEG_TEMPORARY_ENCRYPTED_HLS', env('FFMPEG_TEMPORARY_FILES_ROOT', sys_get_temp_dir())), ]; diff --git a/src/Exporters/EncryptsHLSSegments.php b/src/Exporters/EncryptsHLSSegments.php index 73d5900..fad2271 100755 --- a/src/Exporters/EncryptsHLSSegments.php +++ b/src/Exporters/EncryptsHLSSegments.php @@ -111,7 +111,9 @@ public function withEncryptionKey($key, $filename = 'secret.key'): self $this->encryptionIV = bin2hex(static::generateEncryptionKey()); $this->encryptionKeyFilename = $filename; - $this->encryptionSecretsRoot = app(TemporaryDirectories::class)->create(); + $this->encryptionSecretsRoot = (new TemporaryDirectories( + config('laravel-ffmpeg.temporary_files_encrypted_hls', sys_get_temp_dir()) + ))->create(); return $this; }