From 1caae554de46d4ac21e4a35cdc0fc5c8c7ab328b Mon Sep 17 00:00:00 2001 From: devdatt Date: Sun, 30 Nov 2025 17:23:35 +0530 Subject: [PATCH] static update --- encoder/static.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/encoder/static.php b/encoder/static.php index e8f31c2..3934437 100755 --- a/encoder/static.php +++ b/encoder/static.php @@ -286,7 +286,13 @@ http { } } - + if ($srt_pass1 === "") { + $srt_pass1 = generateRandomString(16); + } + + if ($srt_pass2 === "") { + $srt_pass2 = generateRandomString(16); + } $sls = " srt { @@ -323,7 +329,7 @@ srt { } } "; - $service = 'ffmpeg -fflags nobuffer -i "udp://@239.255.254.254:39000?fifo_size=5000000&overrun_nonfatal=1" -c copy -f mpeg srt://127.0.0.1/shree/bhatt/ji'; + $service = 'ffmpeg -fflags nobuffer -i udp://@239.255.254.254:39000 -c copy -f mpeg srt://127.0.0.1/shree/bhatt/ji'; $file = "/var/www/encoder-srt.sh"; file_put_contents($file, $service); @@ -357,3 +363,10 @@ function update_firewall() {} function update_network() {} function update_firmware() {} + +function generateRandomString($length = 16) +{ + $bytes = random_bytes(ceil($length / 2)); + $randomString = bin2hex($bytes); + return substr($randomString, 0, $length); +}