ffmpeg测试

            //视频截图测试
// $outPath = rtrim($relativeFilePath, '.mp4');
// $outPath = $outPath . '_a.jpg';
// $shell = "ffmpeg -i " . $filePath . " -ss 1 -y -frames:v 1 -q:v 1 " . $outPath . " 2>&1";
// exec($shell, $output, $ret);
// var_dump($output);exit;
//return $res;

// $outPath = rtrim($filePath, '.mp4');
// $outPath = $outPath . '_a.jpg';
// var_dump($outPath);
// //ffmpeg -i RevolutionOS.rmvb sample.jpg -ss 00:00:05 -r 1 -vframes 1 -an -vcodec mjpeg
// $shell = "ffmpeg -i " . $filePath ." $outPath " ." 00:00:05 -r 1 -vframes 1 -an -vcodec mjpeg";
// exec($shell, $output, $ret);
// var_dump($filePath, $output, $ret);exit;

// $p = 'uploads/videos/a.mp4';
// if(!file_exists($p)){
// var_dump('不存在');exit;
// }else{
// $mypath = $path.'uploads\videos';
// var_dump('存在', $mypath.'\a.mp4');
// if(file_exists($mypath.'\a.mp4')){
// echo '视频在';
// }else{
// echo '视频不在';
// }
// $imgPath = $mypath."\a.jpg";
// }

// $shell = 'D:\xampp\ffmpeg\bin'.'\ffmpeg -i '.$mypath.'\a.mp4 '.$imgPath.' -ss 00:00:50 -r 1 -vframes 1 -an -f mjpeg';//vcodec
// var_dump($shell);
// exec($shell);

// $cmd='D:\xampp\ffmpeg\bin'.'\ffmpeg.exe -i '.$mypath.'\a.mp4 -f image2 -ss 15 -s 400*300 -vframes 1 '.$imgPath;
// exec($cmd);
// var_dump($cmd);
//exit;

posted on 2023-04-23 16:19  andydaopeng  阅读(43)  评论(0编辑  收藏  举报

导航