diff --git a/lib/Command/VideoSetup.php b/lib/Command/VideoSetup.php index c84960dd..efde576c 100644 --- a/lib/Command/VideoSetup.php +++ b/lib/Command/VideoSetup.php @@ -50,16 +50,12 @@ class VideoSetup extends Command protected function execute(InputInterface $input, OutputInterface $output): int { - // Check nohup binary - $nohup = shell_exec('nohup --version'); - if (!$nohup || false === strpos($nohup, 'nohup')) { - $output->writeln('nohup binary not found. Please install nohup.'); - - return $this->suggestDisable($output); - } + // Preset executables + $ffmpegPath = $this->config->getSystemValue('memories.ffmpeg_path', 'ffmpeg'); + $ffprobePath = $this->config->getSystemValue('memories.ffprobe_path', 'ffprobe'); // Get ffmpeg version - $ffmpeg = shell_exec('ffmpeg -version'); + $ffmpeg = shell_exec("$ffmpegPath -version"); if (false === strpos($ffmpeg, 'ffmpeg version')) { $ffmpeg = null; $output->writeln('ffmpeg is not installed'); @@ -68,7 +64,7 @@ class VideoSetup extends Command } // Get ffprobe version - $ffprobe = shell_exec('ffprobe -version'); + $ffprobe = shell_exec("$ffprobePath -version"); if (false === strpos($ffprobe, 'ffprobe version')) { $ffprobe = null; $output->writeln('ffprobe is not installed'); @@ -129,6 +125,7 @@ class VideoSetup extends Command $this->config->setSystemValue('memories.transcoder', $goVodPath); $this->config->setSystemValue('memories.no_transcode', false); $output->writeln('Transcoding and HLS are now enabled! Monitor the output at /tmp/go-vod.log for any errors'); + $output->writeln('You should restart the server for changes to take effect'); // Check for VAAPI $output->writeln("\nChecking for QSV (/dev/dri/renderD128)"); @@ -171,6 +168,7 @@ class VideoSetup extends Command $this->config->setSystemValue('memories.no_transcode', true); $output->writeln('Transcoding and HLS are now disabled'); + $output->writeln('You should restart the server for changes to take effect'); return 0; } diff --git a/lib/Controller/VideoController.php b/lib/Controller/VideoController.php index bf8d531f..87261372 100644 --- a/lib/Controller/VideoController.php +++ b/lib/Controller/VideoController.php @@ -96,15 +96,21 @@ class VideoController extends ApiBase } // Check for environment variables - $vaapi = $this->config->getSystemValue('memories.qsv', false); $env = ''; - if ($vaapi) { - $env .= 'VAAPI=1 '; - } + + // QSV with VAAPI + $vaapi = $this->config->getSystemValue('memories.qsv', false); + if ($vaapi) $env .= 'VAAPI=1 '; + + // Paths + $ffmpegPath = $this->config->getSystemValue('memories.ffmpeg_path', 'ffmpeg'); + $ffprobePath = $this->config->getSystemValue('memories.ffprobe_path', 'ffprobe'); + $tmpPath = $this->config->getSystemValue('memories.tmp_path', sys_get_temp_dir()); + $env .= "FFMPEG='$ffmpegPath' FFPROBE='$ffprobePath' GOVOD_TEMPDIR='$tmpPath/go-vod' "; // Check if already running - shell_exec("pkill {$transcoder}"); - shell_exec("{$env} nohup {$transcoder} > {$tmpDir}/go-vod.log 2>&1 & > /dev/null"); + exec("pkill {$transcoder}"); + shell_exec("{$env} nohup {$transcoder} > {$tmpPath}/go-vod.log 2>&1 & > /dev/null"); // wait for 1s and try again sleep(1); diff --git a/scripts/get-exiftool.sh b/scripts/get-exiftool.sh index 6f78f136..2cfaea78 100755 --- a/scripts/get-exiftool.sh +++ b/scripts/get-exiftool.sh @@ -17,7 +17,7 @@ mv "exiftool-$exifver" exiftool rm -rf *.zip exiftool/t exiftool/html chmod 755 exiftool/exiftool -govod="0.0.11" +govod="0.0.12" wget -q "https://github.com/pulsejet/go-vod/releases/download/$govod/go-vod-amd64" wget -q "https://github.com/pulsejet/go-vod/releases/download/$govod/go-vod-aarch64" chmod 755 go-vod-*