我正在使用FTP上传视频,我正在做的是点击第一帧视频截图, 但是它发生的确切情况是截图变得模糊,显然如果第一帧会模糊,最终截图将只是模糊。
我可以用其他方式点击稳定的图片吗? 这是我的FTP代码,我点击截图(缩略图)。
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
if(isset($_FILES["file"]["name"]) && $_FILES["file"]["name"] != ''){
$newfilename = $_FILES["file"]["name"];
$upload = move_uploaded_file($_FILES["file"]["tmp_name"], "/home/projectname/public_html/master/assets/user_videos/".$newfilename);
if($upload){
$thumbnail_name = preg_replace('"\.(mp4|avi|flv|vob|oggg)$"', '.jpg', $newfilename);
$movie = "/home/projectname/public_html/master/assets/user_videos/".$newfilename;
$thumbnail = "/home/projectname/public_html/master/assets/user_videos/".$thumbnail_name;
$command = '/usr/bin/ffmpeg -ss 00:00:01 -i '.$movie.' -f image2 -vframes 1 '.$thumbnail.' 2>&1';
$output = passthru($command);
$data = array('status' => 1 , 'video'=> $newfilename, 'screenshot'=> $thumbnail_name, 'message' => 'Video successfully uploaded' );
}