[ 'resolution' => '1920x1080', 'format' => 'h264_qsv', 'framerate' => '25', 'data_rate' => '3.3M', 'gop' => '12' ], 'audio' => [ 'format' => 'aac', 'sample_rate' => '48000', 'bit_rate' => '96k', 'db_gain' => '0dB' ], 'service_display' => 'disable', 'output_display' => '1920x1080@60.00', 'output_display_audio' => '0,3', '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' => '', 'custom_output' => '' ]; for ($i = 1; $i <= 11; $i++) { $defaults['rtmp_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false]; $defaults['srt_multiple'][$i] = ['url' => '', 'name' => '', 'enabled' => false]; } if (file_exists($jsonFile)) { $raw = file_get_contents($jsonFile); $data = json_decode($raw, true); if (!is_array($data)) $data = $defaults; $data = array_replace_recursive($defaults, $data); } else { $data = $defaults; } $errors = []; $success = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $get = function ($k, $d = '') { return isset($_POST[$k]) ? trim((string)$_POST[$k]) : $d; }; $new = $data; $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']); $new['video']['data_rate'] = $get('output_data_rate', $defaults['video']['data_rate']); $new['video']['gop'] = $get('output_gop', $defaults['video']['gop']); $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['service_rtmp_multiple'] = $get('service_rtmp_multiple', $defaults['service_rtmp_multiple']); $new['service_rtmp_hls'] = $get('service_rtmp_hls', $defaults['service_rtmp_hls']); $new['service_rtmp_dash'] = $get('service_rtmp_dash', $defaults['service_rtmp_dash']); $new['service_srt_multiple'] = $get('service_srt_multiple', $defaults['service_srt_multiple']); $new['service_display'] = $get('service_display', $defaults['service_display']); $new['service_custom'] = $get('service_custom', $defaults['service_custom']); $new['udp'] = $get('udp', ''); $new['custom_output'] = $get('custom_output', ''); for ($i = 1; $i <= 11; $i++) { $u = $get("rtmp_{$i}", ''); $n = $get("rtmp_{$i}_name", ''); $e = isset($_POST["rtmp_{$i}_enable"]) ? true : false; $new['rtmp_multiple'][$i] = ['url' => $u, 'name' => $n, 'enabled' => $e]; $u2 = $get("srt_{$i}", ''); $n2 = $get("srt_{$i}_name", ''); $e2 = isset($_POST["srt_{$i}_enable"]) ? true : false; $new['srt_multiple'][$i] = ['url' => $u2, 'name' => $n2, 'enabled' => $e2]; } if ($new['video']['gop'] !== '' && !ctype_digit((string)$new['video']['gop'])) { $errors[] = "GOP must be an integer."; } if (empty($errors)) { $json = json_encode($new, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); if (file_put_contents($jsonFile, $json, LOCK_EX) === false) { $errors[] = "Failed to write {$jsonFile}. Check permissions."; } else { $data = $new; $success = "Saved."; } } if (isset($_POST['display'])) { update_service("display"); } if (isset($_POST['rtmp'])) { update_service("rtmp"); } if (isset($_POST['srt'])) { update_service("srt"); } if (isset($_POST['udo'])) { update_service("udo"); } if (isset($_POST['custom'])) { update_service("custom"); } } ?>

Video Setting

Audio Setting

DISPLAY - HDMI - VGA - PORTS

RTMP Output

>

SRT Output

>

UDP

CUSTOM OUTPUT




'; foreach ($errors as $e) echo '
' . htmlspecialchars($e) . '
'; echo '
'; } if ($success) { echo '
' . htmlspecialchars($success) . '
'; } ?>