From cbab4e2fcb9245ec21b7026e55e0bc5e283f2205 Mon Sep 17 00:00:00 2001 From: devdatt Date: Mon, 8 Dec 2025 02:07:51 +0530 Subject: [PATCH] upadte ui --- encoder/input.php | 81 ++++++++++++++++++++++++++++++++++++++++++++++ encoder/static.php | 15 ++------- install.sh | 49 ---------------------------- 3 files changed, 83 insertions(+), 62 deletions(-) diff --git a/encoder/input.php b/encoder/input.php index 3d69008..75078a4 100755 --- a/encoder/input.php +++ b/encoder/input.php @@ -189,6 +189,87 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { +
+

Common BackEnd

+ +
+
+ +
+ + +
+
+ + +
+
+ + +
+
+
+ +

+
+ + +
+
+ + +
+
+
+
+ + +
+
+
diff --git a/encoder/static.php b/encoder/static.php index bc88274..967f3f8 100755 --- a/encoder/static.php +++ b/encoder/static.php @@ -63,15 +63,7 @@ function update_service($which_service) switch ($input_source) { case "hdmi": - $ustreamer = "ustreamer --device /dev/video0 --format MJPEG --resolution " . $data['hdmi']['resolution'] . " -f " . $data['hdmi']['framerate'] . ' --workers 3 --host 0.0.0.0 --port 9090 '; - $file = "/var/www/ustreamer.sh"; - if (file_put_contents($file, $ustreamer) !== false) { - echo "File saved."; - } else { - echo "Error writing file."; - } - exec('sudo systemctl enable ustreamer'); - exec('sudo systemctl restart ustreamer'); + $input .= "ffmpeg -hide_banner -stream_loop -1 -re -i " . $data['url']; break; case "url": $input .= "ffmpeg -hide_banner -stream_loop -1 -re -i " . $data['url']; @@ -218,10 +210,7 @@ function update_service($which_service) switch ($which_service) { case 'input': - if ($input_source == 'hdmi') - $input = "ffmpeg -hide_banner -stream_loop -1 -f alsa -i " . $hdmi_source . " -c:a aac -b:a 256k -f mpegts udp://@239.255.254.254:39000?fifo_size=5000000&overrun_nonfatal=1&localaddr=127.0.0.1&ttl=1"; - else - $input .= " -c:v copy -c:a copy -f mpegts udp://@239.255.254.254:39000?fifo_size=5000000&overrun_nonfatal=1&localaddr=127.0.0.1&ttl=1"; + $input .= ' -c:v copy -c:a copy -f mpegts "udp://@239.255.254.254:39000?fifo_size=5000000&overrun_nonfatal=1&localaddr=127.0.0.1&ttl=1" '; $service = $input; $file = "/var/www/encoder-main.sh"; if (file_put_contents($file, $service) !== false) { diff --git a/install.sh b/install.sh index a9fecbc..8e80431 100755 --- a/install.sh +++ b/install.sh @@ -198,52 +198,6 @@ Environment=PATH=/usr/bin:/usr/local/bin WantedBy=multi-user.target EOL -cat > /etc/systemd/system/mediamtx.service<< 'EOL' -[Unit] -Description= UDP Encoder by ShreeBhattJi - - -[Service] -WorkingDirectory=/var/lib/mediamtx -ExecStart=/usr/local/bin/mediamtx -f /etc/mediamtx.yml -Restart=on-failure -RestartSec=5 -WatchdogSec=30 -LimitNOFILE=65536 -User=root - -[Install] -WantedBy=multi-user.target -EOL - -cat > /etc/systemd/system/ustreamer.service<< 'EOL' -[Unit] -Description= UDP Encoder by ShreeBhattJi - - -[Service] -ExecStart=/bin/bash /var/www/ustreamer.sh -WorkingDirectory=/var/www/ -Restart=always -User=root -Environment=PATH=/usr/bin:/usr/local/bin - -[Install] -WantedBy=multi-user.target -EOL - - -sudo mv mediamtx /usr/local/bin/mediamtx -sudo chmod +x /usr/local/bin/mediamtx -sudo mkdir -p /var/lib/mediamtx - -# /etc/mediamtx.yml -cat > /etc/mediamtx.yml<< 'EOL' -paths: - mystream: - publish: yes -EOL - # graph monitor setup cat > /etc/systemd/system/system-monitor.service<< 'EOL' [Unit] @@ -415,7 +369,6 @@ server { EOL rm /var/www/html/index.nginx-debian.html; -sudo mkdir -p /var/lib/mediamtx; sudo mkdir -p /var/www/html/hls/shree; sudo mkdir -p /var/www/html/dash/shree; sudo mkdir -p /var/www/html/hls/shreeshree; @@ -435,8 +388,6 @@ sudo systemctl enable --now system-monitor.service sudo systemctl status system-monitor.service --no-pager sudo systemctl enable --now nginx.service sudo systemctl status nginx.service --no-pager -sudo systemctl enable --now mediamtx.service -sudo systemctl restart mediamtx.service --no-pager sudo chmod 777 -R /var/www sudo chown -R www-data:www-data /var/www