gpt4 book ai didi

php - FFMPEG 不创建缩略图

转载 作者:行者123 更新时间:2023-12-04 23:09:18 28 4
gpt4 key购买 nike

我在 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/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com