ffmpeg convert image to mpeg/mp4

0

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?

user2033138

Posted 2016-04-07T09:07:32.020

Reputation: 1

Answers

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.

Amit

Posted 2016-04-07T09:07:32.020

Reputation: 109

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 – 2016-04-08T06:27:09.810