FFMPEG Command to Create a Video From a Single Image For a Specific Duration in Terminal
14 views
Jun 3, 2025
ffmpeg -loop 1 -i image.png -c:v libx264 -t 15 -pix_fmt yuv420p -vf scale=320:240 out.mp4
View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
So in this video I will show you a
0:04
ffmppg command which will be able to
0:06
create a MP4 video from a single image
0:10
So we are taking a simple example right
0:12
here If you see we have a PNG image file
0:15
which is present in our directory So
0:17
what I need to do is that I need to
0:19
convert this into a a video file For a
0:21
certain duration this image will appear
0:24
in the
0:25
video So I will show you a simple fmpp
0:29
command So it's a simple PNG image If
0:31
you see if I open this So from this we
0:34
can create a video directly Just open
0:36
your command line Just type this command
0:40
fmpp loop dash loop and then we need to
0:45
write one and dash i and then the
0:49
followed by the name of the image file
0:51
So which will be image do.png After that
0:54
we just need to provide the encoding
0:56
settings from this - c col v and lib
1:01
x264 So we are providing the encoder
1:04
right here which is lib
1:06
x264 and after that we just need to put
1:08
the time interval what is the length of
1:11
the video So we are just putting right
1:13
here
1:13
15c So this image will appear for 15
1:17
seconds and then here we provide dash
1:23
pix fmt and then we have providing
1:27
another encoder which is y uv
1:31
420p which will be the quality and
1:34
-ashvf and then we will scale
1:38
this scale is equal to and 320
1:42
by 420 So we are just providing the
1:45
resolution of the video So
1:47
320 you can change this to
1:50
240 and then the output file name So
1:53
output mp4 So this is essentially the
1:56
command guys Here we basically loop
1:59
through the single image image.png and
2:02
then we providing the encoder Then we
2:04
are putting the length of the video
2:06
which is 15 second and again we are
2:09
putting this video filter scaling this
2:11
video 320x 240 And this is your output
2:14
file So if I just press the enter key
2:16
you will see it will create this uh MP4
2:19
file And uh you can see the video file
2:22
is automatically created If I open this
2:25
file right here the single image will
2:27
appear for 15 seconds You will see
2:30
that total length of the video is 15
2:33
seconds So you can take uh any image
2:36
using this command You can convert any
2:39
single image to a particular video very
2:41
simply inside
2:43
FMPG So thank you very much I've given
2:45
the command in the description of this
2:47
video and also check out my website
2:50
freemediatools.com which contains
2:52
thousands of tools
#Multimedia Software