PHP 大文件重名复制 0007 - 9999排序名称
- 获取本地图片更换重命名
- FFmpeg 合并图片
<?php
$dit = scandir("gif/");//扫描文件
unset($dit[0]);
unset($dit[1]);
//image-%3d.jpeg
foreach ($dit as $key => $value) {
$vas = fopen("gif/".$value, "r"); //读取文件
$str = strlen($key);//获取当期需要创建的文件长度
$st = str_repeat("0", 4-$str);
// echo ; echo "<br>";
$sss = $st.$key;
$c = fopen("temp/image-{$sss}.jpeg", 'w+'); //创建文件
stream_copy_to_stream($vas, $c); //复制
fclose($vas); //清除
fclose($c);
}
ffmpeg -threads 2 -y -r 15 -i A:\php\apache\htdocs\temp\temp\image-%4d.jpeg -vcodec libx264 C:\Users\理解\Desktop\out.mp4
?>