Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert a single Image to MP4 Video?

Tags:

android

ffmpeg

How to convert a single image to mp4 video.

For example, I need to play the same image for 20 seconds (duration will be dynamic)

I know it's possible with ffmpeg. I searched in google & SO but unfortunately, I am not able to find the correct tutorial.

I just want a correct direction.

Any comment or suggestion is welcome.

like image 280
Ranjithkumar Avatar asked Oct 27 '25 03:10

Ranjithkumar


1 Answers

Basic syntax is

ffmpeg -loop 1 -i image -pix_fmt yuv420p -t 20 out.mp4

The -t option sets the time, in seconds.

like image 122
Gyan Avatar answered Oct 28 '25 17:10

Gyan