To convert jpg to avi this code works perfect on my server

shell_exec("ffmpeg -f image2 -r 1/10 -i image.png out.avi");

I need to convert jpg/png images to mp4/mpeg.

How do I do this?


1 Answer 1

ffmpeg -loop 1 -f image2 -i img.png -t 1 out.mp4

This will create 1 second video. If you need longer increase the 'loop' value.

  • I think you meant to say, "...increase the -t value". The -f image2 is superfluous when using a standard input file name. The H.264 output from your example will not be playable in non-FFmpeg based players unless you add -pix_fmt yuv420p.
    – llogan
    Apr 8, 2016 at 6:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .