OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
videoTest
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📄
HDB1.jpg
288.5 KB
01/22/2025 08:08:28 AM
rw-r--r--
📄
generate_video.php
2.42 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
generate_video_test1.php
2.07 KB
05/19/2025 10:07:17 AM
rw-r--r--
📄
index.php
576 bytes
05/19/2025 10:07:17 AM
rw-r--r--
📁
output
-
01/22/2025 11:21:13 AM
rwxrwxrwx
Editing: generate_video_test1.php
Close
<?php // Check if the form is submitted if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_FILES['image'])) { $image = $_FILES['image']['tmp_name']; // Path to the uploaded image $imageName = $_FILES['image']['name']; // Get the original name of the uploaded image // Check if the uploaded file is a valid image $validExtensions = ['jpg', 'jpeg', 'png', 'gif']; $fileExtension = strtolower(pathinfo($imageName, PATHINFO_EXTENSION)); if (!in_array($fileExtension, $validExtensions)) { die("Only image files (jpg, jpeg, png, gif) are allowed."); } // Define the output video file path $outputVideo = 'output/output_video.mp4'; // Name of the output video // Check if FFmpeg is installed $ffmpegCheck = shell_exec('which ffmpeg'); if (empty($ffmpegCheck)) { die("FFmpeg is not installed or not found in the system path."); } // Set the zoom effect parameters $ffmpegPath = escapeshellcmd('ffmpeg'); // Ensure output file can be written $outputVideoPath = escapeshellarg($outputVideo); $zoomDuration = 10; // Prepare the FFmpeg command to resize the image, apply the zoom effect, and set pixel format // $cmd = "$ffmpegPath -loop 1 -t $zoomDuration -i " . escapeshellarg($image) . " -vf \"scale=1280x720,zoompan=z='min(zoom+0.005,1.5)':d=25\" -c:v libx264 -pix_fmt yuv420p -loglevel debug -y $outputVideoPath"; $cmd = "$ffmpegPath -t $zoomDuration -i " . escapeshellarg($image) . " -vf \"scale=1280x720,zoompan=z='min(zoom+0.01,1.5)':d=25\" -c:v libx264 -pix_fmt yuv420p -r 30 -y $outputVideoPath"; // Execute the FFmpeg command exec($cmd . " 2>&1", $output, $return_var); if ($return_var === 0) { echo "<h3>Video generated successfully!</h3>"; echo "<p><a href='$outputVideo' download>Click here to download the video</a></p>"; } else { echo "<h3>Error generating video. Please try again.</h3>"; echo "<pre>" . implode("\n", $output) . "</pre>"; } } else { echo "<h3>No image uploaded.</h3>"; } ?>