'h264', 'audio_format' => 'mp3', 'video_bitrate' => '1000k', 'audio_bitrate' => '128k', 'resolution' => '1280x720', 'frame_rate' => '30', 'gop' => '30', ]; // Initialize settings from JSON file or use defaults if (file_exists($settings_file)) { $settings_json = file_get_contents($settings_file); $settings = json_decode($settings_json, true); // Merge with defaults if any keys are missing foreach ($default_settings as $key => $value) { if (!isset($settings[$key])) { $settings[$key] = $value; } } } else { $settings = $default_settings; } // Handle form submission $message = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { // Validate video format $allowed_video_formats = ['mpeg2', 'h264', 'h265', 'vp9', 'av1']; if (isset($_POST['video_format']) && in_array($_POST['video_format'], $allowed_video_formats)) { $settings['video_format'] = $_POST['video_format']; } // Validate audio format $allowed_audio_formats = ['mp2', 'mp3', 'aac']; if (isset($_POST['audio_format']) && in_array($_POST['audio_format'], $allowed_audio_formats)) { $settings['audio_format'] = $_POST['audio_format']; } // Update other settings $settings['video_bitrate'] = $_POST['video_bitrate'] ?? $settings['video_bitrate']; $settings['audio_bitrate'] = $_POST['audio_bitrate'] ?? $settings['audio_bitrate']; $settings['resolution'] = $_POST['resolution'] ?? $settings['resolution']; $settings['frame_rate'] = $_POST['frame_rate'] ?? $settings['frame_rate']; $settings['gop'] = $_POST['gop'] ?? $settings['gop']; // Handle logo upload if (isset($_FILES['logo']) && $_FILES['logo']['error'] === UPLOAD_ERR_OK) { // Check if GD library is available if (!extension_loaded('gd')) { $message = "GD library not available for image processing!"; } else { $allowed_types = ['image/png']; $file_type = mime_content_type($_FILES['logo']['tmp_name']); if (in_array($file_type, $allowed_types)) { // Move uploaded file $target_path = $logo_file; if (move_uploaded_file($_FILES['logo']['tmp_name'], $target_path)) { // Process image with GD library to make it square $image = imagecreatefrompng($target_path); if ($image !== false) { $width = imagesx($image); $height = imagesy($image); // Calculate square dimensions (use smaller dimension) $size = min($width, $height); // Create square canvas $square = imagecreatetruecolor(128, 128); // Fill with transparent background $transparent = imagecolorallocatealpha($square, 0, 0, 0, 127); imagefill($square, 0, 0, $transparent); // Calculate position to center the image $x = ($width - $size) / 2; $y = ($height - $size) / 2; // Copy and resize to square imagecopyresampled($square, $image, 0, 0, $x, $y, 128, 128, $size, $size); // Save the processed image imagepng($square, $target_path); // Free memory imagedestroy($image); imagedestroy($square); $message = "Logo uploaded and processed successfully!"; } else { $message = "Error processing image with GD library!"; } } else { $message = "Error uploading logo!"; } } else { $message = "Only PNG images are allowed!"; } } } // Handle logo removal if (isset($_POST['remove_logo']) && $_POST['remove_logo'] == '1') { if (file_exists($logo_file)) { unlink($logo_file); $message = "Logo removed successfully!"; } } // Save settings to JSON file $settings_json = json_encode($settings, JSON_PRETTY_PRINT); if (file_put_contents($settings_file, $settings_json) !== false) { $message .= " Settings saved successfully!"; } else { $message = "Error saving settings!"; } } // Save settings to session as backup $_SESSION['settings'] = $settings; ?> Video Settings

Video Settings

Configure your video processing parameters

Current Settings: Video: | Audio:

Logo Management


Logo Preview

Format Restrictions

Video format is limited to: MPEG-2, H.264, H.265, VP9, and AV1

Audio format is limited to: MP2, MP3, and AAC