Hello. There was a task to create a Gif'ku on the server from ordinary images (jpg). The task was solved using the GD php library, but after that I pushed myself with the problem of displaying gifok on apple-like devices and, as it seems to me, the only way out is to create either from a ready-made gif, or from frames, from which a gif was created, so that instead of a gif show this video to the user. How can this be implemented in PHP?

    1 answer 1

    We put ffmpeg on the server

    and write the following code

     <?php // ниже может быть любая команда на подобие exec, shell_exec и д.р. // да и в команду лучше вставить абсолютные пути system('ffmpeg -i animation.gif -s 420x300 animation.avi'); if(file_exist('animation.avi') { // проверяем фаил есть значит безошибок // хотя лучше взять вывод систем и проанализировать его на предмет корректной отработки echo "gif converted"; }