OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
videoAII
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
22-01-25index.php
6.03 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
audio
-
01/22/2025 10:53:48 AM
rwxrwxrwx
📄
export.php
7.04 KB
05/19/2025 10:07:22 AM
rw-r--r--
📁
files
-
01/22/2025 05:04:49 AM
rwxrwxrwx
📄
index.php
6.26 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
script.js
7.77 KB
01/22/2025 05:33:18 AM
rw-r--r--
📄
styles.css
1.01 KB
01/22/2025 05:05:09 AM
rw-r--r--
📄
test.php
7.58 KB
05/19/2025 10:07:22 AM
rwxrwxrwx
📁
testing
-
05/19/2025 10:07:22 AM
rwxr-xr-x
📁
uploads
-
01/22/2025 10:13:10 AM
rwxrwxrwx
📄
video_process.php
11.27 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zexport.php
3.56 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zindex.php
4.48 KB
05/19/2025 10:07:22 AM
rw-r--r--
📄
zscript.js
5.78 KB
01/22/2025 05:05:09 AM
rw-r--r--
Editing: test.php
Close
<?php ob_start(); function sendJsonError($message) { ob_clean(); header('Content-Type: application/json'); echo json_encode(['success' => false, 'message' => $message]); exit; } try { if ($_SERVER['REQUEST_METHOD'] === 'POST') { header('Content-Type: application/json'); if (!isset($_FILES['image'])) { sendJsonError('No image file uploaded'); } $image = $_FILES['image']; if ($image['error'] !== UPLOAD_ERR_OK) { sendJsonError('File upload error: ' . $image['error']); } // Create uploads directory if it doesn't exist $uploadDir = 'uploads/'; if (!is_dir($uploadDir)) { if (!mkdir($uploadDir, 0777, true)) { sendJsonError('Failed to create uploads directory'); } } // Generate unique filenames $uniqueId = uniqid(); $imagePath = $uploadDir . $uniqueId . '_' . basename($image['name']); $videoPath = $uploadDir . $uniqueId . '_video.mp4'; // Move uploaded file if (!move_uploaded_file($image['tmp_name'], $imagePath)) { sendJsonError('Failed to move uploaded file'); } // Check if FFmpeg is installed exec('ffmpeg -version', $output, $returnCode); if ($returnCode !== 0) { sendJsonError('FFmpeg is not installed'); } // First, scale down the image to a more manageable size $scaledImagePath = $uploadDir . $uniqueId . '_scaled.png'; $scaleCmd = sprintf( 'ffmpeg -i %s -vf "scale=1280:720:force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2:color=white" %s', escapeshellarg($imagePath), escapeshellarg($scaledImagePath) ); shell_exec($scaleCmd); if (!file_exists($scaledImagePath)) { sendJsonError('Failed to scale image'); } // Now create the zoom effect with the scaled image $duration = 5; $fps = 30; $ffmpegCmd = sprintf( 'ffmpeg -loop 1 -framerate %d -t %d -i %s '. '-vf "zoompan=z=\'if(lte(time,0.5),1,min(zoom+0.002,1.5))\':'. 'x=\'iw/2-(iw/zoom/2)\':y=\'ih/2-(ih/zoom/2)\':d=%d:s=1280x720" '. '-c:v libx264 -pix_fmt yuv420p -preset ultrafast -crf 23 %s', $fps, $duration, escapeshellarg($scaledImagePath), $duration * $fps, escapeshellarg($videoPath) ); // Execute FFmpeg $output = shell_exec($ffmpegCmd); // Clean up the scaled image if (file_exists($scaledImagePath)) { unlink($scaledImagePath); } // Check if video was created successfully if (!file_exists($videoPath) || filesize($videoPath) === 0) { sendJsonError('Failed to create video. FFmpeg output: ' . $output); } // Success response ob_clean(); echo json_encode([ 'success' => true, 'videoUrl' => $videoPath, 'message' => 'Video created successfully' ]); exit; } } catch (Exception $e) { sendJsonError('Server error: ' . $e->getMessage()); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Image to Zoom Video</title> <style> body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; } .upload-container { border: 2px dashed #ccc; padding: 20px; text-align: center; margin: 20px 0; border-radius: 8px; } #status-message { margin: 10px 0; padding: 10px; border-radius: 4px; } .error { color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 10px; border-radius: 4px; } .success { color: #155724; background-color: #d4edda; border: 1px solid #c3e6cb; padding: 10px; border-radius: 4px; } #loading { margin: 10px 0; padding: 10px; background-color: #e2e3e5; border-radius: 4px; } button { background-color: #007bff; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; } button:hover { background-color: #0056b3; } </style> </head> <body> <h2>Image to Zoom Video Converter</h2> <div class="upload-container"> <form id="uploadForm"> <input type="file" name="image" accept="image/*" required> <br><br> <button type="submit">Create Zoom Video</button> </form> <div id="status-message"></div> <div id="loading" style="display: none;"> Processing... Please wait... </div> </div> <div id="video-container" style="display: none;"> <h3>Generated Video:</h3> <video id="output-video" controls width="100%"> Your browser does not support the video tag. </video> </div> <script> document.getElementById('uploadForm').addEventListener('submit', async function(e) { e.preventDefault(); const statusMessage = document.getElementById('status-message'); const loading = document.getElementById('loading'); const videoContainer = document.getElementById('video-container'); const outputVideo = document.getElementById('output-video'); // Clear previous status statusMessage.textContent = ''; statusMessage.className = ''; loading.style.display = 'block'; videoContainer.style.display = 'none'; try { const formData = new FormData(this); const response = await fetch(window.location.href, { method: 'POST', body: formData }); const contentType = response.headers.get('content-type'); if (!contentType || !contentType.includes('application/json')) { throw new Error('Server response was not JSON'); } const data = await response.json(); if (data.success) { statusMessage.textContent = 'Video created successfully!'; statusMessage.className = 'success'; videoContainer.style.display = 'block'; outputVideo.src = data.videoUrl + '?t=' + new Date().getTime(); // Prevent caching outputVideo.load(); } else { statusMessage.textContent = 'Error: ' + data.message; statusMessage.className = 'error'; } } catch (error) { statusMessage.textContent = 'Error: ' + error.message; statusMessage.className = 'error'; } finally { loading.style.display = 'none'; } }); </script> </body> </html>