From 06bbf2fe3966720fbc4e4a572b9406a85c9a3d05 Mon Sep 17 00:00:00 2001 From: ShreeBhattJi Date: Thu, 20 Nov 2025 11:26:01 +0000 Subject: [PATCH] gui update --- html/about_us.php | 25 +- ...b6679b8d8815a2ec8e5524407f1b25d6eb1c46.php | 5 + html/contact_us.php | 54 +++ html/domain.php | 197 +++++++++++ html/firmware.php | 2 +- html/footer.php | 2 +- html/header.php | 27 +- html/input.php | 36 +- html/metrics.json | 1 - html/network.php | 325 ++++++++++++++---- html/nginx.conf | 1 - html/output.php | 276 ++++++++------- html/premium_service.php | 292 ++++++++++++++++ html/request_cert.php | 131 +++++++ html/static.php | 37 +- html/status.php | 12 + 16 files changed, 1200 insertions(+), 223 deletions(-) create mode 100644 html/ac4d5de9f5785044565fe1fd9578413738e9b7c9c4df6fd4dae247d8d2828c4e2a490b9edb0d6c84f5a1b6679b8d8815a2ec8e5524407f1b25d6eb1c46.php create mode 100755 html/contact_us.php create mode 100644 html/domain.php delete mode 100644 html/metrics.json create mode 100644 html/premium_service.php create mode 100644 html/request_cert.php create mode 100644 html/status.php diff --git a/html/about_us.php b/html/about_us.php index 9d4569d..9f0494c 100755 --- a/html/about_us.php +++ b/html/about_us.php @@ -3,9 +3,32 @@
+

ShreeBhattJi

+

If you’ve ever read the Panchatantra, a few stories begin like this: “Once upon a time, there lived a poor Brahmin in a village.” In this story, that Brahmin is me — ShreeBhattJi, also known as Devdatt Bhatt, the King of Automation and Remote Control from the land of great beginnings, Bhavnagar. +

I am here to help provide a great viewing experience for users, generate strong commissions for LCOs, MSOs, and ISPs, and create substantial revenue for content owners while contributing fair taxes to the government. I have reason to believe that by upgrading a few devices at the transmission point, both streaming operations and customer viewing experiences can be improved exponentially. +

We are proud to present Universal Digital Encoder Decoder as all formate to all formate encoder cum decoder for dedicated hardware , virtual machines and proxmox lxc images . +

+

+
+

Bhavnagar :- The Land Of Great Beginnings

+
    +
  • The great country called India began to exist at Bhavnagar. On 15 August 1947, Indian administrative control effectively began with Bhavnagar after Maharaja Krishnakumarsinhji Bhavsinhji Gohil merged his princely state into the independent Union of India.
  • +

    +

  • The “bull gift” from Maharaja Krishnakumarsinhji of Bhavnagar to Brazilian cattle baron Celso Garcia Sid helped shape the Brazilian dairy industry, leading to the world-famous Girolando breed. Today, Girolando cows produce over 80% of Brazil’s milk. DD INDIA REPORT
  • +

    +

  • The first diamond-cutting industry in India started in Bhavnagar, not Surat. Skilled jewelers and artisans in Bhavnagar (Saurashtra region, Gujarat) began cutting and polishing small rough diamonds imported from Africa. These craftsmen later moved to Surat, which eventually became the world’s largest diamond-cutting and polishing hub.
  • +

    +

  • The largest ship-breaking yard in the world, “Alang Ship Breaking Yard,” located in Bhavnagar district, Gujarat, started operations in 1983. It handles over 50% of global ship recycling by tonnage and is a major source of recycled steel for India’s economy.
  • +

    +

  • After the Kurukshetra war, the Pandavas sought absolution for the killing that occurred in battle. Following the guidance of Lord Krishna, who gave them a black flag and a black cow, they were instructed to follow the cow until both turned white. Krishna told them that when this happened, they would be forgiven. The Pandavas followed the cow for many years to various places, but the flag and cow remained black. Finally, when they reached Koliyak Beach, both miraculously turned white.
  • +
    +
    +
    +
    +


- + \ No newline at end of file diff --git a/html/ac4d5de9f5785044565fe1fd9578413738e9b7c9c4df6fd4dae247d8d2828c4e2a490b9edb0d6c84f5a1b6679b8d8815a2ec8e5524407f1b25d6eb1c46.php b/html/ac4d5de9f5785044565fe1fd9578413738e9b7c9c4df6fd4dae247d8d2828c4e2a490b9edb0d6c84f5a1b6679b8d8815a2ec8e5524407f1b25d6eb1c46.php new file mode 100644 index 0000000..ba2e1f6 --- /dev/null +++ b/html/ac4d5de9f5785044565fe1fd9578413738e9b7c9c4df6fd4dae247d8d2828c4e2a490b9edb0d6c84f5a1b6679b8d8815a2ec8e5524407f1b25d6eb1c46.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/html/contact_us.php b/html/contact_us.php new file mode 100755 index 0000000..86b157a --- /dev/null +++ b/html/contact_us.php @@ -0,0 +1,54 @@ + + +
+
+
+

How Can We Help ?

+
    +
  • We provide free RTMP and EPG file hosting for Registared Broadcastors.
  • +
  • Auto Publishing channel on Cable Tv, IPTV , OTT APP like URMIC OTT.
  • +
  • LCO and MSO can get local channels via STREAMINGBOX ( One Box 30 channel - No Encoder Needed - QAM is must )
  • +
  • ISP will get scalable Intranet OTT for resellers and customers .
  • +
+
+
+

Say Hello to Us

+

C-1819 ,
Radhesyam Soc,
Kalyabid,
Bhavnagar - 364001
INDIA +

support@urmic.org +
+91-8000-74-1919 +

