作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 php 中的 ffmpeg 命令是
echo $cmd_thumbnail_create = ("\"$ffmpeg\" -i \"" . $dir.$videopath . "\" -an -ss $getFromSecond \"" . $dir.$thumbnailpath ."\"");
exec($cmd_thumbnail_create);
"C:\FFMPEG\bin\ffmpeg" -i "C:/xampp/htdocs/final/uploaded_videos/intro_en.mp4" -an -ss 6 "C:/xampp/htdocs/final/thumbnail/intro_en.jpg"
最佳答案
这对我有用...
首先....找到您通往 FFMPEG 的路径
我的是
$ffmpeg = "H:\\SERVr\\htdocs\\ffmpeg\\bin\\ffmpeg";
然后.. 在你的 shell_exec 中...shell_exec("$ffmpeg -i your-input.jpg -an -ss 30 -s 120x100 your-output.jpg 2>&1");
-i 是您的输入文件。
-ss 是您希望从中提取剪辑的视频时间。
-s 是你想要的缩略图的大小
这适用于我的带有 XAMPP 的 Windows 机器,并且运行良好。
关于php - FFMPEG 不创建缩略图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24781282/
我是一名优秀的程序员,十分优秀!