From 3dfdf0949d0f43f85cd71b2ec32b7458d33037da Mon Sep 17 00:00:00 2001 From: Daniel Neto Date: Tue, 7 Jan 2025 10:34:46 -0300 Subject: [PATCH] Update --- plugin/API/standAlone/ffmpeg.json.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin/API/standAlone/ffmpeg.json.php b/plugin/API/standAlone/ffmpeg.json.php index 8d71e62d9b93..2374dc68fb92 100644 --- a/plugin/API/standAlone/ffmpeg.json.php +++ b/plugin/API/standAlone/ffmpeg.json.php @@ -397,8 +397,8 @@ function addKeywordToFFmpegCommand(string $command, string $keyword): string // Kill processes associated with the keyword if (!empty($keyword)) { - $countCommand = "pgrep -f 'ffmpeg.*$keyword' | wc -l"; - $processListCommand = "pgrep -f 'ffmpeg.*$keyword' | xargs -r ps -o pid,cmd -p"; + $countCommand = "pgrep -f 'ffmpeg.*$keyword' | grep -v $$ | wc -l"; + $processListCommand = "pgrep -f 'ffmpeg.*$keyword' | grep -v $$ | xargs -r ps -o pid,cmd -p"; $processCount = intval(exec($countCommand)); $processList = shell_exec($processListCommand); @@ -414,6 +414,7 @@ function addKeywordToFFmpegCommand(string $command, string $keyword): string exit; } + // if I kill it it will infinite loop the VideoPlaylistScheduler because the on_publish done //_error_log("Killing process with keyword: $keyword"); //killProcessFromKeyword($keyword, 60);