FFMPEG - 用于动画的Palettegen不起作用

I have a script taken from the correct answer at https://superuser.com/questions/1002562/convert-multiple-images-to-a-gif-with-cross-dissolve, but I am getting no results.

Even copying the code word for word does not work for me.

However, if I run $ffmpeg = shell_exec("ffmpeg -i images/image001.jpg -vf palettegen palette_test.png"); on a single image, it works fine. But because I need it for an animation, I need to create a pallete for all images.

Unless of course, on each image in the GIF sequence I can load a new palette?

$q = "ffmpeg -f image2 -framerate 0.5 -i ../view/client/files/".$dir."/%*.jpg -i palettePro.png -lavfi paletteuse -y .." . $save_path . '/' . $filename . " -report";

Palettegen can analyze and generate a matching frame sequence with per-frame palette.

ffmpeg -i images/image%03d.jpg -vf palettegen=stats_mode=single palette_%03d.png

And then

ffmpeg -framerate 0.5 -i images/image%03d.jpg -framerate 0.5 -i palette_%03d.png -lavfi paletteuse=new=1 -y $filename