4

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.

Rahul Chokshi
  • 670
  • 4
  • 18
Ranjithkumar
  • 16,071
  • 12
  • 120
  • 159
  • Look into [This](https://stackoverflow.com/questions/31073336/how-to-combine-images-and-generate-a-mp4-file) if you already not . – ADM Nov 13 '17 at 11:38
  • @ADM thanks. I will check – Ranjithkumar Nov 13 '17 at 11:41
  • 1
    Is it not suitable just to draw the image on the surface or even literally switch to an imageview temporarily. Do you definitely want to create a video for this? – Nick Cardoso Aug 17 '18 at 12:09

2 Answers2

6

Basic syntax is

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

The -t option sets the time, in seconds.

Gyan
  • 85,394
  • 9
  • 169
  • 201
-1

You can always use any video edit like windows movie maker. Just add the photo to a project change the duration to 20 seconds and export And then you have a 20 second video file of one image

Saxo_Broko
  • 378
  • 2
  • 15