+ +
+
+ +
+
+ diff --git a/html/domain.php b/html/domain.php new file mode 100644 index 0000000..d14f8dd --- /dev/null +++ b/html/domain.php @@ -0,0 +1,197 @@ + + + +
+
+
+
+
+ + + + + + + + + + + +
+
+ + +
+
+ + +
+ +
+ +
By checking this you authorise the server operator to run Certbot and modify nginx configuration for the supplied domain(s).
+
+
+ + + + + +
+ + +
+ + +
+ Why ports 80 and 443 are required +
+- Port 80 (HTTP) is used by Certbot for the HTTP-01 challenge: Let's Encrypt connects over HTTP to verify you control the domain.
+- Port 443 (HTTPS) is required to serve TLS traffic after the certificate is issued. Nginx must accept HTTPS on port 443 so browsers and streaming clients can connect securely.
+
+
+Ensure both ports are reachable from the public internet and forwarded to this server's IP. If you use a firewall, add rules to allow inbound TCP 80 and 443.
+                            
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/html/firmware.php b/html/firmware.php index c339848..35d6837 100755 --- a/html/firmware.php +++ b/html/firmware.php @@ -26,7 +26,7 @@ if ($_POST['action'] === 'update') { } elseif ($_POST['action'] === 'reset') { $files = glob('/var/www/html/*.json'); foreach ($files as $file) { - if (is_file($file)) { + if (is_file($file) && basename($file) !== 'critical.json') { unlink($file); } } diff --git a/html/footer.php b/html/footer.php index 90f7f9a..5421433 100755 --- a/html/footer.php +++ b/html/footer.php @@ -1,5 +1,5 @@ diff --git a/html/header.php b/html/header.php index d74cce7..e1d3636 100755 --- a/html/header.php +++ b/html/header.php @@ -395,28 +395,49 @@ .form-center { text-align: center; } + .social-row { + display: flex; + gap: 12px; + align-items: center; + padding: 8px; + } + .social-btn { + width: 67px; + height: 67px; + display: inline-grid; + place-items: center; + border-radius: 8px; + background: #f3f4f6; + text-decoration: none; + transition: transform .12s, box-shadow .12s; + } + .social-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.08); } + .social-btn svg { width: 22px; height: 22px; display: block; } + .sr-only { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; } -
Universal Digital Encoder / Decoder
+
URMI Universal Encoder / Decoder
diff --git a/html/input.php b/html/input.php index 320ed73..bf8759c 100755 --- a/html/input.php +++ b/html/input.php @@ -1,9 +1,6 @@ 'url', 'hdmi' => [ @@ -13,7 +10,7 @@ $defaults = [ ], 'url' => 'https://cdn.urmic.org/unavailable.mp4', 'rtmp' => [ - 'mount' => '', + 'mount' => 'shreebhattji', 'password' => 'live', 'port' => '1935' ], @@ -22,7 +19,9 @@ $defaults = [ 'stream_id_2' => 'har', 'stream_id_3' => 'Mahadev', 'port' => '1937' - ] + ], + 'udp'=>'udp://@224.1.1.1:8000', + 'custom'=>'' ]; if (file_exists($jsonFile)) { @@ -58,7 +57,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { 'stream_id_2' => $posted('srt_stream_id_2', $defaults['srt']['stream_id_2']), 'stream_id_3' => $posted('srt_stream_id_3', $defaults['srt']['stream_id_3']), 'port' => $posted('srt_port', $defaults['srt']['port']) - ] + ], + 'udp' => $posted('udp', $defaults['udp']), + 'custom' => $posted('custom', $defaults['custom']) + ]; // write JSON with exclusive lock and pretty print @@ -83,7 +85,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { + +
+

Custom Input

+
+ + +
+
+
diff --git a/html/metrics.json b/html/metrics.json deleted file mode 100644 index da4ed87..0000000 --- a/html/metrics.json +++ /dev/null @@ -1 +0,0 @@ -{"timestamps": ["2025-10-28T12:15:59", "2025-10-28T12:16:04", "2025-10-28T12:16:09", "2025-10-28T12:16:14", "2025-10-28T12:16:19", "2025-10-28T12:16:24", "2025-10-28T12:16:29", "2025-10-28T12:16:34", "2025-10-28T12:16:39", "2025-10-28T12:16:44", "2025-10-28T12:16:49", "2025-10-28T12:16:54", "2025-10-28T12:16:59", "2025-10-28T12:17:04", "2025-10-28T12:17:09", "2025-10-28T12:17:14", "2025-10-28T12:17:19", "2025-10-28T12:17:24", "2025-10-28T12:17:29", "2025-10-28T12:17:34", "2025-10-28T12:17:39", "2025-10-28T12:17:44", "2025-10-28T12:17:49", "2025-10-28T12:17:54", "2025-10-28T12:17:59", "2025-10-28T12:18:04", "2025-10-28T12:18:09", "2025-10-28T12:18:14", "2025-10-28T12:18:19", "2025-10-28T12:18:24", "2025-10-28T12:18:29", "2025-10-28T12:18:34", "2025-10-28T12:18:39", "2025-10-28T12:18:44", "2025-10-28T12:18:49", "2025-10-28T12:18:54", "2025-10-28T12:18:59", "2025-10-28T12:19:04", "2025-10-28T12:19:09", "2025-10-28T12:19:14", "2025-10-28T12:19:19", "2025-10-28T12:19:24", "2025-10-28T12:19:29", "2025-10-28T12:19:34", "2025-10-28T12:19:39", "2025-10-28T12:19:44", "2025-10-28T12:19:49", "2025-10-28T12:19:54", "2025-10-28T12:19:59", "2025-10-28T12:20:04", "2025-10-28T12:20:09", "2025-10-28T12:20:14", "2025-10-28T12:20:19", "2025-10-28T12:20:24", "2025-10-28T12:20:29", "2025-10-28T12:20:34", "2025-10-28T12:20:39", "2025-10-28T12:20:44", "2025-10-28T12:20:49", "2025-10-28T12:20:54", "2025-10-28T12:20:59", "2025-10-28T12:21:04", "2025-10-28T12:21:09", "2025-10-28T12:21:14", "2025-10-28T12:21:19", "2025-10-28T12:21:24", "2025-10-28T12:21:29", "2025-10-28T12:21:34", "2025-10-28T12:21:39", "2025-10-28T12:21:44", "2025-10-28T12:21:49", "2025-10-28T12:21:54", "2025-10-28T12:21:59", "2025-10-28T12:22:04", "2025-10-28T12:22:09", "2025-10-28T12:22:14", "2025-10-28T12:22:19", "2025-10-28T12:22:24", "2025-10-28T12:22:29", "2025-10-28T12:22:34", "2025-10-28T12:22:39", "2025-10-28T12:22:44", "2025-10-28T12:22:49", "2025-10-28T12:22:54", "2025-10-28T12:22:59", "2025-10-28T12:23:04", "2025-10-28T12:23:09", "2025-10-28T12:23:14", "2025-10-28T12:23:19", "2025-10-28T12:23:24", "2025-10-28T12:23:29", "2025-10-28T12:23:34", "2025-10-28T12:23:39", "2025-10-28T12:23:44", "2025-10-28T12:23:49", "2025-10-28T12:23:54", "2025-10-28T12:23:59", "2025-10-28T12:24:04", "2025-10-28T12:24:09", "2025-10-28T12:24:14", "2025-10-28T12:24:19", "2025-10-28T12:24:24", "2025-10-28T12:24:29", "2025-10-28T12:24:34", "2025-10-28T12:24:39", "2025-10-28T12:24:44", "2025-10-28T12:24:49", "2025-10-28T12:24:54", "2025-10-28T12:24:59", "2025-10-28T12:25:04", "2025-10-28T12:25:09", "2025-10-28T12:25:14", "2025-10-28T12:25:19", "2025-10-28T12:25:24", "2025-10-28T12:25:29", "2025-10-28T12:25:34", "2025-10-28T12:25:39", "2025-10-28T12:25:44", "2025-10-28T12:25:49", "2025-10-28T12:25:54", "2025-10-28T12:25:59", "2025-10-28T12:26:04", "2025-10-28T12:26:09", "2025-10-28T12:26:14", "2025-10-28T12:26:19", "2025-10-28T12:26:24", "2025-10-28T12:26:29", "2025-10-28T12:26:35", "2025-10-28T12:26:40", "2025-10-28T12:26:45", "2025-10-28T12:26:50", "2025-10-28T12:26:55", "2025-10-28T12:27:00", "2025-10-28T12:27:05", "2025-10-28T12:27:10", "2025-10-28T12:27:15", "2025-10-28T12:27:20", "2025-10-28T12:27:25", "2025-10-28T12:27:30", "2025-10-28T12:27:35", "2025-10-28T12:27:40", "2025-10-28T12:27:45", "2025-10-28T12:27:50", "2025-10-28T12:27:55", "2025-10-28T12:28:00", "2025-10-28T12:28:05", "2025-10-28T12:28:10", "2025-10-28T12:28:15", "2025-10-28T12:28:20", "2025-10-28T12:28:25", "2025-10-28T12:28:30", "2025-10-28T12:28:35", "2025-10-28T12:28:40", "2025-10-28T12:28:45", "2025-10-28T12:28:50", "2025-10-28T12:28:55", "2025-10-28T12:29:00", "2025-10-28T12:29:05", "2025-10-28T12:29:10", "2025-10-28T12:29:15", "2025-10-28T12:29:20", "2025-10-28T12:29:25", "2025-10-28T12:29:30", "2025-10-28T12:29:35", "2025-10-28T12:29:40", "2025-10-28T12:29:45", "2025-10-28T12:29:50", "2025-10-28T12:29:55", "2025-10-28T12:30:00", "2025-10-28T12:30:05", "2025-10-28T12:30:10", "2025-10-28T12:30:15", "2025-10-28T12:30:20", "2025-10-28T12:30:25", "2025-10-28T12:30:30", "2025-10-28T12:30:35", "2025-10-28T12:30:40", "2025-10-28T12:30:45", "2025-10-28T12:30:50", "2025-10-28T12:30:55"], "cpu_percent": [1.8, 4.8, 1.5, 1.3, 1.4, 1.7, 2.4, 1.2, 2.0, 2.2, 4.2, 4.2, 10.9, 3.9, 2.1, 1.4, 1.9, 2.1, 1.9, 1.3, 1.2, 1.2, 2.0, 0.9, 1.3, 1.2, 1.2, 1.1, 1.6, 2.4, 2.6, 1.9, 1.7, 1.7, 3.5, 1.4, 3.5, 2.4, 2.1, 1.2, 2.0, 2.5, 2.5, 2.1, 2.6, 2.2, 2.5, 3.0, 2.4, 2.6, 2.6, 2.0, 2.7, 1.8, 2.4, 1.8, 2.4, 2.4, 2.0, 3.7, 2.1, 4.0, 1.9, 1.8, 1.5, 1.4, 2.4, 2.2, 1.3, 1.5, 1.9, 3.9, 2.0, 1.8, 1.8, 1.6, 1.5, 1.8, 2.1, 1.5, 1.9, 1.4, 2.1, 3.7, 1.7, 1.8, 2.2, 1.3, 2.2, 24.1, 2.8, 4.9, 2.6, 2.5, 1.8, 3.7, 6.7, 1.9, 1.7, 1.6, 1.1, 1.5, 1.4, 1.3, 1.5, 1.4, 1.7, 1.2, 1.9, 2.0, 1.3, 1.1, 0.8, 2.6, 2.0, 2.5, 2.2, 2.3, 2.5, 2.0, 3.6, 5.2, 3.0, 2.4, 2.7, 2.3, 2.2, 1.8, 1.8, 2.5, 2.9, 2.3, 21.6, 3.0, 2.4, 3.0, 6.6, 2.4, 2.4, 2.3, 2.1, 1.6, 2.1, 2.0, 2.3, 3.1, 1.7, 2.0, 3.7, 2.1, 2.1, 1.6, 2.1, 2.1, 1.8, 7.6, 2.3, 3.3, 2.4, 2.2, 2.4, 2.2, 1.9, 1.5, 2.0, 1.7, 2.9, 1.1, 1.3, 2.7, 3.2, 2.3, 1.8, 1.4, 3.9, 1.8, 2.0, 1.4, 2.4, 2.4], "ram_percent": [7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 6.9, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 11.1, 11.1, 11.1, 11.1, 11.1, 11.1, 10.2, 10.1, 10.1, 10.1, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.2, 10.3, 10.3, 10.3, 10.3, 10.3, 10.3, 10.3, 10.3, 10.6, 10.3, 10.3, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.4, 10.5, 10.4, 10.4, 12.1, 12.1, 12.1, 12.1, 11.3, 11.3, 11.3, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.4, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.8, 11.9, 11.9, 11.9], "net_in_Bps": [1462, 1521, 1541, 712, 511, 544, 573, 671, 511, 595, 544, 524, 614, 676, 532, 544, 510, 544, 1272, 510, 511, 544, 560, 510, 531, 531, 511, 510, 531, 510, 573, 636, 510, 552, 543, 531, 3871, 4429, 534, 510, 2333, 6326, 2028, 3488, 6650, 7872, 6774, 8027, 9483, 9593, 8262, 3901, 542, 2781, 5457, 1683, 5668, 4654, 544, 2398, 544, 564, 521, 532, 521, 982, 531, 2102, 512, 511, 523, 511, 510, 511, 510, 511, 532, 542, 595, 594, 532, 586, 554, 542, 563, 542, 521, 511, 1959, 17416, 4362, 19607, 5691, 5487, 1930, 10249, 22019, 1197, 692, 697, 716, 699, 763, 786, 692, 677, 736, 2144, 1415, 1270, 1710, 1710, 1665, 1666, 1668, 2780, 2329, 1688, 3468, 1507, 4660, 4287, 7360, 5264, 7044, 1519, 1506, 1497, 1258, 1502, 2900, 6259, 8093, 6714, 13324, 11852, 7915, 3987, 4629, 3278, 1557, 1499, 1573, 1514, 1741, 1728, 1508, 4388, 11642, 3377, 3457, 4020, 3652, 5799, 1594, 5172, 3873, 2777, 2759, 2775, 4031, 1571, 1316, 1476, 1407, 1326, 1432, 1496, 1472, 1354, 3665, 2715, 1336, 1410, 8935, 3541, 3261, 3200, 2691, 626], "net_out_Bps": [12796, 12770, 12793, 2868, 399, 459, 446, 460, 399, 475, 420, 412, 399, 459, 399, 459, 399, 433, 425, 399, 399, 466, 419, 399, 445, 446, 399, 398, 446, 399, 420, 399, 398, 446, 446, 446, 4365, 4322, 402, 398, 2302, 6316, 1976, 3449, 6337, 7894, 6749, 7946, 9513, 9559, 8113, 3878, 470, 2747, 5242, 1325, 5608, 4761, 447, 2368, 474, 472, 423, 447, 422, 399, 446, 2045, 400, 399, 400, 399, 399, 400, 399, 425, 449, 423, 399, 399, 446, 519, 470, 443, 456, 444, 409, 399, 1941, 19768, 3714, 23471, 3963, 5511, 1931, 11254, 24438, 1158, 581, 565, 631, 627, 581, 604, 567, 565, 617, 16649, 7651, 6302, 12665, 12637, 12604, 12704, 12674, 13157, 13321, 10485, 14832, 12471, 16230, 15442, 18628, 16341, 18089, 12457, 12476, 12457, 10135, 12585, 13860, 17572, 20590, 17499, 24145, 22851, 19758, 14285, 15679, 12079, 12534, 12490, 12562, 12436, 12649, 12662, 12414, 15921, 23448, 14483, 14418, 12537, 14564, 16232, 12481, 16221, 14890, 13717, 13753, 13672, 15014, 12477, 9997, 12354, 12364, 12343, 12342, 12375, 12351, 12353, 14637, 13732, 12317, 12309, 18610, 14571, 14035, 4815, 2580, 539], "disk_read_Bps": [0, 176814, 0, 0, 0, 0, 0, 0, 0, 0, 18007, 563130, 21129804, 16010494, 0, 0, 0, 15452762, 260275, 84310, 10640, 5729, 1637, 0, 0, 818, 0, 0, 0, 818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 818, 1055055, 0, 0, 0, 0, 20461, 0, 0, 438714, 0, 0, 4911, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4976396, 0, 0, 0, 1637, 0, 0, 569669, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2455, 0, 0, 0, 818, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 365875, 0, 0, 0, 0, 0, 966676, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1115694, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41751, 0, 0, 0, 0, 0, 0, 0, 0, 10641, 0, 0], "disk_write_Bps": [176823, 13882423, 3614940, 10721097, 243093, 197257, 202984, 90853, 135053, 241474, 23796979, 1438929, 2779348, 461723, 661363, 487839, 568072, 162066, 751360, 176806, 561514, 220981, 173524, 407618, 144874, 144064, 321711, 171066, 30284, 91673, 182518, 74482, 148081, 240647, 32741, 421519, 183356, 191530, 306986, 216934, 34376, 216916, 225109, 153903, 240659, 231643, 70394, 396222, 354457, 196459, 280753, 273384, 64661, 74484, 252090, 193988, 130967, 239838, 112130, 203801, 369167, 207898, 280772, 219373, 218580, 45020, 311054, 185014, 113792, 223465, 175179, 175154, 425660, 296341, 115409, 171083, 167791, 42562, 172706, 77760, 192368, 198938, 44204, 179272, 383860, 211999, 317619, 178463, 67119, 303658, 1144296, 144878, 241473, 254565, 75303, 33559, 541022, 451795, 241468, 209527, 91670, 147331, 219369, 161257, 221012, 224279, 173519, 189074, 209530, 501729, 236577, 295522, 176816, 68766, 225083, 60568, 125245, 249688, 180909, 1158238, 1139470, 417441, 285659, 243101, 198089, 175989, 76940, 182541, 117867, 72856, 242288, 40924, 67118, 451783, 117065, 114598, 206262, 161246, 88393, 165343, 133414, 58936, 221805, 69576, 66295, 266028, 311871, 216894, 182537, 70397, 72847, 154697, 72844, 95768, 263573, 157981, 111319, 157970, 408442, 302034, 212817, 185788, 176812, 140775, 78584, 178458, 175170, 181734, 86776, 406006, 480437, 350324, 210349, 44201, 213658, 174364, 116226, 327430, 181726, 62209], "disk_percent": [36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.4, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3, 36.3], "sample_interval": 5.0, "generated_at": "2025-10-28T12:30:55Z"} \ No newline at end of file diff --git a/html/network.php b/html/network.php index b388b36..d9da637 100755 --- a/html/network.php +++ b/html/network.php @@ -5,22 +5,41 @@ $iface = trim(shell_exec("ip route get 1.1.1.1 | awk '{print $5; exit}'")); $defaults = [ 'primary' => [ - 'mode' => 'primary_dhcp', // primary_static or primary_dhcp - 'ip' => '', - 'subnet' => '', - 'gateway' => '', - 'vlan' => '' + 'mode' => 'dhcp', + 'modev6' => 'auto', + 'network_primary_ip' => '', + 'network_primary_subnet' => '', + 'network_primary_gateway' => '', + 'network_primary_vlan' => '', + 'network_primary_dns1' => '', + 'network_primary_dns2' => '', + 'network_primary_ipv6' => '', + 'network_primary_ipv6_prefix' => '', + 'network_primary_ipv6_gateway' => '', + 'network_primary_ipv6_vlan' => '', + 'network_primary_ipv6_dns1' => '', + 'network_primary_ipv6_dns2' => '', ], 'secondary' => [ - 'mode' => 'secondary_disable', // secondary_static or secondary_dhcp - 'ip' => '', - 'subnet' => '', - 'gateway' => '', - 'vlan' => '' - ] + 'mode' => 'disabled', + 'modev6' => 'disabled', + 'network_secondary_ip' => '', + 'network_secondary_subnet' => '', + 'network_secondary_gateway' => '', + 'network_secondary_vlan' => '', + 'network_secondary_dns1' => '', + 'network_secondary_dns2' => '', + 'network_secondary_ipv6' => '', + 'network_secondary_ipv6_prefix' => '', + 'network_secondary_ipv6_gateway' => '', + 'network_secondary_ipv6_vlan' => '', + 'network_secondary_ipv6_dns1' => '', + 'network_secondary_ipv6_dns2' => '', + ], + 'firewall' => 'disable', + 'ips' => ['', '', '', '', ''] ]; -// load existing if (file_exists($jsonFile)) { $raw = file_get_contents($jsonFile); $data = json_decode($raw, true); @@ -33,25 +52,41 @@ $errors = []; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { - // helper $get = function ($k) { return isset($_POST[$k]) ? trim((string)$_POST[$k]) : ''; }; - $primary_mode = in_array($get('primary_mode'), ['primary_static', 'primary_dhcp']) ? $get('primary_mode') : 'primary_dhcp'; - $secondary_mode = in_array($get('secondary_mode'), ['secondary_static', 'secondary_dhcp','secondary_disable']) ? $get('secondary_mode') : 'secondary_dhcp'; + $primary_mode = in_array($get('primary_mode'), ['dhcp', 'static', 'disabled']) ? $get('primary_mode') : 'dhcp'; + $primary_modev6 = in_array($get('primary_mode'), ['auto', 'dhcpv6', 'static', 'disabled']) ? $get('primary_mode') : 'auto'; + $secondary_mode = in_array($get('secondary_mode'), ['dhcp', 'static', 'disabled']) ? $get('secondary_mode') : 'dhcp'; + $secondary_modev6 = in_array($get('secondary_mode'), ['auto', 'dhcpv6', 'static', 'disabled']) ? $get('secondary_mode') : 'auto'; - $primary_ip = $get('network_primary_ip'); - $primary_subnet = $get('network_primary_subnet'); - $primary_gateway = $get('network_primary_gateway'); - $primary_vlan = $get('network_primary_vlan'); + $network_primary_ip = $get('network_primary_ip'); + $network_primary_gateway = $get('network_primary_gateway'); + $network_primary_gateway = $get('network_primary_gateway'); + $network_primary_vlan = $get('network_primary_vlan'); + $network_primary_dns1 = $get('network_primary_dns1'); + $network_primary_dns2 = $get('network_primary_dns2'); + $network_primary_ipv6 = $get('network_primary_ipv6'); + $network_primary_ipv6_prefix = $get('network_primary_ipv6_prefix'); + $network_primary_ipv6_gateway = $get('network_primary_ipv6_gateway'); + $network_primary_ipv6_vlan = $get('network_primary_ipv6_vlan'); + $network_primary_ipv6_dns1 = $get('network_primary_ipv6_dns1'); + $network_primary_ipv6_dns2 = $get('network_primary_ipv6_dns2'); - $secondary_ip = $get('network_secondary_ip'); - $secondary_subnet = $get('network_secondary_subnet'); - $secondary_gateway = $get('network_secondary_gateway'); - $secondary_vlan = $get('network_secondary_vlan'); + $network_secondary_ip = $get('network_secondary_ip'); + $network_secondary_subnet = $get('network_secondary_subnet'); + $network_secondary_gateway = $get('network_secondary_gateway'); + $network_secondary_vlan = $get('network_secondary_vlan'); + $network_secondary_dns1 = $get('network_secondary_dns1'); + $network_secondary_dns2 = $get('network_secondary_dns2'); + $network_secondary_ipv6 = $get('network_secondary_ipv6'); + $network_secondary_ipv6_prefix = $get('network_secondary_ipv6_prefix'); + $network_secondary_ipv6_gateway = $get('network_secondary_ipv6_gateway'); + $network_secondary_ipv6_vlan = $get('network_secondary_ipv6_vlan'); + $network_secondary_ipv6_dns1 = $get('network_secondary_ipv6_dns1'); + $network_secondary_ipv6_dns2 = $get('network_secondary_ipv6_dns2'); - // Validate IPs (allow empty). Subnet accepted as IP or CIDR like 192.168.1.0/24 $validate_ip_or_cidr = function ($v) { if ($v === '') return true; if (strpos($v, '/') !== false) { @@ -79,7 +114,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { } } - // VLAN numeric check (allow empty) foreach ([['Primary VLAN', $primary_vlan], ['Secondary VLAN', $secondary_vlan]] as $v) { if ($v[1] !== '' && (!ctype_digit($v[1]) || (int)$v[1] < 0 || (int)$v[1] > 4094)) { $errors[] = $v[0] . ' must be a number 0-4094'; @@ -89,19 +123,39 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { if (empty($errors)) { $new = [ 'primary' => [ - 'mode' => $primary_mode, - 'ip' => $primary_ip, - 'subnet' => $primary_subnet, - 'gateway' => $primary_gateway, - 'vlan' => $primary_vlan + 'mode' => 'dhcp', + 'modev6' => 'auto', + 'network_primary_ip' => $primary_ip, + 'network_primary_subnet' => $primary_subnet, + 'network_primary_gateway' => $primary_gateway, + 'network_primary_vlan' => $primary_vlan, + 'network_primary_dns1' => $primary_vlan, + 'network_primary_dns2' => $primary_vlan, + 'network_primary_ipv6' => $primary_vlan, + 'network_primary_ipv6_prefix' => $primary_vlan, + 'network_primary_ipv6_gateway' => $primary_vlan, + 'network_primary_ipv6_vlan' => $primary_vlan, + 'network_primary_ipv6_dns1' => $primary_vlan, + 'network_primary_ipv6_dns2' => $primary_vlan ], 'secondary' => [ - 'mode' => $secondary_mode, - 'ip' => $secondary_ip, - 'subnet' => $secondary_subnet, - 'gateway' => $secondary_gateway, - 'vlan' => $secondary_vlan - ] + 'mode' => 'disabled', + 'modev6' => 'disabled', + 'network_secondary_ip' => $secondary_ip, + 'network_secondary_subnet' => $secondary_subnet, + 'network_secondary_gateway' => $secondary_gateway, + 'network_secondary_vlan' => $secondary_vlan, + 'network_secondary_dns1' => $secondary_vlan, + 'network_secondary_dns2' => $secondary_vlan, + 'network_secondary_ipv6' => $secondary_vlan, + 'network_secondary_ipv6_prefix' => $secondary_vlan, + 'network_secondary_ipv6_gateway' => $secondary_vlan, + 'network_secondary_ipv6_vlan' => $secondary_vlan, + 'network_secondary_ipv6_dns1' => $secondary_vlan, + 'network_secondary_ipv6_dns2' => $secondary_vlan + ], + 'firewall' => 'disable', + 'ips' => ['', '', '', '', ''] ]; $json = json_encode($new, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); if (file_put_contents($jsonFile, $json, LOCK_EX) === false) { @@ -118,71 +172,210 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-
+

Primary Interface


-
- > -
- - > -
+
- +
- +
- +
- +
-
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
-

Secondary Vlan Interface


-
- > -
- - > -
- - > -
+
+
+

Vlan Secondary Interface

+
+
- +
- +
- +
- +
+
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+
+

Firewall

+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
-
-
- +
+ +
+
+
+
+
+
diff --git a/html/nginx.conf b/html/nginx.conf index 77b26e0..aadb662 100755 --- a/html/nginx.conf +++ b/html/nginx.conf @@ -21,7 +21,6 @@ rtmp { meta off; wait_video on; - push rtmp://192.168.2.45/live/live1; } } } diff --git a/html/output.php b/html/output.php index cefeb5d..b9732e6 100755 --- a/html/output.php +++ b/html/output.php @@ -4,7 +4,6 @@ $jsonFile = __DIR__ . '/output.json'; $defaults = [ - 'output' => 'display', 'video' => [ 'resolution' => '1920x1080', 'format' => 'h264_qsv', @@ -15,16 +14,21 @@ $defaults = [ 'audio' => [ 'format' => 'aac', 'sample_rate' => '48000', - 'bit_rate' => '96k' + 'bit_rate' => '96k', + 'db_gain' => '0dB' ], + 'service_display' => 'disable', 'output_display' => '1920x1080@60.00', 'output_display_audio' => '0,3', - 'rtmp_single' => '', - 'srt_single' => '', + 'service_rtmp_multiple' => 'disable', + 'service_rtmp_hls' => 'disable', + 'service_rtmp_dash' => 'disable', + 'service_srt_multiple' => 'disable', + 'service_udp' => 'disable', + 'service_custom' => 'disable', 'rtmp_multiple' => [], 'srt_multiple' => [], - 'udp_primary' => '', - 'udp_vlan' => '', + 'udp' => '', 'custom_output' => '' ]; @@ -53,9 +57,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { }; $new = $data; - - $new['output'] = $get('output', $defaults['output']); - $new['video']['resolution'] = $get('output_resolution', $defaults['video']['resolution']); $new['video']['format'] = $get('output_video_formate', $defaults['video']['format']); $new['video']['framerate'] = $get('output_video_framerate', $defaults['video']['framerate']); @@ -65,16 +66,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $new['audio']['format'] = $get('output_audio_formate', $defaults['audio']['format']); $new['audio']['sample_rate'] = $get('output_audio_sample_rate', $defaults['audio']['sample_rate']); $new['audio']['bit_rate'] = $get('output_audio_bit_rate', $defaults['audio']['bit_rate']); + $new['audio']['db_gain'] = $get('output_audio_db_gain', $defaults['audio']['db_gain']); $new['output_display'] = $get('output_display', $defaults['output_display']); $new['output_display_audio'] = $get('output_display_audio', $defaults['output_display_audio']); + $new['service_display'] = $get('service_display', $defaults['service_display']); - - $new['rtmp_single'] = $get('rtmp_single', ''); - $new['srt_single'] = $get('srt_single', ''); - - $new['udp_primary'] = $get('udp_primary', ''); - $new['udp_vlan'] = $get('udp_vlan', ''); + $new['udp'] = $get('udp', ''); $new['custom_output'] = $get('custom_output', ''); for ($i = 1; $i <= 11; $i++) { @@ -108,28 +106,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-
- -
-

Video Setting

+ +

@@ -194,9 +194,18 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
-

DISPLAY - HDMI - VGA

+

DISPLAY - HDMI - VGA - PORTS

+ + + + + +
+
+ + +
+
+ + +
+
+ > + +
+
+ +
+ +
+

SRT Output

+ + + +
+
+ + +
+
+ + +
+
+ > + +
+
+ +
+ +
+

UDP

+
- - + +
-

SRT SINGLE

+

CUSTOM OUTPUT

+
- - + +
+
-
-

RTMP MULTIPLE OUTPUT

- - -
-
- - -
-
- - -
-
- > - -
-
- +
+
- -
-

SRT MULTIPLE OUTPUT

- - -
-
- - -
-
- - -
-
- > - -
-
- -
- -
-

UDP PRIMARY INTERFACE

-
- - -
-
- -
-

UDP VLAN INTERFACE

-
- - -
-
- -
-

CUSTOM OUTPUT

-
- - -
-
- -
- -
- -
-


+


diff --git a/html/premium_service.php b/html/premium_service.php new file mode 100644 index 0000000..8d6991a --- /dev/null +++ b/html/premium_service.php @@ -0,0 +1,292 @@ + + + + + +
+ +
+
+
+
+
+
+
+
+

Why choose hosted streaming over just buying a static IP from your ISP ?

+
    +
  • DDoS & attack protection: Professional hosts run network-level DDoS mitigation and web application firewalls (WAF) that absorb and block large-scale attacks before they reach your origin server.
  • +
  • Scalable bandwidth & CDN: Hosting + CDN provides globally distributed edge points and the ability to scale to many thousands of viewers without saturating a single home/office link.
  • +
  • Higher availability & SLA: Providers operate redundant infrastructure and SLAs that keep streams online even when single links or hardware fail.
  • +
  • Managed SSL, domain & DNS: Automated SSL issuance/renewal (Let's Encrypt), DNS features and a dedicated domain remove operational friction compared to configuring services on a raw ISP IP.
  • +
  • Security isolation: Dedicated servers and hosting accounts isolate your traffic and services from other customers, reducing risks that come with shared consumer-grade network equipment.
  • +
  • Monitoring & support: 24/7 monitoring, alerting and expert support are part of hosting plans — ISPs rarely provide application-level stream support.
  • +
  • Optional reserved (static) IPs: If you still need a static IP for whitelisting, we can provision a reserved IP on a dedicated plan and keep it behind our mitigation/CDN layer.
  • +
+ +
+ Quick notes: "Unlimited data for links" refers to stream delivery (no per-GB charge on the plan level for the specified formats). Extremely large egress (multi-TB per month) or abusive usage may require a custom enterprise agreement. CDN bandwidth, archival storage and advanced security may be subject to fair-use or tiered pricing. +
+
+ Hosting : All servers are hosted with our CDN ISP partners. This project aims to transform ISPs into data-center service providers through a hybrid partnership model. All billing is handled directly by the ISP. We found this is lowest letency and stable solutions for broadcastors . Price includes GST and 2 month will be free on yearly payment . +
+
+
+ +
+ +
+
+
+
Shared Streaming
+
₹2,000 / month
+
+
+
Best for small producers
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureIncluded
Delivery formatsHLS (m3u8), RTMP, SRT, DASH — unlimited data for links
BandwidthShared pool — burst-capable (fair-usage policy)
DomainSubdomain (example.customer.example.com)
SSLLet's Encrypt (shared certificate)
SupportEmail & chat (business hours)
Uptime SLA99.5%
+ + + +
+ + + +
+
+
+
Dedicated Streaming
+
₹4,000 / month
+
+
+
Recommended for events & scale
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureIncluded
Delivery formatsHLS (m3u8), RTMP, SRT, DASH — unlimited data for links
BandwidthDedicated bandwidth allocation (higher sustained throughput up to 10gbe spike )
DomainDedicated domain included (example: yourbrand.live)
SSLFree SSL certificate (Let's Encrypt) + automated renewals
DDoS / Attack protectionNetwork-level mitigation & WAF
Static IPDedicated ip ipv4 and ipv6 available (reserved IP) — useful for whitelisting
Uptime SLA99.9% with priority support
Support24/7 priority support & onboarding
+ + + +
+
+
+
+
+
+
Need an exportable copy of this pricing page or custom branding? Contact sales for a tailored quote and SLA.
+
+
+ + \ No newline at end of file diff --git a/html/request_cert.php b/html/request_cert.php new file mode 100644 index 0000000..b79a6e5 --- /dev/null +++ b/html/request_cert.php @@ -0,0 +1,131 @@ + + (function(){ + var msg = $msg; + var dest = $page; + + // Run after DOM to avoid errors when printed inside + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', function(){ + alert(msg); + window.location.href = dest; + }); + } else { + alert(msg); + window.location.href = dest; + } + })(); + "; + exit; +} + +// Read POST values +$domain = trim($_POST['domain'] ?? ''); +$subdomains_raw = trim($_POST['subdomains'] ?? ''); +$email = trim($_POST['email'] ?? ''); +$staging = ($_POST['staging'] ?? "0") === "1" ? 1 : 0; + +// Validation helpers +function valid_domain_name($d) { + return (bool) preg_match( + '/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/i', + $d + ); +} + +// Validate domain +if ($domain === '' || !valid_domain_name($domain)) { + alert_and_back("Invalid domain name."); +} + +// Validate email +if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + alert_and_back("Invalid email address."); +} + +// Process subdomains +$subdomains = []; +if ($subdomains_raw !== '') { + $parts = preg_split('/[,\s;]+/', $subdomains_raw, -1, PREG_SPLIT_NO_EMPTY); + + foreach ($parts as $p) { + $p = trim($p); + if ($p === '') continue; + + // If user only entered "www", convert -> www.domain.com + if (strpos($p, '.') === FALSE) { + $candidate = "$p.$domain"; + } else { + $candidate = $p; + } + + if (!valid_domain_name($candidate)) { + alert_and_back("Invalid subdomain: $p"); + } + + $subdomains[] = $candidate; + } +} + +// Merge primary domain + subdomains +$domains = array_values(array_unique(array_merge([$domain], $subdomains))); + +// Build Certbot -d parameters +$dargs = ""; +foreach ($domains as $d) { + $dargs .= " -d " . escapeshellarg($d); +} + +// Build certbot command +$certbot = "/usr/bin/certbot"; +$cmd = "sudo $certbot --nginx --agree-tos --non-interactive --email " + . escapeshellarg($email) + . " $dargs"; + +if ($staging === 1) { + $cmd .= " --staging"; +} + +// Run certbot +exec("$cmd 2>&1", $out, $rc); + +if ($rc !== 0) { + alert_and_back("Certbot failed:\n" . implode("\n", $out)); +} + +// Test nginx +exec("sudo nginx -t 2>&1", $test_out, $test_rc); + +if ($test_rc !== 0) { + alert_and_back("Certificate created, but nginx test failed:\n" . implode("\n", $test_out)); +} + +// Reload nginx +exec("sudo systemctl reload nginx 2>&1", $reload_out, $reload_rc); + +if ($reload_rc !== 0) { + alert_and_back("Cert created, nginx tested OK, but reload failed:\n" . implode("\n", $reload_out)); +} + +// Success +alert_and_back("Certificate installed successfully for:\n" . implode(", ", $domains)); + +?> diff --git a/html/static.php b/html/static.php index d4d81bb..2c18d06 100755 --- a/html/static.php +++ b/html/static.php @@ -89,7 +89,7 @@ function update_service() $restart_cmd = 'sudo /bin/systemctl reload nginx'; - $input = "ffmpeg "; + $input = ""; $input_link = ""; $input_source = ""; $input_rtmp_port = ""; @@ -142,19 +142,17 @@ function update_service() switch ($input_source) { case "hdmi": - $input .= "-f v4l2 -input_format mjpeg -framerate " . $data['hdmi']['framerate'] . " -video_size " . $data['hdmi']['resolution'] . " -i /dev/video0 -f alsa -i " . $data['hdmi']['audio_source']; + $input = "ffmpeg -thread_queue_size 512 -f v4l2 -input_format mjpeg -framerate " . $data['hdmi']['framerate'] . " -video_size " . $data['hdmi']['resolution'] . " -i /dev/video0 " . + "-f alsa -i " . $data['hdmi']['audio_source'] . ' -init_hw_device qsv=hw:/dev/dri/renderD128 -filter_hw_device hw -fflags +genpts -use_wallclock_as_timestamps 1 -vf "format=nv12,hwupload=extra_hw_frames=64,format=qsv" -c:v h264_qsv'; break; case "url": - $input .= "-stream_loop -1 -re -i " . $data['url']; - $input_link = $data['url']; + $input .= "ffmpeg -stream_loop -1 -re -i " . $data['url']; break; case "rtmp": $input .= "-stream_loop -1 -re -i rtmp://127.0.0.1:" . $data['rtmp']['port'] . "/" . $data['rtmp']['mount'] . "/" . $data['rtmp']['password']; - $input_link = "rtmp://127.0.0.1:" . $data['rtmp']['port'] . "/" . $data['rtmp']['mount'] . "/" . $data['rtmp']['password']; break; case "srt": $input .= "-stream_loop -1 -re -i srt://127.0.0.1:" . $data['srt']['port'] . "/" . $data['srt']['stream_id_1'] . "/" . $data['srt']['stream_id_2'] . "/" . $data['srt']['stream_id_3']; - $input_link = "srt://127.0.0.1:" . $data['srt']['port'] . "/" . $data['srt']['stream_id_1'] . "/" . $data['srt']['stream_id_2'] . "/" . $data['srt']['stream_id_3']; $input_port_srt = $data['srt']['port']; break; } @@ -203,18 +201,23 @@ function update_service() $rtmp_multiple = $data['rtmp_multiple']; $srt_multiple = $data['srt_multiple']; - $output = $data['output']; + $input .= ' -b:v ' . $data['video']['data_rate'] . ' -maxrate ' . $data['video']['data_rate'] . ' -bufsize 10M -g ' . $data['video']['gop'] .' -af "aresample=async=1:first_pts=0" '. + ' -c:a ' . $data['audio']['format'] . ' -ar ' . $data['audio']['sample_rate'] . ' -b:a ' . $data['audio']['bit_rate'] . ' -vsync 1 -copytb 1 -f mpegts udp://239.255.255.254:39000?localaddr=127.0.0.1'; + + $service = $input; + $file = "/var/www/main-encoder.sh"; + if (file_put_contents($file, $service) !== false) { + echo "File saved."; + } else { + echo "Error writing file."; + } switch ($data['output']) { case "display": - if ($input_source === "hdmi") { - echo ""; - } else { - $output_display_audio = $data['output_display_audio']; - $input = "mpv --fs --loop --hwdec=auto --audio-device=alsa/plughw:" . $output_display_audio . " " . $input_link; - } + $output_display_audio = $data['output_display_audio']; + $input = "mpv --fs --loop --hwdec=auto --audio-device=alsa/plughw:" . $output_display_audio . " udp://239.255.255.254:39000"; break; case "rtmp_single": $input .= '-vf "scale=' . $data['video']['resolution'] . '" -c:v ' . $data['video']['format'] . ' -b:v ' . $data['video']['data_rate'] @@ -247,14 +250,6 @@ function update_service() break; } - $service = $input; - $file = "/var/www/html/main-encoder.sh"; - if (file_put_contents($file, $service) !== false) { - echo "File saved."; - } else { - echo "Error writing file."; - } - if (empty($input_rtmp_port)) $input_rtmp_port = "1935"; diff --git a/html/status.php b/html/status.php new file mode 100644 index 0000000..f9d06cd --- /dev/null +++ b/html/status.php @@ -0,0 +1,12 @@ + + +
+
+
+
+
+
+ +
+
+ \ No newline at end of file