PHP Is it possible to create a video (any format) from a list of images using PHP?

I want to create a simple video slideshow using a list of images that I automatically use PHP. Is there some kind of library that allows you to create video in PHP (for example, the PHP-GD library, but for video)? If it does not exist in PHP, which language will make it easy to create videos from images?

Also, if there was a way to incorporate sound into the video, it would be even better. Thank!

+3
source share
2 answers

This PHP Video Tool can help.

+1
source

You can invoke the ffmpeg command line using PHP.

https://www.ffmpeg.org/download.html

, - 5

ffmpeg -framerate 20 \
-loop 1 -t 0.5 -i 1.jpg \
-loop 1 -t 0.5 -i 2.jpg \
-loop 1 -t 0.5 -i 3.jpg \
-loop 1 -t 0.5 -i 4.jpg \
-c:v libx264 \
-filter_complex " \
[1:v][0:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b1v]; \
[2:v][1:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b2v]; \
[3:v][2:v]blend=all_expr='A*(if(gte(T,0.5),1,T/0.5))+B*(1-(if(gte(T,0.5),1,T/0.5)))'[b3v]; \
[0:v][b1v][1:v][b2v][2:v][b3v][3:v]concat=n=7:v=1:a=0,format=yuv420p[v]" -map "[v]" out.mp4

ffmpeg memo

0

Source: https://habr.com/ru/post/1779136/


All Articles