我有一个取自 https://superuser.com/questions/1002562/convert-multiple-images-to-a-gif-with-cross-dissolve 正确答案的脚本,但我没有得到任何结果。
即使逐字复制代码对我也不起作用。
但是,如果我运行 $ffmpeg = shell_exec("ffmpeg -i images/image001.jpg -vf palettegen palette_test.png");
在单个图像上,它工作正常。但是因为我需要它来制作动画,所以我需要为所有图像创建一个调色板。
当然,除非在 GIF 序列中的每个图像上我都可以加载一个新的调色板?
$q = "ffmpeg -f image2 -framerate 0.5 -i ../view/client/files/".$dir."/%*.jpg -i palettePro.png -lavfi paletteuse -y .." . $save_path . '/' . $filename . " -report";
最佳答案
Palettegen 可以使用每帧调色板分析和生成匹配的帧序列。
ffmpeg -i images/image%03d.jpg -vf palettegen=stats_mode=single palette_%03d.png
接着
ffmpeg -framerate 0.5 -i images/image%03d.jpg -framerate 0.5 -i palette_%03d.png -lavfi paletteuse=new=1 -y $filename
关于php - FFMPEG - 用于动画的 Palettegen 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51383366/